Hello, is there any elegant way to add "-DDEBUG" to the complier flag
just in command line?


I don't want to modify my CMakeLists.txt file, I just want to build it when
I run :
cmake -DCMAKE_BUILD_TYPE=Debug -DCMAKE_INSTALL_PREFIX=/usr ..

I tried the following command in CMakeLists.txt:

IF(CMAKE_BUILD_TYPE == debug)
 add_definitions(-DDEBUG)
ENDIF()

But nothing did ...

Thanks
_______________________________________________
Powered by www.kitware.com

Visit other Kitware open-source projects at 
http://www.kitware.com/opensource/opensource.html

Please keep messages on-topic and check the CMake FAQ at: 
http://www.cmake.org/Wiki/CMake_FAQ

Follow this link to subscribe/unsubscribe:
http://www.cmake.org/mailman/listinfo/cmake

Reply via email to