[ACCEPTED]-cmake add_definitions and COMPILE_DEFINITIONS, how to see them-cmake
Accepted answer
You want to extract the COMPILE_DEFINITIONS 7 property from the directory. E.g. use the following:
add_definitions( -DDebug )
get_directory_property( DirDefs DIRECTORY ${CMAKE_SOURCE_DIR} COMPILE_DEFINITIONS )
Then 6 you can simply iterate over them, e.g.:
foreach( d ${DirDefs} )
message( STATUS "Found Define: " ${d} )
endforeach()
message( STATUS "DirDefs: " ${DirDefs} )
Note 5 that definitions may also be associated 4 with targets or source-files instead of directories. And note 3 that they can differ between configurations. Depending 2 on your requirements, you may need to check 1 a large set of different properties.
Source:
stackoverflow.com
More Related questions
Cookie Warning
We use cookies to improve the performance of the site. By staying on our site, you agree to the terms of use of cookies.