FindPythonLibs.cmake 16 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399
  1. # Distributed under the OSI-approved BSD 3-Clause License. See accompanying
  2. # file Copyright.txt or https://cmake.org/licensing for details.
  3. #[=======================================================================[.rst:
  4. FindPythonLibs
  5. --------------
  6. .. deprecated:: 3.12
  7. Use :module:`FindPython3`, :module:`FindPython2` or :module:`FindPython` instead.
  8. Find python libraries
  9. This module finds if Python is installed and determines where the
  10. include files and libraries are. It also determines what the name of
  11. the library is. This code sets the following variables:
  12. ::
  13. PYTHONLIBS_FOUND - have the Python libs been found
  14. PYTHON_LIBRARIES - path to the python library
  15. PYTHON_INCLUDE_PATH - path to where Python.h is found (deprecated)
  16. PYTHON_INCLUDE_DIRS - path to where Python.h is found
  17. PYTHON_DEBUG_LIBRARIES - path to the debug library (deprecated)
  18. PYTHONLIBS_VERSION_STRING - version of the Python libs found (since CMake 2.8.8)
  19. The Python_ADDITIONAL_VERSIONS variable can be used to specify a list
  20. of version numbers that should be taken into account when searching
  21. for Python. You need to set this variable before calling
  22. find_package(PythonLibs).
  23. If you'd like to specify the installation of Python to use, you should
  24. modify the following cache variables:
  25. ::
  26. PYTHON_LIBRARY - path to the python library
  27. PYTHON_INCLUDE_DIR - path to where Python.h is found
  28. If calling both ``find_package(PythonInterp)`` and
  29. ``find_package(PythonLibs)``, call ``find_package(PythonInterp)`` first to
  30. get the currently active Python version by default with a consistent version
  31. of PYTHON_LIBRARIES.
  32. #]=======================================================================]
  33. # Use the executable's path as a hint
  34. set(_Python_LIBRARY_PATH_HINT)
  35. if(IS_ABSOLUTE "${PYTHON_EXECUTABLE}")
  36. if(WIN32)
  37. get_filename_component(_Python_PREFIX "${PYTHON_EXECUTABLE}" PATH)
  38. if(_Python_PREFIX)
  39. set(_Python_LIBRARY_PATH_HINT ${_Python_PREFIX}/libs)
  40. endif()
  41. unset(_Python_PREFIX)
  42. else()
  43. get_filename_component(_Python_PREFIX "${PYTHON_EXECUTABLE}" PATH)
  44. get_filename_component(_Python_PREFIX "${_Python_PREFIX}" PATH)
  45. if(_Python_PREFIX)
  46. set(_Python_LIBRARY_PATH_HINT ${_Python_PREFIX}/lib)
  47. endif()
  48. unset(_Python_PREFIX)
  49. endif()
  50. endif()
  51. include(${CMAKE_CURRENT_LIST_DIR}/CMakeFindFrameworks.cmake)
  52. # Search for the python framework on Apple.
  53. CMAKE_FIND_FRAMEWORKS(Python)
  54. # Save CMAKE_FIND_FRAMEWORK
  55. if(DEFINED CMAKE_FIND_FRAMEWORK)
  56. set(_PythonLibs_CMAKE_FIND_FRAMEWORK ${CMAKE_FIND_FRAMEWORK})
  57. else()
  58. unset(_PythonLibs_CMAKE_FIND_FRAMEWORK)
  59. endif()
  60. # To avoid picking up the system Python.h pre-maturely.
  61. set(CMAKE_FIND_FRAMEWORK LAST)
  62. set(_PYTHON1_VERSIONS 1.6 1.5)
  63. set(_PYTHON2_VERSIONS 2.7 2.6 2.5 2.4 2.3 2.2 2.1 2.0)
  64. set(_PYTHON3_VERSIONS 3.9 3.8 3.7 3.6 3.5 3.4 3.3 3.2 3.1 3.0)
  65. if(PythonLibs_FIND_VERSION)
  66. if(PythonLibs_FIND_VERSION_COUNT GREATER 1)
  67. set(_PYTHON_FIND_MAJ_MIN "${PythonLibs_FIND_VERSION_MAJOR}.${PythonLibs_FIND_VERSION_MINOR}")
  68. unset(_PYTHON_FIND_OTHER_VERSIONS)
  69. if(PythonLibs_FIND_VERSION_EXACT)
  70. if(_PYTHON_FIND_MAJ_MIN STREQUAL PythonLibs_FIND_VERSION)
  71. set(_PYTHON_FIND_OTHER_VERSIONS "${PythonLibs_FIND_VERSION}")
  72. else()
  73. set(_PYTHON_FIND_OTHER_VERSIONS "${PythonLibs_FIND_VERSION}" "${_PYTHON_FIND_MAJ_MIN}")
  74. endif()
  75. else()
  76. foreach(_PYTHON_V ${_PYTHON${PythonLibs_FIND_VERSION_MAJOR}_VERSIONS})
  77. if(NOT _PYTHON_V VERSION_LESS _PYTHON_FIND_MAJ_MIN)
  78. list(APPEND _PYTHON_FIND_OTHER_VERSIONS ${_PYTHON_V})
  79. endif()
  80. endforeach()
  81. endif()
  82. unset(_PYTHON_FIND_MAJ_MIN)
  83. else()
  84. set(_PYTHON_FIND_OTHER_VERSIONS ${_PYTHON${PythonLibs_FIND_VERSION_MAJOR}_VERSIONS})
  85. endif()
  86. else()
  87. set(_PYTHON_FIND_OTHER_VERSIONS ${_PYTHON3_VERSIONS} ${_PYTHON2_VERSIONS} ${_PYTHON1_VERSIONS})
  88. endif()
  89. # Set up the versions we know about, in the order we will search. Always add
  90. # the user supplied additional versions to the front.
  91. # If FindPythonInterp has already found the major and minor version,
  92. # insert that version between the user supplied versions and the stock
  93. # version list.
  94. set(_Python_VERSIONS ${Python_ADDITIONAL_VERSIONS})
  95. if(DEFINED PYTHON_VERSION_MAJOR AND DEFINED PYTHON_VERSION_MINOR)
  96. list(APPEND _Python_VERSIONS ${PYTHON_VERSION_MAJOR}.${PYTHON_VERSION_MINOR})
  97. endif()
  98. list(APPEND _Python_VERSIONS ${_PYTHON_FIND_OTHER_VERSIONS})
  99. unset(_PYTHON_FIND_OTHER_VERSIONS)
  100. unset(_PYTHON1_VERSIONS)
  101. unset(_PYTHON2_VERSIONS)
  102. unset(_PYTHON3_VERSIONS)
  103. # Python distribution: define which architectures can be used
  104. if (CMAKE_SIZEOF_VOID_P)
  105. # In this case, search only for 64bit or 32bit
  106. math (EXPR _PYTHON_ARCH "${CMAKE_SIZEOF_VOID_P} * 8")
  107. set (_PYTHON_ARCH2 _PYTHON_PREFIX_ARCH})
  108. else()
  109. if (PYTHON_EXECUTABLE)
  110. # determine interpreter architecture
  111. execute_process (COMMAND "${PYTHON_EXECUTABLE}" -c "import sys; print(sys.maxsize > 2**32)"
  112. RESULT_VARIABLE _PYTHON_RESULT
  113. OUTPUT_VARIABLE _PYTHON_IS64BIT
  114. ERROR_VARIABLE _PYTHON_IS64BIT)
  115. if (NOT _PYTHON_RESULT)
  116. if (_PYTHON_IS64BIT)
  117. set (_PYTHON_ARCH 64)
  118. set (_PYTHON_ARCH2 64)
  119. else()
  120. set (_PYTHON_ARCH 32)
  121. set (_PYTHON_ARCH2 32)
  122. endif()
  123. endif()
  124. else()
  125. # architecture unknown, search for both 64bit and 32bit
  126. set (_PYTHON_ARCH 64)
  127. set (_PYTHON_ARCH2 32)
  128. endif()
  129. endif()
  130. foreach(_CURRENT_VERSION ${_Python_VERSIONS})
  131. string(REPLACE "." "" _CURRENT_VERSION_NO_DOTS ${_CURRENT_VERSION})
  132. if(WIN32)
  133. find_library(PYTHON_DEBUG_LIBRARY
  134. NAMES python${_CURRENT_VERSION_NO_DOTS}_d python
  135. NAMES_PER_DIR
  136. HINTS ${_Python_LIBRARY_PATH_HINT}
  137. PATHS
  138. [HKEY_LOCAL_MACHINE\\SOFTWARE\\Python\\PythonCore\\${_CURRENT_VERSION}\\InstallPath]/libs/Debug
  139. [HKEY_LOCAL_MACHINE\\SOFTWARE\\Python\\PythonCore\\${_CURRENT_VERSION}-${_PYTHON_ARCH}\\InstallPath]/libs/Debug
  140. [HKEY_LOCAL_MACHINE\\SOFTWARE\\Python\\PythonCore\\${_CURRENT_VERSION}-${_PYTHON_ARCH2}\\InstallPath]/libs/Debug
  141. [HKEY_CURRENT_USER\\SOFTWARE\\Python\\PythonCore\\${_CURRENT_VERSION}\\InstallPath]/libs/Debug
  142. [HKEY_CURRENT_USER\\SOFTWARE\\Python\\PythonCore\\${_CURRENT_VERSION}-${_PYTHON_ARCH}\\InstallPath]/libs/Debug
  143. [HKEY_CURRENT_USER\\SOFTWARE\\Python\\PythonCore\\${_CURRENT_VERSION}-${_PYTHON_ARCH2}\\InstallPath]/libs/Debug
  144. [HKEY_LOCAL_MACHINE\\SOFTWARE\\Python\\PythonCore\\${_CURRENT_VERSION}\\InstallPath]/libs
  145. [HKEY_LOCAL_MACHINE\\SOFTWARE\\Python\\PythonCore\\${_CURRENT_VERSION}-${_PYTHON_ARCH}\\InstallPath]/libs
  146. [HKEY_LOCAL_MACHINE\\SOFTWARE\\Python\\PythonCore\\${_CURRENT_VERSION}-${_PYTHON_ARCH2}\\InstallPath]/libs
  147. [HKEY_CURRENT_USER\\SOFTWARE\\Python\\PythonCore\\${_CURRENT_VERSION}\\InstallPath]/libs
  148. [HKEY_CURRENT_USER\\SOFTWARE\\Python\\PythonCore\\${_CURRENT_VERSION}-${_PYTHON_ARCH}\\InstallPath]/libs
  149. [HKEY_CURRENT_USER\\SOFTWARE\\Python\\PythonCore\\${_CURRENT_VERSION}-${_PYTHON_ARCH2}\\InstallPath]/libs
  150. )
  151. endif()
  152. set(PYTHON_FRAMEWORK_LIBRARIES)
  153. if(Python_FRAMEWORKS AND NOT PYTHON_LIBRARY)
  154. foreach(dir ${Python_FRAMEWORKS})
  155. list(APPEND PYTHON_FRAMEWORK_LIBRARIES
  156. ${dir}/Versions/${_CURRENT_VERSION}/lib)
  157. endforeach()
  158. endif()
  159. find_library(PYTHON_LIBRARY
  160. NAMES
  161. python${_CURRENT_VERSION_NO_DOTS}
  162. python${_CURRENT_VERSION}mu
  163. python${_CURRENT_VERSION}m
  164. python${_CURRENT_VERSION}u
  165. python${_CURRENT_VERSION}
  166. NAMES_PER_DIR
  167. HINTS
  168. ${_Python_LIBRARY_PATH_HINT}
  169. PATHS
  170. ${PYTHON_FRAMEWORK_LIBRARIES}
  171. [HKEY_LOCAL_MACHINE\\SOFTWARE\\Python\\PythonCore\\${_CURRENT_VERSION}\\InstallPath]/libs
  172. [HKEY_LOCAL_MACHINE\\SOFTWARE\\Python\\PythonCore\\${_CURRENT_VERSION}-${_PYTHON_ARCH}\\InstallPath]/libs
  173. [HKEY_LOCAL_MACHINE\\SOFTWARE\\Python\\PythonCore\\${_CURRENT_VERSION}-${_PYTHON_ARCH2}\\InstallPath]/libs
  174. [HKEY_CURRENT_USER\\SOFTWARE\\Python\\PythonCore\\${_CURRENT_VERSION}\\InstallPath]/libs
  175. [HKEY_CURRENT_USER\\SOFTWARE\\Python\\PythonCore\\${_CURRENT_VERSION}-${_PYTHON_ARCH}\\InstallPath]/libs
  176. [HKEY_CURRENT_USER\\SOFTWARE\\Python\\PythonCore\\${_CURRENT_VERSION}-${_PYTHON_ARCH2}\\InstallPath]/libs
  177. )
  178. # Look for the static library in the Python config directory
  179. find_library(PYTHON_LIBRARY
  180. NAMES python${_CURRENT_VERSION_NO_DOTS} python${_CURRENT_VERSION}
  181. NAMES_PER_DIR
  182. # This is where the static library is usually located
  183. PATH_SUFFIXES python${_CURRENT_VERSION}/config
  184. )
  185. # Don't search for include dir until library location is known
  186. if(PYTHON_LIBRARY)
  187. # Use the library's install prefix as a hint
  188. set(_Python_INCLUDE_PATH_HINT)
  189. # PYTHON_LIBRARY may contain a list because of SelectLibraryConfigurations
  190. # which may have been run previously. If it is the case, the list can be:
  191. # optimized;<FILEPATH_TO_RELEASE_LIBRARY>;debug;<FILEPATH_TO_DEBUG_LIBRARY>
  192. foreach(lib ${PYTHON_LIBRARY} ${PYTHON_DEBUG_LIBRARY})
  193. if(IS_ABSOLUTE "${lib}")
  194. get_filename_component(_Python_PREFIX "${lib}" PATH)
  195. get_filename_component(_Python_PREFIX "${_Python_PREFIX}" PATH)
  196. if(_Python_PREFIX)
  197. list(APPEND _Python_INCLUDE_PATH_HINT ${_Python_PREFIX}/include)
  198. endif()
  199. unset(_Python_PREFIX)
  200. endif()
  201. endforeach()
  202. # Add framework directories to the search paths
  203. set(PYTHON_FRAMEWORK_INCLUDES)
  204. if(Python_FRAMEWORKS AND NOT PYTHON_INCLUDE_DIR)
  205. foreach(dir ${Python_FRAMEWORKS})
  206. list(APPEND PYTHON_FRAMEWORK_INCLUDES
  207. ${dir}/Versions/${_CURRENT_VERSION}/include)
  208. endforeach()
  209. endif()
  210. find_path(PYTHON_INCLUDE_DIR
  211. NAMES Python.h
  212. HINTS
  213. ${_Python_INCLUDE_PATH_HINT}
  214. PATHS
  215. ${PYTHON_FRAMEWORK_INCLUDES}
  216. [HKEY_LOCAL_MACHINE\\SOFTWARE\\Python\\PythonCore\\${_CURRENT_VERSION}\\InstallPath]/include
  217. [HKEY_LOCAL_MACHINE\\SOFTWARE\\Python\\PythonCore\\${_CURRENT_VERSION}-${_PYTHON_ARCH}\\InstallPath]/include
  218. [HKEY_LOCAL_MACHINE\\SOFTWARE\\Python\\PythonCore\\${_CURRENT_VERSION}-${_PYTHON_ARCH2}\\InstallPath]/include
  219. [HKEY_CURRENT_USER\\SOFTWARE\\Python\\PythonCore\\${_CURRENT_VERSION}\\InstallPath]/include
  220. [HKEY_CURRENT_USER\\SOFTWARE\\Python\\PythonCore\\${_CURRENT_VERSION}-${_PYTHON_ARCH}\\InstallPath]/include
  221. [HKEY_CURRENT_USER\\SOFTWARE\\Python\\PythonCore\\${_CURRENT_VERSION}-${_PYTHON_ARCH2}\\InstallPath]/include
  222. PATH_SUFFIXES
  223. python${_CURRENT_VERSION}mu
  224. python${_CURRENT_VERSION}m
  225. python${_CURRENT_VERSION}u
  226. python${_CURRENT_VERSION}
  227. )
  228. endif()
  229. # For backward compatibility, set PYTHON_INCLUDE_PATH.
  230. set(PYTHON_INCLUDE_PATH "${PYTHON_INCLUDE_DIR}")
  231. if(PYTHON_INCLUDE_DIR AND EXISTS "${PYTHON_INCLUDE_DIR}/patchlevel.h")
  232. file(STRINGS "${PYTHON_INCLUDE_DIR}/patchlevel.h" python_version_str
  233. REGEX "^#define[ \t]+PY_VERSION[ \t]+\"[^\"]+\"")
  234. string(REGEX REPLACE "^#define[ \t]+PY_VERSION[ \t]+\"([^\"]+)\".*" "\\1"
  235. PYTHONLIBS_VERSION_STRING "${python_version_str}")
  236. unset(python_version_str)
  237. endif()
  238. if(PYTHON_LIBRARY AND PYTHON_INCLUDE_DIR)
  239. break()
  240. endif()
  241. endforeach()
  242. unset(_Python_INCLUDE_PATH_HINT)
  243. unset(_Python_LIBRARY_PATH_HINT)
  244. mark_as_advanced(
  245. PYTHON_DEBUG_LIBRARY
  246. PYTHON_LIBRARY
  247. PYTHON_INCLUDE_DIR
  248. )
  249. # We use PYTHON_INCLUDE_DIR, PYTHON_LIBRARY and PYTHON_DEBUG_LIBRARY for the
  250. # cache entries because they are meant to specify the location of a single
  251. # library. We now set the variables listed by the documentation for this
  252. # module.
  253. set(PYTHON_INCLUDE_DIRS "${PYTHON_INCLUDE_DIR}")
  254. set(PYTHON_DEBUG_LIBRARIES "${PYTHON_DEBUG_LIBRARY}")
  255. # These variables have been historically named in this module different from
  256. # what SELECT_LIBRARY_CONFIGURATIONS() expects.
  257. set(PYTHON_LIBRARY_DEBUG "${PYTHON_DEBUG_LIBRARY}")
  258. set(PYTHON_LIBRARY_RELEASE "${PYTHON_LIBRARY}")
  259. include(${CMAKE_CURRENT_LIST_DIR}/SelectLibraryConfigurations.cmake)
  260. SELECT_LIBRARY_CONFIGURATIONS(PYTHON)
  261. # SELECT_LIBRARY_CONFIGURATIONS() sets ${PREFIX}_FOUND if it has a library.
  262. # Unset this, this prefix doesn't match the module prefix, they are different
  263. # for historical reasons.
  264. unset(PYTHON_FOUND)
  265. # Restore CMAKE_FIND_FRAMEWORK
  266. if(DEFINED _PythonLibs_CMAKE_FIND_FRAMEWORK)
  267. set(CMAKE_FIND_FRAMEWORK ${_PythonLibs_CMAKE_FIND_FRAMEWORK})
  268. unset(_PythonLibs_CMAKE_FIND_FRAMEWORK)
  269. else()
  270. unset(CMAKE_FIND_FRAMEWORK)
  271. endif()
  272. include(${CMAKE_CURRENT_LIST_DIR}/FindPackageHandleStandardArgs.cmake)
  273. FIND_PACKAGE_HANDLE_STANDARD_ARGS(PythonLibs
  274. REQUIRED_VARS PYTHON_LIBRARIES PYTHON_INCLUDE_DIRS
  275. VERSION_VAR PYTHONLIBS_VERSION_STRING)
  276. # PYTHON_ADD_MODULE(<name> src1 src2 ... srcN) is used to build modules for python.
  277. # PYTHON_WRITE_MODULES_HEADER(<filename>) writes a header file you can include
  278. # in your sources to initialize the static python modules
  279. function(PYTHON_ADD_MODULE _NAME )
  280. get_property(_TARGET_SUPPORTS_SHARED_LIBS
  281. GLOBAL PROPERTY TARGET_SUPPORTS_SHARED_LIBS)
  282. option(PYTHON_ENABLE_MODULE_${_NAME} "Add module ${_NAME}" TRUE)
  283. option(PYTHON_MODULE_${_NAME}_BUILD_SHARED
  284. "Add module ${_NAME} shared" ${_TARGET_SUPPORTS_SHARED_LIBS})
  285. # Mark these options as advanced
  286. mark_as_advanced(PYTHON_ENABLE_MODULE_${_NAME}
  287. PYTHON_MODULE_${_NAME}_BUILD_SHARED)
  288. if(PYTHON_ENABLE_MODULE_${_NAME})
  289. if(PYTHON_MODULE_${_NAME}_BUILD_SHARED)
  290. set(PY_MODULE_TYPE MODULE)
  291. else()
  292. set(PY_MODULE_TYPE STATIC)
  293. set_property(GLOBAL APPEND PROPERTY PY_STATIC_MODULES_LIST ${_NAME})
  294. endif()
  295. set_property(GLOBAL APPEND PROPERTY PY_MODULES_LIST ${_NAME})
  296. add_library(${_NAME} ${PY_MODULE_TYPE} ${ARGN})
  297. # target_link_libraries(${_NAME} ${PYTHON_LIBRARIES})
  298. if(PYTHON_MODULE_${_NAME}_BUILD_SHARED)
  299. set_target_properties(${_NAME} PROPERTIES PREFIX "${PYTHON_MODULE_PREFIX}")
  300. if(WIN32 AND NOT CYGWIN)
  301. set_target_properties(${_NAME} PROPERTIES SUFFIX ".pyd")
  302. endif()
  303. endif()
  304. endif()
  305. endfunction()
  306. function(PYTHON_WRITE_MODULES_HEADER _filename)
  307. get_property(PY_STATIC_MODULES_LIST GLOBAL PROPERTY PY_STATIC_MODULES_LIST)
  308. get_filename_component(_name "${_filename}" NAME)
  309. string(REPLACE "." "_" _name "${_name}")
  310. string(TOUPPER ${_name} _nameUpper)
  311. set(_filename ${CMAKE_CURRENT_BINARY_DIR}/${_filename})
  312. set(_filenameTmp "${_filename}.in")
  313. file(WRITE ${_filenameTmp} "/*Created by cmake, do not edit, changes will be lost*/\n")
  314. file(APPEND ${_filenameTmp}
  315. "#ifndef ${_nameUpper}
  316. #define ${_nameUpper}
  317. #include <Python.h>
  318. #ifdef __cplusplus
  319. extern \"C\" {
  320. #endif /* __cplusplus */
  321. ")
  322. foreach(_currentModule ${PY_STATIC_MODULES_LIST})
  323. file(APPEND ${_filenameTmp} "extern void init${PYTHON_MODULE_PREFIX}${_currentModule}(void);\n\n")
  324. endforeach()
  325. file(APPEND ${_filenameTmp}
  326. "#ifdef __cplusplus
  327. }
  328. #endif /* __cplusplus */
  329. ")
  330. foreach(_currentModule ${PY_STATIC_MODULES_LIST})
  331. file(APPEND ${_filenameTmp} "int ${_name}_${_currentModule}(void) \n{\n static char name[]=\"${PYTHON_MODULE_PREFIX}${_currentModule}\"; return PyImport_AppendInittab(name, init${PYTHON_MODULE_PREFIX}${_currentModule});\n}\n\n")
  332. endforeach()
  333. file(APPEND ${_filenameTmp} "void ${_name}_LoadAllPythonModules(void)\n{\n")
  334. foreach(_currentModule ${PY_STATIC_MODULES_LIST})
  335. file(APPEND ${_filenameTmp} " ${_name}_${_currentModule}();\n")
  336. endforeach()
  337. file(APPEND ${_filenameTmp} "}\n\n")
  338. file(APPEND ${_filenameTmp} "#ifndef EXCLUDE_LOAD_ALL_FUNCTION\nvoid CMakeLoadAllPythonModules(void)\n{\n ${_name}_LoadAllPythonModules();\n}\n#endif\n\n#endif\n")
  339. # with configure_file() cmake complains that you may not use a file created using file(WRITE) as input file for configure_file()
  340. execute_process(COMMAND ${CMAKE_COMMAND} -E copy_if_different "${_filenameTmp}" "${_filename}" OUTPUT_QUIET ERROR_QUIET)
  341. endfunction()