File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -8,22 +8,28 @@ include_guard(GLOBAL)
88Show project version friendly
99]]
1010macro (show_project_version )
11- message (STATUS "CMAKE_PROJECT_VERSION finally:${CMAKE_PROJECT_VERSION} " )
12- message (STATUS "CMAKE_PROJECT_VERSION_MAJOR: ${CMAKE_PROJECT_VERSION_MAJOR} " )
13- message (STATUS "CMAKE_PROJECT_VERSION_MINOR: ${CMAKE_PROJECT_VERSION_MINOR} " )
14- message (STATUS "CMAKE_PROJECT_VERSION_PATCH: ${CMAKE_PROJECT_VERSION_PATCH} " )
15- message (STATUS "CMAKE_PROJECT_VERSION_TWEAK: ${CMAKE_PROJECT_VERSION_TWEAK} " )
11+ message (STATUS "CMake Project Version:" )
12+ message (STATUS "\t CMAKE_PROJECT_VERSION:${CMAKE_PROJECT_VERSION} " )
13+ message (
14+ STATUS "\t CMAKE_PROJECT_VERSION_MAJOR: ${CMAKE_PROJECT_VERSION_MAJOR} " )
15+ message (
16+ STATUS "\t CMAKE_PROJECT_VERSION_MINOR: ${CMAKE_PROJECT_VERSION_MINOR} " )
17+ message (
18+ STATUS "\t CMAKE_PROJECT_VERSION_PATCH: ${CMAKE_PROJECT_VERSION_PATCH} " )
19+ message (
20+ STATUS "\t CMAKE_PROJECT_VERSION_TWEAK: ${CMAKE_PROJECT_VERSION_TWEAK} " )
1621endmacro ()
1722
1823#[[
1924Show vcpkg configurition
2025]]
2126function (show_vcpkg_configuration )
2227 # Print all vcpkg variables
28+ message (STATUS "Vcpkg Integration:" )
2329 get_cmake_property (_vars VARIABLES )
2430 foreach (_var IN LISTS _vars)
2531 if (_var MATCHES "^VCPKG_" )
26- message (STATUS "${_var} ${${_var} }" )
32+ message (STATUS "\t ${_var} ${${_var} }" )
2733 endif ()
2834 endforeach ()
2935endfunction ()
Original file line number Diff line number Diff line change @@ -333,13 +333,26 @@ inline const StringOrView Describe() {
333333
334334 configure_file ("${arg_CONFIGURE_HEADER_FILE} " "${arg_DESTINATION} " @ONLY )
335335
336- get_filename_component (arg_DESTINATION_PATH ${arg_DESTINATION} DIRECTORY )
336+ get_filename_component (_destination_dir ${arg_DESTINATION} DIRECTORY )
337+
338+ string (REPLACE "${CMAKE_CURRENT_BINARY_DIR} " "" _binary_include_dir
339+ "${_destination_dir} " )
340+ string (REPLACE "${CMAKE_CURRENT_SOURCE_DIR} " "" _source_include_dir
341+ "${_destination_dir} " )
342+
343+ if (NOT "${_binary_include_dir} " STREQUAL "${_destination_dir} " )
344+ set (_include_dir_for_target
345+ "\$ {CMAKE_CURRENT_BINARY_DIR}${_binary_include_dir} " )
346+ else ()
347+ set (_include_dir_for_target
348+ "\$ {CMAKE_CURRENT_SOURCE_DIR}${_source_include_dir} " )
349+ endif ()
337350
338351 message (
339352 STATUS
340353 "Generated a git-based version header including project metadata in ${arg_DESTINATION} from ${arg_CONFIGURE_HEADER_FILE}
341354 Usage:
342- target_include_directories(${arg_DESTINATION_PATH } )
343- # Or refer to https://github.com/msclock/cmake-modules/blob/master/cmake/configure/GitTools.cmake
344- target_include_interface_directories(${arg_DESTINATION_PATH } )" )
355+ target_include_directories(${_include_dir_for_target } )
356+ # or
357+ target_include_interface_directories(${_include_dir_for_target } )" )
345358endfunction ()
Original file line number Diff line number Diff line change @@ -8,9 +8,10 @@ include_guard(GLOBAL)
88Show installation directories
99]]
1010macro (show_installation )
11+ message (STATUS "Installation Paths:" )
1112 foreach (_p LIB BIN INCLUDE CMAKE)
1213 file (TO_NATIVE_PATH ${CMAKE_INSTALL_PREFIX} /${CMAKE_INSTALL_${_p}DIR} _path )
13- message (STATUS "Show ${_p} components installation path: ${_path} " )
14+ message (STATUS "\t ${_p} installation path: ${_path} " )
1415 unset (_path)
1516 endforeach ()
1617endmacro ()
You can’t perform that action at this time.
0 commit comments