[CMake] namespace support

Eric Noulard eric.noulard at gmail.com
Wed Feb 2 10:51:42 EST 2011


2011/2/2 Michael Wild <themiwi at gmail.com>:
>
> Put a CMakeLists.txt file in a/ and b/ and do the include_directories()
> and add_library() calls in there. That's the only way to have separate
> include directories since there is no corresponding target property
> (which admittedly would be nice to have).

As a workaround may be COMPILE_FLAGS is usable for this particular purpose

add_library(a MODULE a/a.cpp)
set_target_properties(a PROPERTIES COMPILE_FLAGS
"-I${CMAKE_CURRENT_SOURCE_DIR}/a")

since "-I" is AFAIK relatively standard compiler flags, this should work.

now having a proper "INCLUDE_DIRS" property on target would certainly be better.

-- 
Erk
Membre de l'April - « promouvoir et défendre le logiciel libre » -
http://www.april.org


More information about the CMake mailing list