소스 검색

CONFIGURE_PACKAGE_CONFIG_FILE(): improve generated comments

CONFIGURE_PACKAGE_CONFIG_FILE() now additionally generates
"Any changes to this file will be overwritten by the next CMake run
The input file was FooConfig.cmake.in"
into the configured file.

Alex
Alex Neundorf 13 년 전
부모
커밋
8039bd0864
1개의 변경된 파일5개의 추가작업 그리고 0개의 파일을 삭제
  1. 5 0
      Modules/CMakePackageConfigHelpers.cmake

+ 5 - 0
Modules/CMakePackageConfigHelpers.cmake

@@ -188,8 +188,13 @@ function(CONFIGURE_PACKAGE_CONFIG_FILE _inputFile _outputFile)
     endif()
   endforeach()
 
+  get_filename_component(inputFileName "${_inputFile}" NAME)
+
   set(PACKAGE_INIT "
 ####### Expanded from @PACKAGE_INIT@ by configure_package_config_file() #######
+####### Any changes to this file will be overwritten by the next CMake run ####
+####### The input file was ${inputFileName}                            ########
+
 get_filename_component(PACKAGE_PREFIX_DIR \"\${CMAKE_CURRENT_LIST_DIR}/${PACKAGE_RELATIVE_PATH}\" ABSOLUTE)
 ")