MantisBT - CMake | |||||
View Issue Details | |||||
ID | Project | Category | View Status | Date Submitted | Last Update |
0013439 | CMake | CMake | public | 2012-07-25 17:33 | 2016-06-10 14:31 |
Reporter | Pieter Swinkels | ||||
Assigned To | Philip Lowman | ||||
Priority | normal | Severity | minor | Reproducibility | always |
Status | closed | Resolution | moved | ||
Platform | Linux | OS | Ubuntu | OS Version | 12.04 |
Product Version | CMake 2.8.7 | ||||
Target Version | Fixed in Version | ||||
Summary | 0013439: consecutive find_package(Boost ...) statements only find the static lib regardless of Boost_USE_STATIC_LIBS | ||||
Description | Consecutive find_package(Boost ...) statements for the same Boost component in the same file CMakeLists.txt but - the first time with Boost_USE_STATIC_LIBS to ON and - the second time with BOOST_USE_STATIC_LIBS to OFF always finds the static library. | ||||
Steps To Reproduce | Try something like this: set(Boost_USE_STATIC_LIBS ON) find_package(Boost COMPONENTS unit_test_framework REQUIRED) if (Boost_FOUND) include_directories(${Boost_INCLUDE_DIRS}) endif (Boost_FOUND) # ${BOOST_LIBRARIES} contains the static version of the library add_executable(my-static-find-package-boost-test main-static.cpp) target_link_libraries(my-static-find-package-boost-test ${Boost_LIBRARIES}) unset(Boost_LIBRARIES) message("Boost_LIBRARIES: ${Boost_LIBRARIES}") set(Boost_USE_STATIC_LIBS OFF) find_package(Boost COMPONENTS unit_test_framework REQUIRED) if (Boost_FOUND) include_directories(${Boost_INCLUDE_DIRS}) endif (Boost_FOUND) # ${BOOST_LIBRARIES} still contains the static version of the library add_executable(my-dynamic-find-package-boost-test main-dynamic.cpp) target_link_libraries(my-dynamic-find-package-boost-test ${Boost_LIBRARIES}) | ||||
Additional Information | It is not that the dynamic library cannot be found. If I uncomment the first invocation, clear the cache (!) and run cmake, the dynamic library is found. | ||||
Tags | No tags attached. | ||||
Relationships | |||||
Attached Files | |||||
Issue History | |||||
Date Modified | Username | Field | Change | ||
2012-07-25 17:33 | Pieter Swinkels | New Issue | |||
2012-07-30 02:53 | Rolf Eike Beer | Note Added: 0030151 | |||
2012-08-06 15:30 | Pieter Swinkels | Note Added: 0030178 | |||
2012-08-10 16:35 | Pieter Swinkels | Note Added: 0030213 | |||
2012-08-18 15:30 | Philip Lowman | Status | new => assigned | ||
2012-08-18 15:30 | Philip Lowman | Assigned To | => Philip Lowman | ||
2012-10-04 02:08 | Philip Lowman | Note Added: 0031176 | |||
2016-06-10 14:28 | Kitware Robot | Note Added: 0042096 | |||
2016-06-10 14:28 | Kitware Robot | Status | assigned => resolved | ||
2016-06-10 14:28 | Kitware Robot | Resolution | open => moved | ||
2016-06-10 14:31 | Kitware Robot | Status | resolved => closed |
Notes | |||||
|
|||||
|
|
||||
|
|||||
|
|
||||
|
|||||
|
|
||||
|
|||||
|
|
||||
|
|||||
|
|