[CMake] TARGET_LINK_LIBRARIES debug and optimized

Ken Martin ken.martin at kitware.com
Mon Jun 13 09:20:37 EDT 2005


> I just notice that cmake from CVS ignore the "debug" argument in
> TARGET_LINK_LIBRARIES.
> The following code shows the problem:
> 
> ADD_EXECUTABLE(dr main.cc)
> TARGET_LINK_LIBRARIES(dr debug mylib_debug optimized mylib)
> 
> *Using cmake from CVS (cmake version 2.1-20050611)*
> 
> $ cmake -DCMAKE_BUILD_TYPE=release


Should that be 
$ cmake -DCMAKE_BUILD_TYPE=Release


> src/dr: src/dr.dir/main.o
> src/dr: libs/libmylib_debug.a
> src/dr: libs/libmylib.a
> src/dr: src/dr.dir/build.make
> 	@echo "Linking CXX executable src/dr"
> 	c++      -O3 -DNDEBUG -fPIC $(dr_OBJECTS) $(dr_EXTERNAL_OBJECTS)
> -o src/dr
> -rdynamic -L/home/fsousa/tmp/dr/build/libs -lmylib
> -Wl,-rpath,/home/fsousa/tmp/dr/build/libs
> 
> $ cmake -DCMAKE_BUILD_TYPE=debug

And...
$ cmake -DCMAKE_BUILD_TYPE=Debug






More information about the CMake mailing list