Notes |
|
(0031234)
|
Brad King
|
2012-10-15 08:25
|
|
I cannot reproduce this. Please attach a minimal but complete example source tarball. |
|
|
(0031240)
|
vkaramov
|
2012-10-16 04:11
|
|
I could reproduce it on 2 computers with Ubuntu 12.04 AMD64. |
|
|
(0031242)
|
Brad King
|
2012-10-16 06:58
|
|
Your description said "one of the libraries is NOTFOUND". It is actually "one of the libraries is FIND_RESULT-NOTFOUND":
$ cat ../CMakeLists.txt
cmake_minimum_required(VERSION 2.8.7)
project(Issue13588 C)
add_executable(fail main.c)
target_link_libraries(fail debug m-NOTFOUND optimized m)
$ cmake --version
cmake version 2.8.9
$ cmake .. -DCMAKE_BUILD_TYPE=Release
...
CMake Error: The following variables are used in this project, but they are set
to NOTFOUND.
Please set them or make sure they are set and tested correctly in the CMake files:
m
linked by target "fail" in directory ...
The check is here:
http://cmake.org/gitweb?p=cmake.git;a=blob;f=Source/cmGlobalGenerator.cxx;hb=v2.8.9#l1125 [^]
and is so old that it pre-dates the optimized/debug keywords.
Furthermore, there is a regression in 2.8.10-rc1 in that it does not check for foo-NOTFOUND results correctly. |
|
|
(0031246)
|
Brad King
|
2012-10-16 09:23
|
|
In multi-config generators like VS and Xcode the check is correct because all configurations are generated at once. If you want to ensure libs that are not found do not get used, do something like
find_library(mylib_RELEASE ...)
find_library(mylib_DEBUG ...)
if(mylib_RELEASE AND mylib_DEBUG)
set(mylib_LIBRARIES optimized ${mylib_RELEASE} debug ${mylib_DEBUG})
elseif(mylib_RELEASE)
set(mylib_LIBRARIES ${mylib_RELEASE})
elseif(mylib_DEBUG)
set(mylib_LIBRARIES ${mylib_DEBUG})
else()
message(SEND_ERROR "No mylib found!")
endif()
# ...
target_link_libraries(${mytarget} ${mylib_LIBRARIES})
Some find modules do this already.
The regression noted in 0013588:0031242 will be addressed before 2.8.10 final.
|
|
|
(0032473)
|
Robert Maynard
|
2013-03-04 08:38
|
|
Closing resolved issues that have not been updated in more than 4 months. |
|