Conan 测试

Steps

首先按照Getting Started — conan 1.39.0 documentation建立相关文件

G:\temp\test_conan>mkdir build && cd build

G:\temp\test_conan\build>conan install ..
Auto detecting your dev setup to initialize the default profile (C:\Users\cutep\.conan\profiles\default)
Found Visual Studio 16
Default settings
        os=Windows
        os_build=Windows
        arch=x86_64
        arch_build=x86_64
        compiler=Visual Studio
        compiler.version=16
        build_type=Release
*** You can change them in C:\Users\cutep\.conan\profiles\default ***
*** Or override with -s compiler='other' -s ...s***


Configuration:
[settings]
arch=x86_64
arch_build=x86_64
build_type=Release
compiler=Visual Studio
compiler.runtime=MD
compiler.version=16
os=Windows
os_build=Windows
[options]
[build_requires]
[env]

pcre/8.45: Not found in local cache, looking in remotes...
pcre/8.45: Trying with 'conancenter'...
Downloading conanmanifest.txt completed [0.17k]
Downloading conanfile.py completed [8.53k]
Downloading conan_export.tgz completed [0.24k]
Decompressing conan_export.tgz completed [0.00k]
pcre/8.45: Downloaded recipe revision 0
bzip2/1.0.8: Not found in local cache, looking in remotes...
bzip2/1.0.8: Trying with 'conancenter'...
Downloading conanmanifest.txt completed [0.25k]
Downloading conanfile.py completed [3.80k]
Downloading conan_export.tgz completed [0.24k]
Decompressing conan_export.tgz completed [0.00k]
bzip2/1.0.8: Downloaded recipe revision 0
zlib/1.2.11: Not found in local cache, looking in remotes...
zlib/1.2.11: Trying with 'conancenter'...
Downloading conanmanifest.txt completed [0.35k]
Downloading conanfile.py completed [5.94k]
Downloading conan_export.tgz completed [0.34k]
Decompressing conan_export.tgz completed [0.00k]
zlib/1.2.11: Downloaded recipe revision 0
expat/2.4.1: Not found in local cache, looking in remotes...
expat/2.4.1: Trying with 'conancenter'...
Downloading conanmanifest.txt completed [0.25k]
Downloading conanfile.py completed [3.56k]
Downloading conan_export.tgz completed [0.26k]
Decompressing conan_export.tgz completed [0.00k]
expat/2.4.1: Downloaded recipe revision 0
sqlite3/3.36.0: Not found in local cache, looking in remotes...
sqlite3/3.36.0: Trying with 'conancenter'...
Downloading conanmanifest.txt completed [0.17k]
Downloading conanfile.py completed [8.50k]
Downloading conan_export.tgz completed [0.24k]
Decompressing conan_export.tgz completed [0.00k]
sqlite3/3.36.0: Downloaded recipe revision 0
openssl/1.1.1k: Not found in local cache, looking in remotes...
openssl/1.1.1k: Trying with 'conancenter'...
Downloading conanmanifest.txt completed [0.26k]
Downloading conanfile.py completed [39.90k]
Downloading conan_export.tgz completed [0.25k]
Decompressing conan_export.tgz completed [0.00k]
openssl/1.1.1k: Downloaded recipe revision 0
conanfile.txt: Installing package
Requirements
    bzip2/1.0.8 from 'conancenter' - Downloaded
    expat/2.4.1 from 'conancenter' - Downloaded
    openssl/1.1.1k from 'conancenter' - Downloaded
    pcre/8.45 from 'conancenter' - Downloaded
    poco/1.9.4 from 'conancenter' - Cache
    sqlite3/3.36.0 from 'conancenter' - Downloaded
    zlib/1.2.11 from 'conancenter' - Downloaded
Packages
    bzip2/1.0.8:d16a91eadaaf5829b928b12d2f836ff7680d3df5 - Download
    expat/2.4.1:ce5788ba7e3bb7dc834e36b06df66c481f42c99a - Download
    openssl/1.1.1k:3fb49604f9c2f729b85ba3115852006824e72cab - Download
    pcre/8.45:e87a8a0d1a34c63e57cfcfa8aa6088b17582df41 - Download
    poco/1.9.4:827d0093fffd24b2cf1576c6515a7f7707d5d2b9 - Download
    sqlite3/3.36.0:050fb3a4d3559ab088bce91739e61889c28839d1 - Download
    zlib/1.2.11:3fb49604f9c2f729b85ba3115852006824e72cab - Download

Installing (downloading, building) binaries...
bzip2/1.0.8: Retrieving package d16a91eadaaf5829b928b12d2f836ff7680d3df5 from remote 'conancenter'
Downloading conanmanifest.txt completed [0.33k]
Downloading conaninfo.txt completed [0.48k]
Downloading conan_package.tgz completed [90.22k]
Decompressing conan_package.tgz completed [0.00k]
bzip2/1.0.8: Package installed d16a91eadaaf5829b928b12d2f836ff7680d3df5
bzip2/1.0.8: Downloaded package revision 0
expat/2.4.1: Retrieving package ce5788ba7e3bb7dc834e36b06df66c481f42c99a from remote 'conancenter'
Downloading conanmanifest.txt completed [0.32k]
Downloading conaninfo.txt completed [0.46k]
Downloading conan_package.tgz completed [145.91k]
Decompressing conan_package.tgz completed [0.00k]
expat/2.4.1: Package installed ce5788ba7e3bb7dc834e36b06df66c481f42c99a
expat/2.4.1: Downloaded package revision 0
openssl/1.1.1k: Retrieving package 3fb49604f9c2f729b85ba3115852006824e72cab from remote 'conancenter'
Downloading conanmanifest.txt completed [6.46k]
Downloading conaninfo.txt completed [2.49k]
Downloading conan_package.tgz completed [8494.29k]
Decompressing conan_package.tgz completed [0.00k]
openssl/1.1.1k: Package installed 3fb49604f9c2f729b85ba3115852006824e72cab
openssl/1.1.1k: Downloaded package revision 0
sqlite3/3.36.0: Retrieving package 050fb3a4d3559ab088bce91739e61889c28839d1 from remote 'conancenter'
Downloading conanmanifest.txt completed [0.39k]
Downloading conaninfo.txt completed [1.56k]
Downloading conan_package.tgz completed [1670.36k]
Decompressing conan_package.tgz completed [0.00k]
sqlite3/3.36.0: Package installed 050fb3a4d3559ab088bce91739e61889c28839d1
sqlite3/3.36.0: Downloaded package revision 0
zlib/1.2.11: Retrieving package 3fb49604f9c2f729b85ba3115852006824e72cab from remote 'conancenter'
Downloading conanmanifest.txt completed [0.25k]
Downloading conaninfo.txt completed [0.45k]
Downloading conan_package.tgz completed [98.64k]
Decompressing conan_package.tgz completed [0.00k]
zlib/1.2.11: Package installed 3fb49604f9c2f729b85ba3115852006824e72cab
zlib/1.2.11: Downloaded package revision 0
pcre/8.45: Retrieving package e87a8a0d1a34c63e57cfcfa8aa6088b17582df41 from remote 'conancenter'
Downloading conanmanifest.txt completed [0.50k]
Downloading conaninfo.txt completed [1.18k]
Downloading conan_package.tgz completed [469.50k]
Decompressing conan_package.tgz completed [0.00k]
pcre/8.45: Package installed e87a8a0d1a34c63e57cfcfa8aa6088b17582df41
pcre/8.45: Downloaded package revision 0
poco/1.9.4: Retrieving package 827d0093fffd24b2cf1576c6515a7f7707d5d2b9 from remote 'conancenter'
Downloading conanmanifest.txt completed [48.76k]
Downloading conaninfo.txt completed [4.54k]
Downloading conan_package.tgz completed [10246.81k]
Decompressing conan_package.tgz completed [0.00k]
poco/1.9.4: Package installed 827d0093fffd24b2cf1576c6515a7f7707d5d2b9
poco/1.9.4: Downloaded package revision 0
bzip2/1.0.8: Appending PATH environment variable: C:\Users\cutep\.conan\data\bzip2\1.0.8\_\_\package\d16a91eadaaf5829b928b12d2f836ff7680d3df5\bin
sqlite3/3.36.0: Appending PATH env var with : C:\Users\cutep\.conan\data\sqlite3\3.36.0\_\_\package\050fb3a4d3559ab088bce91739e61889c28839d1\bin
pcre/8.45: Appending PATH environment variable: C:\Users\cutep\.conan\data\pcre\8.45\_\_\package\e87a8a0d1a34c63e57cfcfa8aa6088b17582df41\bin
conanfile.txt: Generator cmake created conanbuildinfo.cmake
conanfile.txt: Generator txt created conanbuildinfo.txt
conanfile.txt: Aggregating env generators
conanfile.txt: Generated conaninfo.txt
conanfile.txt: Generated graphinfo

G:\temp\test_conan\build>[15004:0828/155547.806:ERROR:gpu_init.cc(440)] Passthrough is not supported, GL is disabled

G:\temp\test_conan\build>cmake .. -G "Visual Studio 16"
'cmake' is not recognized as an internal or external command,
operable program or batch file.

G:\temp\test_conan\build>cmake .. -G "Visual Studio 16"
'cmake' is not recognized as an internal or external command,
operable program or batch file.

G:\temp\test_conan\build>G:\sw\cmake-3.18.1-win64-x64\bin\cmake .. -G "Visual Studio 16"
-- Selecting Windows SDK version 10.0.19041.0 to target Windows 10.0.14393.
-- The C compiler identification is MSVC 19.29.30133.0
-- The CXX compiler identification is MSVC 19.29.30133.0
-- Detecting C compiler ABI info
-- Detecting C compiler ABI info - done
-- Check for working C compiler: g:/Program Files (x86)/Microsoft Visual Studio/2019/Professional/VC/Tools/MSVC/14.29.30133/bin/Hostx64/x64/cl.exe - skipped
-- Detecting C compile features
-- Detecting C compile features - done
-- Detecting CXX compiler ABI info
-- Detecting CXX compiler ABI info - done
-- Check for working CXX compiler: g:/Program Files (x86)/Microsoft Visual Studio/2019/Professional/VC/Tools/MSVC/14.29.30133/bin/Hostx64/x64/cl.exe - skipped
-- Detecting CXX compile features
-- Detecting CXX compile features - done
-- Conan: Adjusting output directories
-- Conan: Using cmake global configuration
-- Conan: Adjusting default RPATHs Conan policies
-- Conan: Adjusting language standard
-- Current conanbuildinfo.cmake directory: G:/temp/test_conan/build
-- Configuring done
-- Generating done
-- Build files have been written to: G:/temp/test_conan/build

G:\temp\test_conan\build>G:\sw\cmake-3.18.1-win64-x64\bin\cmake --build
Usage: cmake --build <dir> [options] [-- [native-options]]
Options:
  <dir>          = Project binary directory to be built.
  --parallel [<jobs>], -j [<jobs>]
                 = Build in parallel using the given number of jobs.
                   If <jobs> is omitted the native build tool's
                   default number is used.
                   The CMAKE_BUILD_PARALLEL_LEVEL environment variable
                   specifies a default parallel level when this option
                   is not given.
  --target <tgt>..., -t <tgt>...
                 = Build <tgt> instead of default targets.
  --config <cfg> = For multi-configuration tools, choose <cfg>.
  --clean-first  = Build target 'clean' first, then build.
                   (To clean only, use --target 'clean'.)
  --verbose, -v  = Enable verbose output - if supported - including
                   the build commands to be executed.
  --             = Pass remaining options to the native tool.

G:\temp\test_conan\build>G:\sw\cmake-3.18.1-win64-x64\bin\cmake --build .
Microsoft (R) Build Engine version 16.11.0+0538acc04 for .NET Framework
Copyright (C) Microsoft Corporation. All rights reserved.

  Checking Build System
  Building Custom Rule G:/temp/test_conan/CMakeLists.txt
cl : command line warning D9002: ignoring unknown option '-std=c++11' [G:\temp\test_conan\build\md5.vcxproj]
  md5.cpp
PocoFoundationmd.lib(DigestEngine.obj) : error LNK2038: mismatch detected for '_ITERATOR_DEBUG_LEVEL': value '0' doesn'
t match value '2' in md5.obj [G:\temp\test_conan\build\md5.vcxproj]
PocoFoundationmd.lib(DigestEngine.obj) : error LNK2038: mismatch detected for 'RuntimeLibrary': value 'MD_DynamicReleas
e' doesn't match value 'MDd_DynamicDebug' in md5.obj [G:\temp\test_conan\build\md5.vcxproj]
PocoFoundationmd.lib(MD5Engine.obj) : error LNK2038: mismatch detected for '_ITERATOR_DEBUG_LEVEL': value '0' doesn't m
atch value '2' in md5.obj [G:\temp\test_conan\build\md5.vcxproj]
PocoFoundationmd.lib(MD5Engine.obj) : error LNK2038: mismatch detected for 'RuntimeLibrary': value 'MD_DynamicRelease'
doesn't match value 'MDd_DynamicDebug' in md5.obj [G:\temp\test_conan\build\md5.vcxproj]
PocoFoundationmd.lib(DigestStream.obj) : error LNK2038: mismatch detected for '_ITERATOR_DEBUG_LEVEL': value '0' doesn'
t match value '2' in md5.obj [G:\temp\test_conan\build\md5.vcxproj]
PocoFoundationmd.lib(DigestStream.obj) : error LNK2038: mismatch detected for 'RuntimeLibrary': value 'MD_DynamicReleas
e' doesn't match value 'MDd_DynamicDebug' in md5.obj [G:\temp\test_conan\build\md5.vcxproj]
PocoFoundationmd.lib(Exception.obj) : error LNK2038: mismatch detected for '_ITERATOR_DEBUG_LEVEL': value '0' doesn't m
atch value '2' in md5.obj [G:\temp\test_conan\build\md5.vcxproj]
PocoFoundationmd.lib(Exception.obj) : error LNK2038: mismatch detected for 'RuntimeLibrary': value 'MD_DynamicRelease'
doesn't match value 'MDd_DynamicDebug' in md5.obj [G:\temp\test_conan\build\md5.vcxproj]
LINK : warning LNK4098: defaultlib 'MSVCRT' conflicts with use of other libs; use /NODEFAULTLIB:library [G:\temp\test_c
onan\build\md5.vcxproj]
G:\temp\test_conan\build\bin\md5.exe : fatal error LNK1319: 8 mismatches detected [G:\temp\test_conan\build\md5.vcxproj
]

G:\temp\test_conan\build>G:\sw\cmake-3.18.1-win64-x64\bin\cmake --build . --config Release
Microsoft (R) Build Engine version 16.11.0+0538acc04 for .NET Framework
Copyright (C) Microsoft Corporation. All rights reserved.

  Checking Build System
  Building Custom Rule G:/temp/test_conan/CMakeLists.txt
cl : command line warning D9002: ignoring unknown option '-std=c++11' [G:\temp\test_conan\build\md5.vcxproj]
  md5.cpp
  md5.vcxproj -> G:\temp\test_conan\build\bin\md5.exe
  Building Custom Rule G:/temp/test_conan/CMakeLists.txt

G:\temp\test_conan\build>


几个有趣的东西

他的默认配置文件事release的,但是cmake默认是debug的,所以直接cmake编译会说有问题

解决方案是或者cmake加入参数G:\sw\cmake-3.18.1-win64-x64\bin\cmake --build . --config Release

或者是把conan默认参数改为debug的,具体为修改C:\Users\cutep\.conan\profiles\defaultbuild_type=Debug

Powered by Jekyll and Theme by solid

本站总访问量