Are there other means of obtaining the properties of a target in cmake? <p>I have created a C++ static library, and in order to make it searchable easily, I create the following cmake files:</p> <p><strong>lib.cmake</strong></p> <pre><code># The installation prefix configured by this project. set(_IMPORT_PREFIX "C:/------/install/win32") # Create imported target boost add_library(lib STATIC IMPORTED) set_target_properties(lib PROPERTIES INTERFACE_COMPILE_DEFINITIONS "lib_define1;lib_define2" INTERFACE_INCLUDE_DIRECTORIES "${_IMPORT_PREFIX}/../include" ) # Load information for each installed configuration. get_filename_component(_DIR "${CMAKE_CURRENT_LIST_FILE}" PATH) file(GLOB CONFIG_FILES "${_DIR}/lib-*.cmake") foreach(f ${CONFIG_FILES}) include(${f}) endforeach() </code></pre> <p><strong>lib-debug.cmake</strong></p> <pre><code># Import target "boost" for configuration "Debug" set_property(TARGET lib APPEND PROPERTY IMPORTED_CONFIGURATIONS DEBUG) set_target_properties(boost PROPERTIES IMPORTED_LINK_INTERFACE_LANGUAGES_DEBUG "CXX" IMPORTED_LOCATION_DEBUG "${_IMPORT_PREFIX}/Debug/staticlib/lib.lib" ) </code></pre> <p>When I want to use this library in an executable, I can simply invoke it by calling find_package command:</p> <pre><code>find_package(lib REQUIRED) if(lib_FOUND) message("lib has been found") else() message("lib cannot be found") endif(boost_FOUND) </code></pre> <p>It works and if I want to know the head file directory of the library, I will have to call it this way:</p> <pre><code> get_target_property(lib_dir lib INTERFACE_INCLUDE_DIRECTORIES) </code></pre> <p>I was just wondering whether there are other ways of obtaining the properties of an target. In this case I expect some variable like <code>lib_INCLUDE_DIRECTORIES</code> will exist. </p>