Yuchen Deng wrote: > hi, there! > I was reading the release log in here: > http://www.kitware.com/news/home/browse/CMake? 2012_11_07&CMake+2.8.10+Just+Released > Add see the parts: > >> Generator expressions, which are used to introduce conditional statements >> at generate time rather than at CMake compile time, are now available in >> more contexts, *notably in the INCLUDE_DIRECTORIES and >> COMPILE_DEFINITIONS target properties.* There are also new generator >> expressions available in the 2.8.10 release. > > In many times, I have to add more target in one CMakeLists.txt. > > My question: > How to use for INCLUDE_DIRECTORIES and COMPILE_DEFINITIONS target > properties ? > Any examples? tests? or docs? > Thanks! >
Hi there, I'm impressed that you ask for the tests for this stuff. That's where I look too when I want to find out how to use something. :) The relevant tests in the cmake repo are in Tests/CMakeCommands/* Tests/GeneratorExpressions Tests/CompileDefinitons/target_prop Tests/IncludeDirectories/TargetIncludeDirectories Tests/ExportImport The target_include_directories is the more 'high level' API around the more low-level INCLUDE_DIRECTORIES and COMPILE_DEFINITIONS properties in the other tests. See the docs like cmake --help-property INTERFACE_INCLUDE_DIRECTORIES cmake --help-property INTERFACE_COMPILE_DEFINITIONS cmake --help-variable CMAKE_BUILD_INTERFACE_INCLUDES (note that this will be renamed to CMAKE_INCLUDE_CURRENT_DIR_IN_INTERFACE soon) See also more information here: http://thread.gmane.org/gmane.comp.kde.devel.buildsystem/7778 Thanks for trying the stuff out, Steve. -- 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