Hi,
I've a top level project which is using Qt. Therefore I've a lot of
defines and compiler switches on.
Further more, there is an of Qt independent library with unit tests.
$ cat project/CMakeLists.txt
...
add_definitions(-DQT_NO_KEYWORDS)
add_definitions(-DQT_NO_CAST_FROM_ASCII)
add_definitions(-DQT_NO_CAST_TO_ASCII)
...
$ cat project/molp/CMakeLists.txt
project(molp)
set(molp_SOURCES grammar.cpp)
add_library(molp STATIC ${molp_SOURCES})
add_subdirectory(test)
$ cat project/molp/test/CMakeLists.txt
project(molp_unit_test)
set(CMAKE_CXX_FLAGS "-g") # wont' work
set(molp_ut_SOURCES test.cpp )
add_executable( molp_ut ${molp_ut_SOURCES} )
target_link_libraries( molp_ut molp )
add_test(
NAME molp
COMMAND molp_ut --run_test=all )
How to set the compiler defines/switches for the sub-projects?
Thanks,
Olaf
_______________________________________________
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