https://github.com/Kitware/CMake
Tip revision: 9cfff766eb26ab8b29aa509e42d6b367dd00c7b7 authored by Brad King on 15 November 2023, 13:55:18 UTC
CMake 3.27.8
CMake 3.27.8
Tip revision: 9cfff76
TARGET_PROPERTY.cmake
enable_language(C)
add_library (lib SHARED empty.c)
set_target_properties(lib PROPERTIES
INCLUDE_DIRECTORIES "$<$<COMPILE_LANGUAGE:C>:/usr/include>"
COMPILE_DEFINITIONS "$<$<COMPILE_LANGUAGE:C>:DEF>"
COMPILE_OPTIONS "$<$<COMPILE_LANGUAGE:C>:-O>")
add_custom_target(drive
COMMAND ${CMAKE_COMMAND} -E echo $<TARGET_PROPERTY:lib,INCLUDE_DIRECTORIES>
$<TARGET_PROPERTY:lib,COMPILE_DEFINITIONS>
$<TARGET_PROPERTY:lib,COMPILE_OPTIONS>)
add_custom_command(TARGET drive PRE_BUILD
COMMAND ${CMAKE_COMMAND} -E echo $<TARGET_PROPERTY:lib,INCLUDE_DIRECTORIES>
$<TARGET_PROPERTY:lib,COMPILE_DEFINITIONS>
$<TARGET_PROPERTY:lib,COMPILE_OPTIONS>)