windows - CMake forbinder ikke statisk bibliotek med andre statiske biblioteker

Indlæg af Hanne Mølgaard Plasc

Problem



Jeg opretter et statisk bibliotek, og det drejer sig om andre biblioteker. Jeg laver dette bibliotek på Windows platform. Jeg er ny til cmake, men har prøvet sådan:


set(Agent17\_LIB Agent17Lib)
add\_library(${Agent17\_LIB} "${PROJECT\_SOURCE\_DIR}/Agent17Lib.cpp")


find\_library(awscppiotsdklib aws-iot-sdk-cpp.lib ${PROJECT\_SOURCE\_DIR}/../Libs/aws-iot-device-sdk-cpp/build-64/archive/Debug)
MESSAGE( STATUS "awscppiotsdklib path:         " ${awscppiotsdklib} )

find\_library(awscppsdkcorelib aws-cpp-sdk-core.lib ${PROJECT\_SOURCE\_DIR}/../Libs/aws-cpp-sdk-core/Debug)
MESSAGE( STATUS "awscppsdkcorelib path:         " ${awscppsdkcorelib} )

find\_library(awscppsdks3lib aws-cpp-sdk-s3.lib ${PROJECT\_SOURCE\_DIR}/../Libs/aws-cpp-sdk-s3/Debug)
MESSAGE( STATUS "awscppsdks3lib path:         " ${awscppsdks3lib} )

find\_library(awscppsdkstslib aws-cpp-sdk-sts.lib ${PROJECT\_SOURCE\_DIR}/../Libs/aws-cpp-sdk-sts/Debug)
MESSAGE( STATUS "awscppsdkstslib path:         " ${awscppsdkstslib} )

find\_library(libcurllib libcurld.lib ${PROJECT\_SOURCE\_DIR}/../Libs/Curl)
MESSAGE( STATUS "libcurllib path:         " ${libcurllib} )

find\_library(ssleay32MDlib ssleay32MD.lib ${PROJECT\_SOURCE\_DIR}/../Libs/OpenSSL-Win64/lib/VC)
MESSAGE( STATUS "ssleay32MDlib path:         " ${ssleay32MDlib} )

find\_library(libeay32MDlib libeay32MD.lib ${PROJECT\_SOURCE\_DIR}/../Libs/OpenSSL-Win64/lib/VC)
MESSAGE( STATUS "libeay32MDlib path:         " ${libeay32MDlib} )

target\_link\_libraries (${Agent17\_LIB} awscppiotsdklib awscppsdkcorelib awscppsdks3lib awscppsdkstslib libcurllib ssleay32MDlib libeay32MDlib)


Men ligner mit målbibliotek-Agent17\_LIB bliver oprettet uden at omfatte de andre biblioteker.


Enhver hjælp værdsat. Jeg sidder fast på dette tidspunkt.


Udgangen jeg fik er:


$ cmake -G "Visual Studio 15 2017 Win64" ../.
-- The CXX compiler identification is MSVC 19.13.26131.1
-- Check for working CXX compiler: C:/Program Files (x86)/Microsoft Visual Studio/2017/Community/VC/Tools/MSVC/14.13.26128/bin/Hostx86/x64/cl.exe
-- Check for working CXX compiler: C:/Program Files (x86)/Microsoft Visual Studio/2017/Community/VC/Tools/MSVC/14.13.26128/bin/Hostx86/x64/cl.exe -- works
-- Detecting CXX compiler ABI info
-- Detecting CXX compiler ABI info - done
-- Detecting CXX compile features
-- Detecting CXX compile features - done
-- awscppiotsdklib path: C:/Work/rits-git-working/Libs/aws-iot-device-sdk-cpp/build-64/archive/Debug/aws-iot-sdk-cpp.lib
-- awscppsdkcorelib path: C:/Work/rits-git-working/Libs/aws-cpp-sdk-core/Debug/aws-cpp-sdk-core.lib
-- awscppsdks3lib path: C:/Work/rits-git-working/Libs/aws-cpp-sdk-s3/Debug/aws-cpp-sdk-s3.lib
-- awscppsdkstslib path: C:/Work/rits-git-working/Libs/aws-cpp-sdk-sts/Debug/aws-cpp-sdk-sts.lib
-- libcurllib path: C:/Work/rits-git-working/Libs/Curl/libcurld.lib
-- ssleay32MDlib path: C:/Work/rits-git-working/Libs/OpenSSL-Win64/lib/VC/ssleay32MD.lib
-- libeay32MDlib path: C:/Work/rits-git-working/Libs/OpenSSL-Win64/lib/VC/libeay32MD.lib
-- CMAKE\_BINARY\_DIR path: C:/Work/rits-git-working/Agent17Lib/build
-- Configuring done
-- Generating done
-- Build files have been written to: C:/Work/rits-git-working/Agent17Lib/build


Er der en måde fra cmake at opdatere bibliotekarafsnit af projektegenskaber til et visuelt studieprojekt? Hvis jeg opdaterer bibliotekar sektionen manuelt, så er jeg i stand til at oprette masterbiblioteket med succes, men jeg kan ikke regne ud, hvordan jeg opdaterer bibliotekar fra cmake.

Bedste reference