CMakeLists.txt 32 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773774775776777778779780781782783784785786787788789790791792793794795796797798799800801802803804805806807808809810811812813814815816817818819820821822823824825826827828829830831832833834835836837838839840841842
  1. # Distributed under the OSI-approved BSD 3-Clause License. See accompanying
  2. # file Copyright.txt or https://cmake.org/licensing for details.
  3. cmake_minimum_required(VERSION 3.1...3.15 FATAL_ERROR)
  4. set(CMAKE_USER_MAKE_RULES_OVERRIDE_C ${CMAKE_CURRENT_SOURCE_DIR}/Source/Modules/OverrideC.cmake)
  5. set(CMAKE_USER_MAKE_RULES_OVERRIDE_CXX ${CMAKE_CURRENT_SOURCE_DIR}/Source/Modules/OverrideCXX.cmake)
  6. project(CMake)
  7. unset(CMAKE_USER_MAKE_RULES_OVERRIDE_CXX)
  8. unset(CMAKE_USER_MAKE_RULES_OVERRIDE_C)
  9. # FIXME: This block should go away after a transition period.
  10. if(MSVC AND NOT CMAKE_VERSION VERSION_LESS 3.15)
  11. # Filter out MSVC runtime library flags that may have come from
  12. # the cache of an existing build tree or from scripts.
  13. foreach(l C CXX)
  14. foreach(c DEBUG MINSIZEREL RELEASE RELWITHDEBINFO)
  15. string(REGEX REPLACE "[-/]M[DT]d?( |$)" "" "CMAKE_${l}_FLAGS_${c}" "${CMAKE_${l}_FLAGS_${c}}")
  16. endforeach()
  17. endforeach()
  18. endif()
  19. # Make sure we can find internal find_package modules only used for
  20. # building CMake and not for shipping externally
  21. list(INSERT CMAKE_MODULE_PATH 0 ${CMake_SOURCE_DIR}/Source/Modules)
  22. if(CMAKE_BOOTSTRAP)
  23. # Running from bootstrap script. Set local variable and remove from cache.
  24. set(CMAKE_BOOTSTRAP 1)
  25. unset(CMAKE_BOOTSTRAP CACHE)
  26. endif()
  27. if(CMake_TEST_HOST_CMAKE)
  28. get_filename_component(CMake_TEST_EXTERNAL_CMAKE "${CMAKE_COMMAND}" DIRECTORY)
  29. endif()
  30. if(NOT CMake_TEST_EXTERNAL_CMAKE)
  31. if(CMAKE_SYSTEM_NAME STREQUAL "HP-UX")
  32. message(FATAL_ERROR
  33. "CMake no longer compiles on HP-UX. See\n"
  34. " https://gitlab.kitware.com/cmake/cmake/issues/17137\n"
  35. "Use CMake 3.9 or lower instead."
  36. )
  37. endif()
  38. set(CMake_BIN_DIR ${CMake_BINARY_DIR}/bin)
  39. endif()
  40. if(CMake_GUI_DISTRIBUTE_WITH_Qt_LGPL)
  41. if(CMake_GUI_DISTRIBUTE_WITH_Qt_LGPL MATCHES "^3|2\\.1$")
  42. set(USE_LGPL "${CMake_GUI_DISTRIBUTE_WITH_Qt_LGPL}")
  43. else()
  44. set(USE_LGPL "2.1")
  45. endif()
  46. else()
  47. set(USE_LGPL "")
  48. endif()
  49. if("${CMake_SOURCE_DIR}" STREQUAL "${CMAKE_SOURCE_DIR}")
  50. # Disallow architecture-specific try_run. It may not run on the host.
  51. macro(TRY_RUN)
  52. if(CMAKE_TRY_COMPILE_OSX_ARCHITECTURES)
  53. message(FATAL_ERROR "TRY_RUN not allowed with CMAKE_TRY_COMPILE_OSX_ARCHITECTURES=[${CMAKE_TRY_COMPILE_OSX_ARCHITECTURES}]")
  54. else()
  55. _TRY_RUN(${ARGV})
  56. endif()
  57. endmacro()
  58. endif()
  59. # Use most-recent available language dialects with GNU and Clang
  60. if(NOT DEFINED CMAKE_C_STANDARD AND NOT CMake_NO_C_STANDARD)
  61. include(${CMake_SOURCE_DIR}/Source/Checks/cm_c11_thread_local.cmake)
  62. if(NOT CMake_C11_THREAD_LOCAL_BROKEN)
  63. set(CMAKE_C_STANDARD 11)
  64. else()
  65. set(CMAKE_C_STANDARD 99)
  66. endif()
  67. endif()
  68. if(NOT DEFINED CMAKE_CXX_STANDARD AND NOT CMake_NO_CXX_STANDARD)
  69. if (CMAKE_CXX_COMPILER_ID STREQUAL SunPro AND CMAKE_CXX_COMPILER_VERSION VERSION_LESS 5.14)
  70. set(CMAKE_CXX_STANDARD 98)
  71. else()
  72. if(NOT CMAKE_VERSION VERSION_LESS 3.8)
  73. include(${CMake_SOURCE_DIR}/Source/Checks/cm_cxx17_check.cmake)
  74. else()
  75. set(CMake_CXX17_BROKEN 1)
  76. endif()
  77. if(NOT CMake_CXX17_BROKEN)
  78. set(CMAKE_CXX_STANDARD 17)
  79. else()
  80. include(${CMake_SOURCE_DIR}/Source/Checks/cm_cxx14_check.cmake)
  81. if(NOT CMake_CXX14_BROKEN)
  82. set(CMAKE_CXX_STANDARD 14)
  83. else()
  84. set(CMAKE_CXX_STANDARD 11)
  85. endif()
  86. endif()
  87. endif()
  88. endif()
  89. if(NOT CMake_TEST_EXTERNAL_CMAKE)
  90. # include special compile flags for some compilers
  91. include(CompileFlags.cmake)
  92. # check for available C++ features
  93. include(${CMake_SOURCE_DIR}/Source/Checks/cm_cxx_features.cmake)
  94. if(NOT CMake_HAVE_CXX_UNIQUE_PTR)
  95. message(FATAL_ERROR "The C++ compiler does not support C++11 (e.g. std::unique_ptr).")
  96. endif()
  97. endif()
  98. # set the internal encoding of CMake to UTF-8
  99. set(KWSYS_ENCODING_DEFAULT_CODEPAGE CP_UTF8)
  100. # option to use COMPONENT with install command
  101. option(CMake_INSTALL_COMPONENTS "Using components when installing" OFF)
  102. mark_as_advanced(CMake_INSTALL_COMPONENTS)
  103. macro(CMake_OPTIONAL_COMPONENT NAME)
  104. if(CMake_INSTALL_COMPONENTS)
  105. set(COMPONENT COMPONENT ${NAME})
  106. else()
  107. set(COMPONENT)
  108. endif()
  109. endmacro()
  110. # option to disable installing 3rd-party dependencies
  111. option(CMake_INSTALL_DEPENDENCIES
  112. "Whether to install 3rd-party runtime dependencies" OFF)
  113. mark_as_advanced(CMake_INSTALL_DEPENDENCIES)
  114. # option to build reference for CMake developers
  115. option(CMake_BUILD_DEVELOPER_REFERENCE
  116. "Build CMake Developer Reference" OFF)
  117. mark_as_advanced(CMake_BUILD_DEVELOPER_REFERENCE)
  118. # option to build using interprocedural optimizations (IPO/LTO)
  119. if (NOT CMAKE_VERSION VERSION_LESS 3.12.2)
  120. option(CMake_BUILD_LTO "Compile CMake with link-time optimization if supported" OFF)
  121. if(CMake_BUILD_LTO)
  122. include(CheckIPOSupported)
  123. check_ipo_supported(RESULT HAVE_IPO)
  124. if(HAVE_IPO)
  125. set(CMAKE_INTERPROCEDURAL_OPTIMIZATION TRUE)
  126. endif()
  127. endif()
  128. endif()
  129. #-----------------------------------------------------------------------
  130. # a macro to deal with system libraries, implemented as a macro
  131. # simply to improve readability of the main script
  132. #-----------------------------------------------------------------------
  133. macro(CMAKE_HANDLE_SYSTEM_LIBRARIES)
  134. # Options have dependencies.
  135. include(CMakeDependentOption)
  136. # Allow the user to enable/disable all system utility library options by
  137. # defining CMAKE_USE_SYSTEM_LIBRARIES or CMAKE_USE_SYSTEM_LIBRARY_${util}.
  138. set(UTILITIES BZIP2 CURL EXPAT FORM JSONCPP LIBARCHIVE LIBLZMA LIBRHASH LIBUV ZLIB ZSTD)
  139. foreach(util ${UTILITIES})
  140. if(NOT DEFINED CMAKE_USE_SYSTEM_LIBRARY_${util}
  141. AND DEFINED CMAKE_USE_SYSTEM_LIBRARIES)
  142. set(CMAKE_USE_SYSTEM_LIBRARY_${util} "${CMAKE_USE_SYSTEM_LIBRARIES}")
  143. endif()
  144. if(DEFINED CMAKE_USE_SYSTEM_LIBRARY_${util})
  145. if(CMAKE_USE_SYSTEM_LIBRARY_${util})
  146. set(CMAKE_USE_SYSTEM_LIBRARY_${util} ON)
  147. else()
  148. set(CMAKE_USE_SYSTEM_LIBRARY_${util} OFF)
  149. endif()
  150. if(CMAKE_BOOTSTRAP)
  151. unset(CMAKE_USE_SYSTEM_LIBRARY_${util} CACHE)
  152. endif()
  153. string(TOLOWER "${util}" lutil)
  154. set(CMAKE_USE_SYSTEM_${util} "${CMAKE_USE_SYSTEM_LIBRARY_${util}}"
  155. CACHE BOOL "Use system-installed ${lutil}" FORCE)
  156. else()
  157. set(CMAKE_USE_SYSTEM_LIBRARY_${util} OFF)
  158. endif()
  159. endforeach()
  160. if(CMAKE_BOOTSTRAP)
  161. unset(CMAKE_USE_SYSTEM_LIBRARIES CACHE)
  162. endif()
  163. # Optionally use system utility libraries.
  164. option(CMAKE_USE_SYSTEM_LIBARCHIVE "Use system-installed libarchive" "${CMAKE_USE_SYSTEM_LIBRARY_LIBARCHIVE}")
  165. option(CMAKE_USE_SYSTEM_CURL "Use system-installed curl" "${CMAKE_USE_SYSTEM_LIBRARY_CURL}")
  166. option(CMAKE_USE_SYSTEM_EXPAT "Use system-installed expat" "${CMAKE_USE_SYSTEM_LIBRARY_EXPAT}")
  167. CMAKE_DEPENDENT_OPTION(CMAKE_USE_SYSTEM_ZLIB "Use system-installed zlib"
  168. "${CMAKE_USE_SYSTEM_LIBRARY_ZLIB}" "NOT CMAKE_USE_SYSTEM_LIBARCHIVE;NOT CMAKE_USE_SYSTEM_CURL" ON)
  169. CMAKE_DEPENDENT_OPTION(CMAKE_USE_SYSTEM_BZIP2 "Use system-installed bzip2"
  170. "${CMAKE_USE_SYSTEM_LIBRARY_BZIP2}" "NOT CMAKE_USE_SYSTEM_LIBARCHIVE" ON)
  171. CMAKE_DEPENDENT_OPTION(CMAKE_USE_SYSTEM_ZSTD "Use system-installed zstd"
  172. "${CMAKE_USE_SYSTEM_LIBRARY_ZSTD}" "NOT CMAKE_USE_SYSTEM_LIBARCHIVE" ON)
  173. CMAKE_DEPENDENT_OPTION(CMAKE_USE_SYSTEM_LIBLZMA "Use system-installed liblzma"
  174. "${CMAKE_USE_SYSTEM_LIBRARY_LIBLZMA}" "NOT CMAKE_USE_SYSTEM_LIBARCHIVE" ON)
  175. option(CMAKE_USE_SYSTEM_FORM "Use system-installed libform" "${CMAKE_USE_SYSTEM_LIBRARY_FORM}")
  176. option(CMAKE_USE_SYSTEM_JSONCPP "Use system-installed jsoncpp" "${CMAKE_USE_SYSTEM_LIBRARY_JSONCPP}")
  177. option(CMAKE_USE_SYSTEM_LIBRHASH "Use system-installed librhash" "${CMAKE_USE_SYSTEM_LIBRARY_LIBRHASH}")
  178. option(CMAKE_USE_SYSTEM_LIBUV "Use system-installed libuv" "${CMAKE_USE_SYSTEM_LIBRARY_LIBUV}")
  179. # For now use system KWIML only if explicitly requested rather
  180. # than activating via the general system libs options.
  181. option(CMAKE_USE_SYSTEM_KWIML "Use system-installed KWIML" OFF)
  182. mark_as_advanced(CMAKE_USE_SYSTEM_KWIML)
  183. # Mention to the user what system libraries are being used.
  184. foreach(util ${UTILITIES} KWIML)
  185. if(CMAKE_USE_SYSTEM_${util})
  186. message(STATUS "Using system-installed ${util}")
  187. endif()
  188. endforeach()
  189. # Inform utility library header wrappers whether to use system versions.
  190. configure_file(${CMake_SOURCE_DIR}/Utilities/cmThirdParty.h.in
  191. ${CMake_BINARY_DIR}/Utilities/cmThirdParty.h
  192. @ONLY)
  193. endmacro()
  194. #-----------------------------------------------------------------------
  195. # a macro to determine the generator and ctest executable to use
  196. # for testing. Simply to improve readability of the main script.
  197. #-----------------------------------------------------------------------
  198. macro(CMAKE_SETUP_TESTING)
  199. if(BUILD_TESTING)
  200. set(CMAKE_TEST_SYSTEM_LIBRARIES 0)
  201. foreach(util CURL EXPAT ZLIB)
  202. if(CMAKE_USE_SYSTEM_${util})
  203. set(CMAKE_TEST_SYSTEM_LIBRARIES 1)
  204. endif()
  205. endforeach()
  206. # This variable is set by cmake, however to
  207. # test cmake we want to make sure that
  208. # the ctest from this cmake is used for testing
  209. # and not the ctest from the cmake building and testing
  210. # cmake.
  211. if(CMake_TEST_EXTERNAL_CMAKE)
  212. set(CMAKE_CTEST_COMMAND "${CMake_TEST_EXTERNAL_CMAKE}/ctest")
  213. set(CMAKE_CMAKE_COMMAND "${CMake_TEST_EXTERNAL_CMAKE}/cmake")
  214. set(CMAKE_CPACK_COMMAND "${CMake_TEST_EXTERNAL_CMAKE}/cpack")
  215. foreach(exe cmake ctest cpack)
  216. add_executable(${exe} IMPORTED)
  217. set_property(TARGET ${exe} PROPERTY IMPORTED_LOCATION ${CMake_TEST_EXTERNAL_CMAKE}/${exe})
  218. endforeach()
  219. else()
  220. set(CMAKE_CTEST_COMMAND "${CMake_BIN_DIR}/ctest")
  221. set(CMAKE_CMAKE_COMMAND "${CMake_BIN_DIR}/cmake")
  222. set(CMAKE_CPACK_COMMAND "${CMake_BIN_DIR}/cpack")
  223. endif()
  224. endif()
  225. # configure some files for testing
  226. configure_file("${CMAKE_CURRENT_SOURCE_DIR}/Templates/CTestScript.cmake.in"
  227. "${CMAKE_CURRENT_BINARY_DIR}/CTestScript.cmake"
  228. @ONLY)
  229. configure_file(${CMake_SOURCE_DIR}/Tests/.NoDartCoverage
  230. ${CMake_BINARY_DIR}/Tests/.NoDartCoverage)
  231. configure_file(${CMake_SOURCE_DIR}/Tests/.NoDartCoverage
  232. ${CMake_BINARY_DIR}/Modules/.NoDartCoverage)
  233. configure_file(${CMake_SOURCE_DIR}/CTestCustom.cmake.in
  234. ${CMake_BINARY_DIR}/CTestCustom.cmake @ONLY)
  235. if(BUILD_TESTING AND DART_ROOT)
  236. configure_file(${CMake_SOURCE_DIR}/CMakeLogo.gif
  237. ${CMake_BINARY_DIR}/Testing/HTML/TestingResults/Icons/Logo.gif COPYONLY)
  238. endif()
  239. mark_as_advanced(DART_ROOT)
  240. mark_as_advanced(CURL_TESTING)
  241. endmacro()
  242. # Provide a way for Visual Studio Express users to turn OFF the new FOLDER
  243. # organization feature. Default to ON for non-Express users. Express users must
  244. # explicitly turn off this option to build CMake in the Express IDE...
  245. #
  246. option(CMAKE_USE_FOLDERS "Enable folder grouping of projects in IDEs." ON)
  247. mark_as_advanced(CMAKE_USE_FOLDERS)
  248. option(CMake_RUN_CLANG_TIDY "Run clang-tidy with the compiler." OFF)
  249. if(CMake_RUN_CLANG_TIDY)
  250. if(CMake_SOURCE_DIR STREQUAL CMake_BINARY_DIR)
  251. message(FATAL_ERROR "CMake_RUN_CLANG_TIDY requires an out-of-source build!")
  252. endif()
  253. find_program(CLANG_TIDY_COMMAND NAMES clang-tidy)
  254. if(NOT CLANG_TIDY_COMMAND)
  255. message(FATAL_ERROR "CMake_RUN_CLANG_TIDY is ON but clang-tidy is not found!")
  256. endif()
  257. set(CMAKE_CXX_CLANG_TIDY "${CLANG_TIDY_COMMAND}")
  258. # Create a preprocessor definition that depends on .clang-tidy content so
  259. # the compile command will change when .clang-tidy changes. This ensures
  260. # that a subsequent build re-runs clang-tidy on all sources even if they
  261. # do not otherwise need to be recompiled. Nothing actually uses this
  262. # definition. We add it to targets on which we run clang-tidy just to
  263. # get the build dependency on the .clang-tidy file.
  264. file(SHA1 ${CMAKE_CURRENT_SOURCE_DIR}/.clang-tidy clang_tidy_sha1)
  265. set(CLANG_TIDY_DEFINITIONS "CLANG_TIDY_SHA1=${clang_tidy_sha1}")
  266. unset(clang_tidy_sha1)
  267. endif()
  268. configure_file(.clang-tidy .clang-tidy COPYONLY)
  269. option(CMake_RUN_IWYU "Run include-what-you-use with the compiler." OFF)
  270. if(CMake_RUN_IWYU)
  271. find_program(IWYU_COMMAND NAMES include-what-you-use iwyu)
  272. if(NOT IWYU_COMMAND)
  273. message(FATAL_ERROR "CMake_RUN_IWYU is ON but include-what-you-use is not found!")
  274. endif()
  275. set(CMAKE_CXX_INCLUDE_WHAT_YOU_USE
  276. "${IWYU_COMMAND};-Xiwyu;--mapping_file=${CMake_SOURCE_DIR}/Utilities/IWYU/mapping.imp;-w")
  277. list(APPEND CMAKE_CXX_INCLUDE_WHAT_YOU_USE ${CMake_IWYU_OPTIONS})
  278. endif()
  279. #-----------------------------------------------------------------------
  280. # a macro that only sets the FOLDER target property if it's
  281. # "appropriate"
  282. #-----------------------------------------------------------------------
  283. macro(CMAKE_SET_TARGET_FOLDER tgt folder)
  284. if(CMAKE_USE_FOLDERS)
  285. set_property(GLOBAL PROPERTY USE_FOLDERS ON)
  286. if(MSVC AND TARGET ${tgt})
  287. set_property(TARGET "${tgt}" PROPERTY FOLDER "${folder}")
  288. endif()
  289. else()
  290. set_property(GLOBAL PROPERTY USE_FOLDERS OFF)
  291. endif()
  292. endmacro()
  293. #-----------------------------------------------------------------------
  294. # a macro to build the utilities used by CMake
  295. # Simply to improve readability of the main script.
  296. #-----------------------------------------------------------------------
  297. macro (CMAKE_BUILD_UTILITIES)
  298. find_package(Threads)
  299. #---------------------------------------------------------------------
  300. # Create the kwsys library for CMake.
  301. set(KWSYS_NAMESPACE cmsys)
  302. set(KWSYS_USE_SystemTools 1)
  303. set(KWSYS_USE_Directory 1)
  304. set(KWSYS_USE_RegularExpression 1)
  305. set(KWSYS_USE_Base64 1)
  306. set(KWSYS_USE_MD5 1)
  307. set(KWSYS_USE_Process 1)
  308. set(KWSYS_USE_CommandLineArguments 1)
  309. set(KWSYS_USE_ConsoleBuf 1)
  310. set(KWSYS_HEADER_ROOT ${CMake_BINARY_DIR}/Source)
  311. set(KWSYS_INSTALL_DOC_DIR "${CMAKE_DOC_DIR}")
  312. if(CMake_NO_CXX_STANDARD)
  313. set(KWSYS_CXX_STANDARD "")
  314. endif()
  315. add_subdirectory(Source/kwsys)
  316. set(kwsys_folder "Utilities/KWSys")
  317. CMAKE_SET_TARGET_FOLDER(${KWSYS_NAMESPACE} "${kwsys_folder}")
  318. CMAKE_SET_TARGET_FOLDER(${KWSYS_NAMESPACE}_c "${kwsys_folder}")
  319. if(BUILD_TESTING)
  320. CMAKE_SET_TARGET_FOLDER(${KWSYS_NAMESPACE}TestDynload "${kwsys_folder}")
  321. CMAKE_SET_TARGET_FOLDER(${KWSYS_NAMESPACE}TestProcess "${kwsys_folder}")
  322. CMAKE_SET_TARGET_FOLDER(${KWSYS_NAMESPACE}TestsC "${kwsys_folder}")
  323. CMAKE_SET_TARGET_FOLDER(${KWSYS_NAMESPACE}TestsCxx "${kwsys_folder}")
  324. CMAKE_SET_TARGET_FOLDER(${KWSYS_NAMESPACE}TestSharedForward "${kwsys_folder}")
  325. endif()
  326. #---------------------------------------------------------------------
  327. # Setup third-party libraries.
  328. # Everything in the tree should be able to include files from the
  329. # Utilities directory.
  330. include_directories(
  331. ${CMake_BINARY_DIR}/Utilities
  332. ${CMake_SOURCE_DIR}/Utilities
  333. )
  334. # check for the use of system libraries versus builtin ones
  335. # (a macro defined in this file)
  336. CMAKE_HANDLE_SYSTEM_LIBRARIES()
  337. if(CMAKE_USE_SYSTEM_KWIML)
  338. find_package(KWIML 1.0)
  339. if(NOT KWIML_FOUND)
  340. message(FATAL_ERROR "CMAKE_USE_SYSTEM_KWIML is ON but KWIML is not found!")
  341. endif()
  342. set(CMake_KWIML_LIBRARIES kwiml::kwiml)
  343. else()
  344. set(CMake_KWIML_LIBRARIES "")
  345. if(BUILD_TESTING)
  346. set(KWIML_TEST_ENABLE 1)
  347. endif()
  348. add_subdirectory(Utilities/KWIML)
  349. endif()
  350. if(CMAKE_USE_SYSTEM_LIBRHASH)
  351. find_package(LibRHash)
  352. if(NOT LibRHash_FOUND)
  353. message(FATAL_ERROR
  354. "CMAKE_USE_SYSTEM_LIBRHASH is ON but LibRHash is not found!")
  355. endif()
  356. set(CMAKE_LIBRHASH_LIBRARIES LibRHash::LibRHash)
  357. else()
  358. set(CMAKE_LIBRHASH_LIBRARIES cmlibrhash)
  359. add_subdirectory(Utilities/cmlibrhash)
  360. CMAKE_SET_TARGET_FOLDER(cmlibrhash "Utilities/3rdParty")
  361. endif()
  362. #---------------------------------------------------------------------
  363. # Build zlib library for Curl, CMake, and CTest.
  364. set(CMAKE_ZLIB_HEADER "cm_zlib.h")
  365. if(CMAKE_USE_SYSTEM_ZLIB)
  366. find_package(ZLIB)
  367. if(NOT ZLIB_FOUND)
  368. message(FATAL_ERROR
  369. "CMAKE_USE_SYSTEM_ZLIB is ON but a zlib is not found!")
  370. endif()
  371. set(CMAKE_ZLIB_INCLUDES ${ZLIB_INCLUDE_DIR})
  372. set(CMAKE_ZLIB_LIBRARIES ${ZLIB_LIBRARIES})
  373. else()
  374. set(CMAKE_ZLIB_INCLUDES ${CMake_SOURCE_DIR}/Utilities)
  375. set(CMAKE_ZLIB_LIBRARIES cmzlib)
  376. add_subdirectory(Utilities/cmzlib)
  377. CMAKE_SET_TARGET_FOLDER(cmzlib "Utilities/3rdParty")
  378. endif()
  379. #---------------------------------------------------------------------
  380. # Build Curl library for CTest.
  381. if(CMAKE_USE_SYSTEM_CURL)
  382. find_package(CURL)
  383. if(NOT CURL_FOUND)
  384. message(FATAL_ERROR
  385. "CMAKE_USE_SYSTEM_CURL is ON but a curl is not found!")
  386. endif()
  387. set(CMAKE_CURL_INCLUDES ${CURL_INCLUDE_DIRS})
  388. set(CMAKE_CURL_LIBRARIES ${CURL_LIBRARIES})
  389. else()
  390. set(CURL_SPECIAL_ZLIB_H ${CMAKE_ZLIB_HEADER})
  391. set(CURL_SPECIAL_LIBZ_INCLUDES ${CMAKE_ZLIB_INCLUDES})
  392. set(CURL_SPECIAL_LIBZ ${CMAKE_ZLIB_LIBRARIES})
  393. set(CMAKE_CURL_INCLUDES)
  394. set(CMAKE_CURL_LIBRARIES cmcurl)
  395. if(CMAKE_TESTS_CDASH_SERVER)
  396. set(CMAKE_CURL_TEST_URL "${CMAKE_TESTS_CDASH_SERVER}/user.php")
  397. endif()
  398. set(_CMAKE_USE_OPENSSL_DEFAULT OFF)
  399. if(NOT DEFINED CMAKE_USE_OPENSSL AND NOT WIN32 AND NOT APPLE
  400. AND CMAKE_SYSTEM_NAME MATCHES "(Linux|FreeBSD)")
  401. set(_CMAKE_USE_OPENSSL_DEFAULT ON)
  402. endif()
  403. option(CMAKE_USE_OPENSSL "Use OpenSSL." ${_CMAKE_USE_OPENSSL_DEFAULT})
  404. mark_as_advanced(CMAKE_USE_OPENSSL)
  405. if(CMAKE_USE_OPENSSL)
  406. set(CURL_CA_BUNDLE "" CACHE FILEPATH "Path to SSL CA Certificate Bundle")
  407. set(CURL_CA_PATH "" CACHE PATH "Path to SSL CA Certificate Directory")
  408. mark_as_advanced(CURL_CA_BUNDLE CURL_CA_PATH)
  409. endif()
  410. add_subdirectory(Utilities/cmcurl)
  411. CMAKE_SET_TARGET_FOLDER(cmcurl "Utilities/3rdParty")
  412. CMAKE_SET_TARGET_FOLDER(LIBCURL "Utilities/3rdParty")
  413. endif()
  414. #---------------------------------------------------------------------
  415. # Build expat library for CMake, CTest, and libarchive.
  416. if(CMAKE_USE_SYSTEM_EXPAT)
  417. find_package(EXPAT)
  418. if(NOT EXPAT_FOUND)
  419. message(FATAL_ERROR
  420. "CMAKE_USE_SYSTEM_EXPAT is ON but a expat is not found!")
  421. endif()
  422. set(CMAKE_EXPAT_INCLUDES ${EXPAT_INCLUDE_DIRS})
  423. set(CMAKE_EXPAT_LIBRARIES ${EXPAT_LIBRARIES})
  424. else()
  425. set(CMAKE_EXPAT_INCLUDES)
  426. set(CMAKE_EXPAT_LIBRARIES cmexpat)
  427. add_subdirectory(Utilities/cmexpat)
  428. CMAKE_SET_TARGET_FOLDER(cmexpat "Utilities/3rdParty")
  429. endif()
  430. #---------------------------------------------------------------------
  431. # Build or use system libbz2 for libarchive.
  432. if(NOT CMAKE_USE_SYSTEM_LIBARCHIVE)
  433. if(CMAKE_USE_SYSTEM_BZIP2)
  434. find_package(BZip2)
  435. else()
  436. set(BZIP2_INCLUDE_DIR
  437. "${CMAKE_CURRENT_SOURCE_DIR}/Utilities/cmbzip2")
  438. set(BZIP2_LIBRARIES cmbzip2)
  439. add_subdirectory(Utilities/cmbzip2)
  440. CMAKE_SET_TARGET_FOLDER(cmbzip2 "Utilities/3rdParty")
  441. endif()
  442. endif()
  443. #---------------------------------------------------------------------
  444. # Build or use system zstd for libarchive.
  445. if(NOT CMAKE_USE_SYSTEM_LIBARCHIVE)
  446. if(NOT CMAKE_USE_SYSTEM_ZSTD)
  447. set(ZSTD_INCLUDE_DIR "${CMAKE_CURRENT_SOURCE_DIR}/Utilities/cmzstd")
  448. set(ZSTD_LIBRARY cmzstd)
  449. add_subdirectory(Utilities/cmzstd)
  450. CMAKE_SET_TARGET_FOLDER(cmzstd "Utilities/3rdParty")
  451. endif()
  452. endif()
  453. #---------------------------------------------------------------------
  454. # Build or use system liblzma for libarchive.
  455. if(NOT CMAKE_USE_SYSTEM_LIBARCHIVE)
  456. if(CMAKE_USE_SYSTEM_LIBLZMA)
  457. find_package(LibLZMA)
  458. if(NOT LIBLZMA_FOUND)
  459. message(FATAL_ERROR "CMAKE_USE_SYSTEM_LIBLZMA is ON but LibLZMA is not found!")
  460. endif()
  461. else()
  462. add_subdirectory(Utilities/cmliblzma)
  463. CMAKE_SET_TARGET_FOLDER(cmliblzma "Utilities/3rdParty")
  464. set(LIBLZMA_HAS_AUTO_DECODER 1)
  465. set(LIBLZMA_HAS_EASY_ENCODER 1)
  466. set(LIBLZMA_HAS_LZMA_PRESET 1)
  467. set(LIBLZMA_INCLUDE_DIR
  468. "${CMAKE_CURRENT_SOURCE_DIR}/Utilities/cmliblzma/liblzma/api")
  469. set(LIBLZMA_LIBRARY cmliblzma)
  470. endif()
  471. endif()
  472. #---------------------------------------------------------------------
  473. # Build or use system libarchive for CMake and CTest.
  474. if(CMAKE_USE_SYSTEM_LIBARCHIVE)
  475. find_package(LibArchive 3.3.3)
  476. if(NOT LibArchive_FOUND)
  477. message(FATAL_ERROR "CMAKE_USE_SYSTEM_LIBARCHIVE is ON but LibArchive is not found!")
  478. endif()
  479. set(CMAKE_TAR_INCLUDES ${LibArchive_INCLUDE_DIRS})
  480. set(CMAKE_TAR_LIBRARIES ${LibArchive_LIBRARIES})
  481. else()
  482. set(EXPAT_INCLUDE_DIR ${CMAKE_EXPAT_INCLUDES})
  483. set(EXPAT_LIBRARY ${CMAKE_EXPAT_LIBRARIES})
  484. set(ZLIB_INCLUDE_DIR ${CMAKE_ZLIB_INCLUDES})
  485. set(ZLIB_LIBRARY ${CMAKE_ZLIB_LIBRARIES})
  486. add_definitions(-DLIBARCHIVE_STATIC)
  487. set(ENABLE_NETTLE OFF CACHE INTERNAL "Enable use of Nettle")
  488. set(ENABLE_OPENSSL ${CMAKE_USE_OPENSSL} CACHE INTERNAL "Enable use of OpenSSL")
  489. set(ENABLE_LZMA ON CACHE INTERNAL "Enable the use of the system LZMA library if found")
  490. set(ENABLE_LZ4 OFF CACHE INTERNAL "Enable the use of the system LZ4 library if found")
  491. set(ENABLE_LZO OFF CACHE INTERNAL "Enable the use of the system LZO library if found")
  492. set(ENABLE_ZLIB ON CACHE INTERNAL "Enable the use of the system ZLIB library if found")
  493. set(ENABLE_BZip2 ON CACHE INTERNAL "Enable the use of the system BZip2 library if found")
  494. set(ENABLE_LIBXML2 OFF CACHE INTERNAL "Enable the use of the system libxml2 library if found")
  495. set(ENABLE_EXPAT ON CACHE INTERNAL "Enable the use of the system EXPAT library if found")
  496. set(ENABLE_PCREPOSIX OFF CACHE INTERNAL "Enable the use of the system PCREPOSIX library if found")
  497. set(ENABLE_LibGCC OFF CACHE INTERNAL "Enable the use of the system LibGCC library if found")
  498. set(ENABLE_XATTR OFF CACHE INTERNAL "Enable extended attribute support")
  499. set(ENABLE_ACL OFF CACHE INTERNAL "Enable ACL support")
  500. set(ENABLE_ICONV OFF CACHE INTERNAL "Enable iconv support")
  501. set(ENABLE_CNG OFF CACHE INTERNAL "Enable the use of CNG(Crypto Next Generation)")
  502. add_subdirectory(Utilities/cmlibarchive)
  503. CMAKE_SET_TARGET_FOLDER(cmlibarchive "Utilities/3rdParty")
  504. set(CMAKE_TAR_LIBRARIES cmlibarchive ${BZIP2_LIBRARIES})
  505. endif()
  506. #---------------------------------------------------------------------
  507. # Build jsoncpp library.
  508. if(CMAKE_USE_SYSTEM_JSONCPP)
  509. find_package(JsonCpp 1.4.1)
  510. if(NOT JsonCpp_FOUND)
  511. message(FATAL_ERROR
  512. "CMAKE_USE_SYSTEM_JSONCPP is ON but a JsonCpp is not found!")
  513. endif()
  514. if(CMAKE_CXX_COMPILER_ID MATCHES "GNU|Clang")
  515. set_property(TARGET JsonCpp::JsonCpp APPEND PROPERTY
  516. INTERFACE_COMPILE_OPTIONS -Wno-deprecated-declarations)
  517. endif()
  518. set(CMAKE_JSONCPP_LIBRARIES JsonCpp::JsonCpp)
  519. else()
  520. set(CMAKE_JSONCPP_LIBRARIES cmjsoncpp)
  521. add_subdirectory(Utilities/cmjsoncpp)
  522. CMAKE_SET_TARGET_FOLDER(cmjsoncpp "Utilities/3rdParty")
  523. endif()
  524. #---------------------------------------------------------------------
  525. # Build libuv library.
  526. if(CMAKE_USE_SYSTEM_LIBUV)
  527. find_package(LibUV 1.10.0)
  528. if(NOT LIBUV_FOUND)
  529. message(FATAL_ERROR
  530. "CMAKE_USE_SYSTEM_LIBUV is ON but a libuv is not found!")
  531. endif()
  532. set(CMAKE_LIBUV_LIBRARIES LibUV::LibUV)
  533. else()
  534. set(CMAKE_LIBUV_LIBRARIES cmlibuv)
  535. add_subdirectory(Utilities/cmlibuv)
  536. CMAKE_SET_TARGET_FOLDER(cmlibuv "Utilities/3rdParty")
  537. endif()
  538. #---------------------------------------------------------------------
  539. # Use curses?
  540. if (UNIX)
  541. if(NOT DEFINED BUILD_CursesDialog)
  542. include(${CMake_SOURCE_DIR}/Source/Checks/Curses.cmake)
  543. option(BUILD_CursesDialog "Build the CMake Curses Dialog ccmake" "${CMakeCheckCurses_COMPILED}")
  544. endif()
  545. else ()
  546. set(BUILD_CursesDialog 0)
  547. endif ()
  548. if(BUILD_CursesDialog)
  549. set(CURSES_NEED_NCURSES TRUE)
  550. find_package(Curses)
  551. if(NOT CURSES_FOUND)
  552. message(WARNING
  553. "'ccmake' will not be built because Curses was not found.\n"
  554. "Turn off BUILD_CursesDialog to suppress this message."
  555. )
  556. set(BUILD_CursesDialog 0)
  557. endif()
  558. endif()
  559. if(BUILD_CursesDialog)
  560. if(NOT CMAKE_USE_SYSTEM_FORM)
  561. add_subdirectory(Source/CursesDialog/form)
  562. elseif(NOT CURSES_FORM_LIBRARY)
  563. message( FATAL_ERROR "CMAKE_USE_SYSTEM_FORM in ON but CURSES_FORM_LIBRARY is not set!" )
  564. endif()
  565. endif()
  566. endmacro ()
  567. #-----------------------------------------------------------------------
  568. if(NOT CMake_TEST_EXTERNAL_CMAKE)
  569. if(CMAKE_CXX_PLATFORM_ID MATCHES "OpenBSD")
  570. execute_process(COMMAND ${CMAKE_CXX_COMPILER}
  571. ${CMAKE_CXX_COMPILER_ARG1} -dumpversion
  572. OUTPUT_VARIABLE _GXX_VERSION
  573. )
  574. string(REGEX REPLACE "([0-9])\\.([0-9])(\\.[0-9])?" "\\1\\2"
  575. _GXX_VERSION_SHORT ${_GXX_VERSION})
  576. if(_GXX_VERSION_SHORT EQUAL 33)
  577. message(FATAL_ERROR
  578. "GXX 3.3 on OpenBSD is known to cause CPack to Crash.\n"
  579. "Please use GXX 4.2 or greater to build CMake on OpenBSD\n"
  580. "${CMAKE_CXX_COMPILER} version is: ${_GXX_VERSION}")
  581. endif()
  582. endif()
  583. endif()
  584. #-----------------------------------------------------------------------
  585. # The main section of the CMakeLists file
  586. #
  587. #-----------------------------------------------------------------------
  588. include(Source/CMakeVersion.cmake)
  589. # Include the standard Dart testing module
  590. enable_testing()
  591. include (${CMAKE_ROOT}/Modules/Dart.cmake)
  592. # Set up test-time configuration.
  593. set_directory_properties(PROPERTIES
  594. TEST_INCLUDE_FILE "${CMake_BINARY_DIR}/Tests/EnforceConfig.cmake")
  595. if(NOT CMake_TEST_EXTERNAL_CMAKE)
  596. # where to write the resulting executables and libraries
  597. set(BUILD_SHARED_LIBS OFF)
  598. set(EXECUTABLE_OUTPUT_PATH "" CACHE INTERNAL "No configurable exe dir.")
  599. set(LIBRARY_OUTPUT_PATH "" CACHE INTERNAL
  600. "Where to put the libraries for CMake")
  601. # The CMake executables usually do not need any rpath to run in the build or
  602. # install tree.
  603. set(CMAKE_SKIP_RPATH ON CACHE INTERNAL "CMake does not need RPATHs.")
  604. # Load install destinations.
  605. include(Source/CMakeInstallDestinations.cmake)
  606. if(BUILD_TESTING)
  607. include(${CMake_SOURCE_DIR}/Tests/CMakeInstall.cmake)
  608. endif()
  609. # no clue why we are testing for this here
  610. include(CheckSymbolExists)
  611. CHECK_SYMBOL_EXISTS(unsetenv "stdlib.h" HAVE_UNSETENV)
  612. CHECK_SYMBOL_EXISTS(environ "stdlib.h" HAVE_ENVIRON_NOT_REQUIRE_PROTOTYPE)
  613. endif()
  614. # CMAKE_TESTS_CDASH_SERVER: CDash server used by CMake/Tests.
  615. #
  616. # If not defined or "", this variable defaults to the server at
  617. # "http://open.cdash.org".
  618. #
  619. # If set explicitly to "NOTFOUND", curl tests and ctest tests that use
  620. # the network are skipped.
  621. #
  622. # If set to something starting with "http://localhost/", the CDash is
  623. # expected to be an instance of CDash used for CDash testing, pointing
  624. # to a cdash4simpletest database. In these cases, the CDash dashboards
  625. # should be run first.
  626. #
  627. if("x${CMAKE_TESTS_CDASH_SERVER}" STREQUAL "x" AND NOT CMake_TEST_NO_NETWORK)
  628. set(CMAKE_TESTS_CDASH_SERVER "http://open.cdash.org")
  629. endif()
  630. if(CMake_TEST_EXTERNAL_CMAKE)
  631. set(KWIML_TEST_ENABLE 1)
  632. add_subdirectory(Utilities/KWIML)
  633. endif()
  634. if(NOT CMake_TEST_EXTERNAL_CMAKE)
  635. # build the utilities (a macro defined in this file)
  636. CMAKE_BUILD_UTILITIES()
  637. # On NetBSD ncurses is required, since curses doesn't have the wsyncup()
  638. # function. ncurses is installed via pkgsrc, so the library is in /usr/pkg/lib,
  639. # which isn't in the default linker search path. So without RPATH ccmake
  640. # doesn't run and the build doesn't succeed since ccmake is executed for
  641. # generating the documentation.
  642. if(BUILD_CursesDialog)
  643. get_filename_component(_CURSES_DIR "${CURSES_LIBRARY}" PATH)
  644. set(CURSES_NEED_RPATH FALSE)
  645. if(NOT "${_CURSES_DIR}" STREQUAL "/lib" AND NOT "${_CURSES_DIR}" STREQUAL "/usr/lib" AND NOT "${_CURSES_DIR}" STREQUAL "/lib64" AND NOT "${_CURSES_DIR}" STREQUAL "/usr/lib64")
  646. set(CURSES_NEED_RPATH TRUE)
  647. endif()
  648. endif()
  649. if(BUILD_QtDialog)
  650. if(APPLE)
  651. set(CMAKE_BUNDLE_VERSION
  652. "${CMake_VERSION_MAJOR}.${CMake_VERSION_MINOR}.${CMake_VERSION_PATCH}")
  653. set(CMAKE_BUNDLE_LOCATION "${CMAKE_INSTALL_PREFIX}")
  654. # make sure CMAKE_INSTALL_PREFIX ends in /
  655. if(NOT CMAKE_INSTALL_PREFIX MATCHES "/$")
  656. set(CMAKE_INSTALL_PREFIX "${CMAKE_INSTALL_PREFIX}/")
  657. endif()
  658. set(CMAKE_INSTALL_PREFIX
  659. "${CMAKE_INSTALL_PREFIX}CMake.app/Contents")
  660. endif()
  661. set(QT_NEED_RPATH FALSE)
  662. if(NOT "${QT_LIBRARY_DIR}" STREQUAL "/lib" AND NOT "${QT_LIBRARY_DIR}" STREQUAL "/usr/lib" AND NOT "${QT_LIBRARY_DIR}" STREQUAL "/lib64" AND NOT "${QT_LIBRARY_DIR}" STREQUAL "/usr/lib64")
  663. set(QT_NEED_RPATH TRUE)
  664. endif()
  665. endif()
  666. # The same might be true on other systems for other libraries.
  667. # Then only enable RPATH if we have are building at least with cmake 2.4,
  668. # since this one has much better RPATH features than cmake 2.2.
  669. # The executables are then built with the RPATH for the libraries outside
  670. # the build tree, which is both the build and the install RPATH.
  671. if (UNIX)
  672. if( CMAKE_USE_SYSTEM_CURL OR CMAKE_USE_SYSTEM_ZLIB
  673. OR CMAKE_USE_SYSTEM_EXPAT OR CURSES_NEED_RPATH OR QT_NEED_RPATH)
  674. set(CMAKE_SKIP_RPATH OFF CACHE INTERNAL "CMake built with RPATH.")
  675. set(CMAKE_INSTALL_RPATH_USE_LINK_PATH TRUE)
  676. set(CMAKE_BUILD_WITH_INSTALL_RPATH TRUE)
  677. endif()
  678. endif ()
  679. # add the uninstall support
  680. configure_file(
  681. "${CMAKE_CURRENT_SOURCE_DIR}/cmake_uninstall.cmake.in"
  682. "${CMAKE_CURRENT_BINARY_DIR}/cmake_uninstall.cmake"
  683. @ONLY)
  684. add_custom_target(uninstall
  685. "${CMAKE_COMMAND}" -P "${CMAKE_CURRENT_BINARY_DIR}/cmake_uninstall.cmake")
  686. include (CMakeCPack.cmake)
  687. endif()
  688. # setup some Testing support (a macro defined in this file)
  689. CMAKE_SETUP_TESTING()
  690. if(NOT CMake_TEST_EXTERNAL_CMAKE)
  691. if(NOT CMake_VERSION_IS_RELEASE)
  692. if(CMAKE_C_COMPILER_ID STREQUAL "GNU" AND
  693. NOT "${CMAKE_C_COMPILER_VERSION}" VERSION_LESS 4.2)
  694. set(C_FLAGS_LIST -Wcast-align -Werror-implicit-function-declaration -Wchar-subscripts
  695. -Wall -W -Wpointer-arith -Wwrite-strings -Wformat-security
  696. -Wmissing-format-attribute -fno-common -Wundef
  697. )
  698. set(CXX_FLAGS_LIST -Wnon-virtual-dtor -Wcast-align -Wchar-subscripts -Wall -W
  699. -Wshadow -Wpointer-arith -Wformat-security -Wundef
  700. )
  701. foreach(FLAG_LANG C CXX)
  702. foreach(FLAG ${${FLAG_LANG}_FLAGS_LIST})
  703. if(NOT " ${CMAKE_${FLAG_LANG}_FLAGS} " MATCHES " ${FLAG} ")
  704. set(CMAKE_${FLAG_LANG}_FLAGS "${CMAKE_${FLAG_LANG}_FLAGS} ${FLAG}")
  705. endif()
  706. endforeach()
  707. endforeach()
  708. unset(C_FLAGS_LIST)
  709. unset(CXX_FLAGS_LIST)
  710. endif()
  711. endif()
  712. # build the remaining subdirectories
  713. add_subdirectory(Source)
  714. add_subdirectory(Utilities)
  715. endif()
  716. add_subdirectory(Tests)
  717. if(NOT CMake_TEST_EXTERNAL_CMAKE)
  718. if(BUILD_TESTING)
  719. CMAKE_SET_TARGET_FOLDER(CMakeLibTests "Tests")
  720. IF(TARGET CMakeServerLibTests)
  721. CMAKE_SET_TARGET_FOLDER(CMakeServerLibTests "Tests")
  722. ENDIF()
  723. endif()
  724. if(TARGET documentation)
  725. CMAKE_SET_TARGET_FOLDER(documentation "Documentation")
  726. endif()
  727. endif()
  728. if(BUILD_TESTING)
  729. add_test(SystemInformationNew "${CMAKE_CMAKE_COMMAND}"
  730. --system-information -G "${CMAKE_GENERATOR}" )
  731. endif()
  732. if(NOT CMake_TEST_EXTERNAL_CMAKE)
  733. # Install license file as it requires.
  734. install(FILES Copyright.txt DESTINATION ${CMAKE_DOC_DIR})
  735. # Install script directories.
  736. install(
  737. DIRECTORY Help Modules Templates
  738. DESTINATION ${CMAKE_DATA_DIR}
  739. FILE_PERMISSIONS OWNER_READ OWNER_WRITE GROUP_READ WORLD_READ
  740. DIRECTORY_PERMISSIONS OWNER_READ OWNER_EXECUTE OWNER_WRITE
  741. GROUP_READ GROUP_EXECUTE
  742. WORLD_READ WORLD_EXECUTE
  743. PATTERN "*.sh*" PERMISSIONS OWNER_READ OWNER_EXECUTE OWNER_WRITE
  744. GROUP_READ GROUP_EXECUTE
  745. WORLD_READ WORLD_EXECUTE
  746. REGEX "Help/(dev|guide)($|/)" EXCLUDE
  747. )
  748. # Install auxiliary files integrating with other tools.
  749. add_subdirectory(Auxiliary)
  750. # Optionally sign installed binaries.
  751. if(CMake_INSTALL_SIGNTOOL)
  752. configure_file(Source/CMakeInstallSignTool.cmake.in Source/CMakeInstallSignTool.cmake @ONLY)
  753. install(SCRIPT ${CMAKE_CURRENT_BINARY_DIR}/Source/CMakeInstallSignTool.cmake)
  754. endif()
  755. endif()