-
Notifications
You must be signed in to change notification settings - Fork 1.7k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Missing dependencies on CMake exported target #1384
Comments
let us know version of cmake on your pc and version of cpprestsdk |
CMake 3.14 |
my pc: cmake version 3.10.2 Using cmd as below to switch to boost-1.72.0 I can cross compiler and push lib at https://github.com/letrthong/orangepi_zero_release/tree/master/x32 with toolchain gcc-linaro-arm-linux/gcc-linaro-7.3.1-2018.05-x86_64_arm-linux-gnueabihf/bin/arm-linux-gnueabihf-g++ |
Resolved by #1383? |
…)" This reverts commit cb7ca74. Issues concerning OpenSSL dependency and linking (microsoft#1384, microsoft#1388) and cross compiling (microsoft#1378) have been reported. - Fixes microsoft#1384, microsoft#1388
…)" This reverts commit cb7ca74. Issues concerning OpenSSL linking dependency (microsoft#1384, microsoft#1388) and cross compiling (microsoft#1378) have been reported. - Fixes microsoft#1384, microsoft#1388
Not quite. #1383 fixes only part of the problem: now Boost is searched for through the What I want to be able to do (taken directly from the project's README): cmake_minimum_required(VERSION 3.9)
project(main)
find_package(cpprestsdk REQUIRED)
add_executable(main main.cpp)
target_link_libraries(main PRIVATE cpprestsdk::cpprest) But this does not work. the What I need to do now is: cmake_minimum_required(VERSION 3.9)
project(main)
find_package(cpprestsdk REQUIRED)
add_executable(main main.cpp)
target_link_libraries(main PRIVATE cpprestsdk::cpprest Boost::system OpenSSL::Crypto) |
The problem is that the targets imported by the calls to For example, Boost::system
Boost::date_time
Boost::regex But the macro Now one would expect this would still work, (assuming that The problem described above also occurs with the other dependencies (zlib, openssl, etc) |
The cpprestsdk exported target created during the build process of the libraries
does not carry all required dependencies.
For one, the Boost and openSSL dependencies are not defined on the target.
Commit cb7ca74 seems to have broken this for openSSL, by always defaulting to pkg-config for searching OpenSSL.
The issue leading to that commit has been solved in the find_package module by kitware: https://gitlab.kitware.com/cmake/cmake/-/issues/16885
For Boost this seems to be disabled deliberately...
cpprestsdk/Release/cmake/cpprest_find_boost.cmake
Lines 55 to 76 in f4124a9
Running
git blame
on this file shows that that comment on line 54 was made 3 years ago...Is it still relevant?
I saw that at the time serious effort was put into using modern CMake, so it would be nice to actually be able to see that in action.
Also, because of the above, the simple CMakeLists.txt file listed on the Readme is not working.
The text was updated successfully, but these errors were encountered: