1
0

CPack.cmake 37 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773774775776777778779780781782783784785786787788789790791792793794795796797798799800801802803804805806807808809810811812813814815816817818819820821822823824825826827828829830831832833834835836837838839840841842843844845846847848849850851852853854855856857858859860861862863864865866
  1. # - Build binary and source package installers
  2. #
  3. # The CPack module generates binary and source installers in a variety
  4. # of formats using the cpack program. Inclusion of the CPack module
  5. # adds two new targets to the resulting makefiles, package and
  6. # package_source, which build the binary and source installers,
  7. # respectively. The generated binary installers contain everything
  8. # installed via CMake's INSTALL command (and the deprecated
  9. # INSTALL_FILES, INSTALL_PROGRAMS, and INSTALL_TARGETS commands).
  10. #
  11. # For certain kinds of binary installers (including the graphical
  12. # installers on Mac OS X and Windows), CPack generates installers that
  13. # allow users to select individual application components to
  14. # install. The contents of each of the components are identified by
  15. # the COMPONENT argument of CMake's INSTALL command. These components
  16. # can be annotated with user-friendly names and descriptions,
  17. # inter-component dependencies, etc., and grouped in various ways to
  18. # customize the resulting installer. See the cpack_add_* commands,
  19. # described below, for more information about component-specific
  20. # installations.
  21. #
  22. # Before including the CPack module, there are a variety of variables
  23. # that can be set to customize the resulting installers. The most
  24. # commonly-used variables are:
  25. #
  26. # CPACK_PACKAGE_NAME - The name of the package (or application). If
  27. # not specified, defaults to the project name.
  28. #
  29. # CPACK_PACKAGE_VENDOR - The name of the package vendor (e.g.,
  30. # "Kitware").
  31. #
  32. # CPACK_PACKAGE_VERSION_MAJOR - Package major Version
  33. #
  34. # CPACK_PACKAGE_VERSION_MINOR - Package minor Version
  35. #
  36. # CPACK_PACKAGE_VERSION_PATCH - Package patch Version
  37. #
  38. # CPACK_PACKAGE_DESCRIPTION_FILE - A text file used to describe the
  39. # project. Used, for example, the introduction screen of a
  40. # CPack-generated Windows installer to describe the project.
  41. #
  42. # CPACK_PACKAGE_DESCRIPTION_SUMMARY - Short description of the
  43. # project (only a few words).
  44. #
  45. # CPACK_PACKAGE_FILE_NAME - The name of the package file to generate,
  46. # not including the extension. For example, cmake-2.6.1-Linux-i686.
  47. #
  48. # CPACK_PACKAGE_INSTALL_DIRECTORY - Installation directory on the
  49. # target system, e.g., "CMake 2.5".
  50. #
  51. # CPACK_RESOURCE_FILE_LICENSE - License file for the project, which
  52. # will typically be displayed to the user (often with an explicit
  53. # "Accept" button, for graphical installers) prior to installation.
  54. #
  55. # CPACK_RESOURCE_FILE_README - ReadMe file for the project, which
  56. # typically describes in some detail
  57. #
  58. # CPACK_RESOURCE_FILE_WELCOME - Welcome file for the project, which
  59. # welcomes users to this installer. Typically used in the graphical
  60. # installers on Windows and Mac OS X.
  61. #
  62. # CPACK_MONOLITHIC_INSTALL - Disables the component-based
  63. # installation mechanism, so that all components are always installed.
  64. #
  65. # CPACK_GENERATOR - List of CPack generators to use. If not
  66. # specified, CPack will create a set of options (e.g.,
  67. # CPACK_BINARY_NSIS) allowing the user to enable/disable individual
  68. # generators.
  69. #
  70. # CPACK_OUTPUT_CONFIG_FILE - The name of the CPack configuration file
  71. # for binary installers that will be generated by the CPack
  72. # module. Defaults to CPackConfig.cmake.
  73. #
  74. # CPACK_PACKAGE_EXECUTABLES - Lists each of the executables along
  75. # with a text label, to be used to create Start Menu shortcuts on
  76. # Windows. For example, setting this to the list ccmake;CMake will
  77. # create a shortcut named "CMake" that will execute the installed
  78. # executable ccmake.
  79. #
  80. # CPACK_STRIP_FILES - List of files to be stripped. Starting with
  81. # CMake 2.6.0 CPACK_STRIP_FILES will be a boolean variable which
  82. # enables stripping of all files (a list of files evaluates to TRUE
  83. # in CMake, so this change is compatible).
  84. #
  85. # The following CPack variables are specific to source packages, and
  86. # will not affect binary packages:
  87. #
  88. # CPACK_SOURCE_PACKAGE_FILE_NAME - The name of the source package,
  89. # e.g., cmake-2.6.1
  90. #
  91. # CPACK_SOURCE_STRIP_FILES - List of files in the source tree that
  92. # will be stripped. Starting with CMake 2.6.0
  93. # CPACK_SOURCE_STRIP_FILES will be a boolean variable which enables
  94. # stripping of all files (a list of files evaluates to TRUE in CMake,
  95. # so this change is compatible).
  96. #
  97. # CPACK_SOURCE_GENERATOR - List of generators used for the source
  98. # packages. As with CPACK_GENERATOR, if this is not specified then
  99. # CPack will create a set of options (e.g., CPACK_SOURCE_ZIP)
  100. # allowing users to select which packages will be generated.
  101. #
  102. # CPACK_SOURCE_OUTPUT_CONFIG_FILE - The name of the CPack
  103. # configuration file for source installers that will be generated by
  104. # the CPack module. Defaults to CPackSourceConfig.cmake.
  105. #
  106. # CPACK_SOURCE_IGNORE_FILES - Pattern of files in the source tree
  107. # that won't be packaged when building a source package. This is a
  108. # list of patterns, e.g., /CVS/;/\\.svn/;\\.swp$;\\.#;/#;.*~;cscope.*
  109. #
  110. # The following variables are specific to the graphical installers built
  111. # on Windows using the Nullsoft Installation System.
  112. #
  113. # CPACK_PACKAGE_INSTALL_REGISTRY_KEY - Registry key used when
  114. # installing this project.
  115. #
  116. # CPACK_NSIS_MUI_ICON - The icon file (.ico) for the generated
  117. # install program.
  118. #
  119. # CPACK_NSIS_MUI_UNIICON - The icon file (.ico) for the generated
  120. # uninstall program.
  121. #
  122. # CPACK_PACKAGE_ICON - A branding image that will be displayed inside
  123. # the installer.
  124. #
  125. # CPACK_NSIS_EXTRA_INSTALL_COMMANDS - Extra NSIS commands that will
  126. # be added to the install Section.
  127. #
  128. # CPACK_NSIS_EXTRA_UNINSTALL_COMMANDS - Extra NSIS commands that will
  129. # be added to the uninstall Section.
  130. #
  131. # CPACK_NSIS_COMPRESSOR - The arguments that will be passed to the
  132. # NSIS SetCompressor command.
  133. #
  134. # CPACK_NSIS_MODIFY_PATH - If this is set to "ON", then an extra page
  135. # will appear in the installer that will allow the user to choose
  136. # whether the program directory should be added to the system PATH
  137. # variable.
  138. #
  139. # CPACK_NSIS_DISPLAY_NAME - The display name string that appears in
  140. # the Windows Add/Remove Program control panel
  141. #
  142. # CPACK_NSIS_PACKAGE_NAME - The title displayed at the top of the
  143. # installer.
  144. #
  145. # CPACK_NSIS_INSTALLED_ICON_NAME - A path to the executable that
  146. # contains the installer icon.
  147. #
  148. # CPACK_NSIS_HELP_LINK - URL to a web site providing assistance in
  149. # installing your application.
  150. #
  151. # CPACK_NSIS_URL_INFO_ABOUT - URL to a web site providing more
  152. # information about your application.
  153. #
  154. # CPACK_NSIS_CONTACT - Contact information for questions and comments
  155. # about the installation process.
  156. #
  157. # CPACK_NSIS_CREATE_ICONS_EXTRA - Additional NSIS commands for
  158. # creating start menu shortcuts.
  159. #
  160. # CPACK_NSIS_DELETE_ICONS_EXTRA -Additional NSIS commands to
  161. # uninstall start menu shortcuts.
  162. #
  163. # The following variable is specific to installers build on Mac OS X
  164. # using PackageMaker:
  165. #
  166. # CPACK_OSX_PACKAGE_VERSION - The version of Mac OS X that the
  167. # resulting PackageMaker archive should be compatible
  168. # with. Different versions of Mac OS X support different
  169. # features. For example, CPack can only build component-based
  170. # installers for Mac OS X 10.4 or newer, and can only build
  171. # installers that download component son-the-fly for Mac OS X 10.5
  172. # or newer. If left blank, this value will be set to the minimum
  173. # version of Mac OS X that supports the requested features. Set this
  174. # variable to some value (e.g., 10.4) only if you want to guarantee
  175. # that your installer will work on that version of Mac OS X, and
  176. # don't mind missing extra features available in the installer
  177. # shipping with later versions of Mac OS X.
  178. #
  179. # The following variables are for advanced uses of CPack:
  180. #
  181. # CPACK_CMAKE_GENERATOR - What CMake generator should be used if the
  182. # project is CMake project. Defaults to the value of CMAKE_GENERATOR;
  183. # few users will want to change this setting.
  184. #
  185. # CPACK_INSTALL_CMAKE_PROJECTS - List of four values that specify
  186. # what project to install. The four values are: Build directory,
  187. # Project Name, Project Component, Directory. If omitted, CPack will
  188. # build an installer that installers everything.
  189. #
  190. # CPACK_SYSTEM_NAME - System name, defaults to the value of
  191. # ${CMAKE_SYSTEM_NAME}.
  192. #
  193. # CPACK_PACKAGE_VERSION - Package full version, used internally. By
  194. # default, this is built from CPACK_PACKAGE_VERSION_MAJOR,
  195. # CPACK_PACKAGE_VERSION_MINOR, and CPACK_PACKAGE_VERSION_PATCH.
  196. #
  197. # CPACK_TOPLEVEL_TAG - Directory for the installed files.
  198. #
  199. # CPACK_INSTALL_COMMANDS - Extra commands to install components.
  200. #
  201. # CPACK_INSTALL_DIRECTORIES - Extra directories to install.
  202. #
  203. # Component-specific installation allows users to select specific sets
  204. # of components to install during the install process. Installation
  205. # components are identified by the COMPONENT argument of CMake's
  206. # INSTALL commands, and should be further described by the following
  207. # CPack commands:
  208. #
  209. # cpack_add_component - Describes a CPack installation component
  210. # named by the COMPONENT argument to a CMake INSTALL command.
  211. #
  212. # cpack_add_component(compname
  213. # [DISPLAY_NAME name]
  214. # [DESCRIPTION description]
  215. # [HIDDEN | REQUIRED | DISABLED ]
  216. # [GROUP group]
  217. # [DEPENDS comp1 comp2 ... ]
  218. # [INSTALL_TYPES type1 type2 ... ]
  219. # [DOWNLOADED]
  220. # [ARCHIVE_FILE filename])
  221. #
  222. # The cmake_add_component command describes an installation
  223. # component, which the user can opt to install or remove as part of
  224. # the graphical installation process. compname is the name of the
  225. # component, as provided to the COMPONENT argument of one or more
  226. # CMake INSTALL commands.
  227. #
  228. # DISPLAY_NAME is the displayed name of the component, used in
  229. # graphical installers to display the component name. This value can
  230. # be any string.
  231. #
  232. # DESCRIPTION is an extended description of the component, used in
  233. # graphical installers to give the user additional information about
  234. # the component. Descriptions can span multiple lines using "\n" as
  235. # the line separator. Typically, these descriptions should be no
  236. # more than a few lines long.
  237. #
  238. # HIDDEN indicates that this component will be hidden in the
  239. # graphical installer, so that the user cannot directly change
  240. # whether it is installed or not.
  241. #
  242. # REQUIRED indicates that this component is required, and therefore
  243. # will always be installed. It will be visible in the graphical
  244. # installer, but it cannot be unselected. (Typically, required
  245. # components are shown greyed out).
  246. #
  247. # DISABLED indicates that this component should be disabled
  248. # (unselected) by default. The user is free to select this component
  249. # for installation, unless it is also HIDDEN.
  250. #
  251. # DEPENDS lists the components on which this component depends. If
  252. # this component is selected, then each of the components listed
  253. # must also be selected. The dependency information is encoded
  254. # within the installer itself, so that users cannot install
  255. # inconsitent sets of components.
  256. #
  257. # GROUP names the component group of which this component is a
  258. # part. If not provided, the component will be a standalone
  259. # component, not part of any component group. Component groups are
  260. # described with the cpack_add_component_group command, detailed
  261. # below.
  262. #
  263. # INSTALL_TYPES lists the installation types of which this component
  264. # is a part. When one of these installations types is selected, this
  265. # component will automatically be selected. Installation types are
  266. # described with the cpack_add_install_type command, detailed below.
  267. #
  268. # DOWNLOADED indicates that this component should be downloaded
  269. # on-the-fly by the installer, rather than packaged in with the
  270. # installer itself. For more information, see the cpack_configure_downloads
  271. # command.
  272. #
  273. # ARCHIVE_FILE provides a name for the archive file created by CPack
  274. # to be used for downloaded components. If not supplied, CPack will
  275. # create a file with some name based on CPACK_PACKAGE_FILE_NAME and
  276. # the name of the component. See cpack_configure_downloads for more
  277. # information.
  278. #
  279. # cpack_add_component_group - Describes a group of related CPack
  280. # installation components.
  281. #
  282. # cpack_add_component_group(groupname
  283. # [DISPLAY_NAME name]
  284. # [DESCRIPTION description]
  285. # [PARENT_GROUP parent]
  286. # [EXPANDED]
  287. # [BOLD_TITLE])
  288. #
  289. # The cpack_add_component_group describes a group of installation
  290. # components, which will be placed together within the listing of
  291. # options. Typically, component groups allow the user to
  292. # select/deselect all of the components within a single group via a
  293. # single group-level option. Use component groups to reduce the
  294. # complexity of installers with many options. groupname is an
  295. # arbitrary name used to identify the group in the GROUP argument of
  296. # the cpack_add_component command, which is used to place a
  297. # component in a group. The name of the group must not conflict with
  298. # the name of any component.
  299. #
  300. # DISPLAY_NAME is the displayed name of the component group, used in
  301. # graphical installers to display the component group name. This
  302. # value can be any string.
  303. #
  304. # DESCRIPTION is an extended description of the component group,
  305. # used in graphical installers to give the user additional
  306. # information about the components within that group. Descriptions
  307. # can span multiple lines using "\n" as the line
  308. # separator. Typically, these descriptions should be no more than a
  309. # few lines long.
  310. #
  311. # PARENT_GROUP, if supplied, names the parent group of this group.
  312. # Parent groups are used to establish a hierarchy of groups,
  313. # providing an arbitrary hierarchy of groups.
  314. #
  315. # EXPANDED indicates that, by default, the group should show up as
  316. # "expanded", so that the user immediately sees all of the
  317. # components within the group. Otherwise, the group will initially
  318. # show up as a single entry.
  319. #
  320. # BOLD_TITLE indicates that the group title should appear in bold,
  321. # to call the user's attention to the group.
  322. #
  323. # cpack_add_install_type - Add a new installation type containing a
  324. # set of predefined component selections to the graphical installer.
  325. #
  326. # cpack_add_install_type(typename
  327. # [DISPLAY_NAME name])
  328. #
  329. # The cpack_add_install_type command identifies a set of preselected
  330. # components that represents a common use case for an
  331. # application. For example, a "Developer" install type might include
  332. # an application along with its header and library files, while an
  333. # "End user" install type might just include the application's
  334. # executable. Each component identifies itself with one or more
  335. # install types via the INSTALL_TYPES argument to
  336. # cpack_add_component.
  337. #
  338. # DISPLAY_NAME is the displayed name of the install type, which will
  339. # typically show up in a drop-down box within a graphical
  340. # installer. This value can be any string.
  341. #
  342. # cpack_configure_downloads - Configure CPack to download selected
  343. # components on-the-fly as part of the installation process.
  344. #
  345. # cpack_configure_downloads(site
  346. # [UPLOAD_DIRECTORY dirname]
  347. # [ALL]
  348. # [ADD_REMOVE|NO_ADD_REMOVE])
  349. #
  350. # The cpack_configure_downloads command configures installation-time
  351. # downloads of selected components. For each downloadable component,
  352. # CPack will create an archive containing the contents of that
  353. # component, which should be uploaded to the given site. When the
  354. # user selects that component for installation, the installer will
  355. # download and extract the component in place. This feature is
  356. # useful for creating small installers that only download the
  357. # requested components, saving bandwidth. Additionally, the
  358. # installers are small enough that they will be installed as part of
  359. # the normal installation process, and the "Change" button in
  360. # Windows Add/Remove Programs control panel will allow one to add or
  361. # remove parts of the application after the original
  362. # installation. On Windows, the downloaded-components functionality
  363. # requires the ZipDLL plug-in for NSIS, available at:
  364. #
  365. # http://nsis.sourceforge.net/ZipDLL_plug-in
  366. #
  367. # On Mac OS X, installers that download components on-the-fly can
  368. # only be built and installed on system using Mac OS X 10.5 or
  369. # later.
  370. #
  371. # The site argument is a URL where the archives for downloadable
  372. # components will reside, e.g., http://www.cmake.org/files/2.6.1/installer/
  373. # All of the archives produced by CPack should be uploaded to that location.
  374. #
  375. # UPLOAD_DIRECTORY is the local directory where CPack will create the
  376. # various archives for each of the components. The contents of this
  377. # directory should be uploaded to a location accessible by the URL given
  378. # in the site argument. If omitted, CPack will use the directory
  379. # CPackUploads inside the CMake binary directory to store the generated
  380. # archives.
  381. #
  382. # The ALL flag indicates that all components be downloaded. Otherwise, only
  383. # those components explicitly marked as DOWNLOADED or that have a specified
  384. # ARCHIVE_FILE will be downloaded. Additionally, the ALL option implies
  385. # ADD_REMOVE (unless NO_ADD_REMOVE is specified).
  386. #
  387. # ADD_REMOVE indicates that CPack should install a copy of the installer
  388. # that can be called from Windows' Add/Remove Programs dialog (via the
  389. # "Modify" button) to change the set of installed components. NO_ADD_REMOVE
  390. # turns off this behavior. This option is ignored on Mac OS X.
  391. #=============================================================================
  392. # Copyright 2006-2009 Kitware, Inc.
  393. #
  394. # Distributed under the OSI-approved BSD License (the "License");
  395. # see accompanying file Copyright.txt for details.
  396. #
  397. # This software is distributed WITHOUT ANY WARRANTY; without even the
  398. # implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
  399. # See the License for more information.
  400. #=============================================================================
  401. # (To distributed this file outside of CMake, substitute the full
  402. # License text for the above reference.)
  403. # Pick a configuration file
  404. SET(cpack_input_file "${CMAKE_ROOT}/Templates/CPackConfig.cmake.in")
  405. IF(EXISTS "${CMAKE_SOURCE_DIR}/CPackConfig.cmake.in")
  406. SET(cpack_input_file "${CMAKE_SOURCE_DIR}/CPackConfig.cmake.in")
  407. ENDIF(EXISTS "${CMAKE_SOURCE_DIR}/CPackConfig.cmake.in")
  408. SET(cpack_source_input_file "${CMAKE_ROOT}/Templates/CPackConfig.cmake.in")
  409. IF(EXISTS "${CMAKE_SOURCE_DIR}/CPackSourceConfig.cmake.in")
  410. SET(cpack_source_input_file "${CMAKE_SOURCE_DIR}/CPackSourceConfig.cmake.in")
  411. ENDIF(EXISTS "${CMAKE_SOURCE_DIR}/CPackSourceConfig.cmake.in")
  412. # Argument-parsing macro from http://www.cmake.org/Wiki/CMakeMacroParseArguments
  413. MACRO(cpack_parse_arguments prefix arg_names option_names)
  414. SET(${prefix}_DEFAULT_ARGS)
  415. FOREACH(arg_name ${arg_names})
  416. SET(${prefix}_${arg_name})
  417. ENDFOREACH(arg_name)
  418. FOREACH(option ${option_names})
  419. SET(${prefix}_${option} FALSE)
  420. ENDFOREACH(option)
  421. SET(current_arg_name DEFAULT_ARGS)
  422. SET(current_arg_list)
  423. FOREACH(arg ${ARGN})
  424. SET(larg_names ${arg_names})
  425. LIST(FIND larg_names "${arg}" is_arg_name)
  426. IF (is_arg_name GREATER -1)
  427. SET(${prefix}_${current_arg_name} ${current_arg_list})
  428. SET(current_arg_name ${arg})
  429. SET(current_arg_list)
  430. ELSE (is_arg_name GREATER -1)
  431. SET(loption_names ${option_names})
  432. LIST(FIND loption_names "${arg}" is_option)
  433. IF (is_option GREATER -1)
  434. SET(${prefix}_${arg} TRUE)
  435. ELSE (is_option GREATER -1)
  436. SET(current_arg_list ${current_arg_list} ${arg})
  437. ENDIF (is_option GREATER -1)
  438. ENDIF (is_arg_name GREATER -1)
  439. ENDFOREACH(arg)
  440. SET(${prefix}_${current_arg_name} ${current_arg_list})
  441. ENDMACRO(cpack_parse_arguments)
  442. # Macro that appends a SET command for the given variable name (var)
  443. # to the macro named strvar, but only if the variable named "var"
  444. # has been defined. The string will eventually be appended to a CPack
  445. # configuration file.
  446. MACRO(cpack_append_variable_set_command var strvar)
  447. IF (DEFINED ${var})
  448. SET(${strvar} "${${strvar}}SET(${var}")
  449. FOREACH(APPENDVAL ${${var}})
  450. SET(${strvar} "${${strvar}} ${APPENDVAL}")
  451. ENDFOREACH(APPENDVAL)
  452. SET(${strvar} "${${strvar}})\n")
  453. ENDIF (DEFINED ${var})
  454. ENDMACRO(cpack_append_variable_set_command)
  455. # Macro that appends a SET command for the given variable name (var)
  456. # to the macro named strvar, but only if the variable named "var"
  457. # has been defined and is a string. The string will eventually be
  458. # appended to a CPack configuration file.
  459. MACRO(cpack_append_string_variable_set_command var strvar)
  460. IF (DEFINED ${var})
  461. LIST(LENGTH ${var} CPACK_APP_VALUE_LEN)
  462. IF(${CPACK_APP_VALUE_LEN} EQUAL 1)
  463. SET(${strvar} "${${strvar}}SET(${var} \"${${var}}\")\n")
  464. ENDIF(${CPACK_APP_VALUE_LEN} EQUAL 1)
  465. ENDIF (DEFINED ${var})
  466. ENDMACRO(cpack_append_string_variable_set_command)
  467. # Macro that appends a SET command for the given variable name (var)
  468. # to the macro named strvar, but only if the variable named "var"
  469. # has been set to true. The string will eventually be
  470. # appended to a CPack configuration file.
  471. MACRO(cpack_append_option_set_command var strvar)
  472. IF (${var})
  473. LIST(LENGTH ${var} CPACK_APP_VALUE_LEN)
  474. IF(${CPACK_APP_VALUE_LEN} EQUAL 1)
  475. SET(${strvar} "${${strvar}}SET(${var} TRUE)\n")
  476. ENDIF(${CPACK_APP_VALUE_LEN} EQUAL 1)
  477. ENDIF (${var})
  478. ENDMACRO(cpack_append_option_set_command)
  479. # Macro that adds a component to the CPack installer
  480. MACRO(cpack_add_component compname)
  481. STRING(TOUPPER ${compname} CPACK_ADDCOMP_UNAME)
  482. cpack_parse_arguments(CPACK_COMPONENT_${CPACK_ADDCOMP_UNAME}
  483. "DISPLAY_NAME;DESCRIPTION;GROUP;DEPENDS;INSTALL_TYPES;ARCHIVE_FILE"
  484. "HIDDEN;REQUIRED;DISABLED;DOWNLOADED"
  485. ${ARGN}
  486. )
  487. if (CPACK_COMPONENT_${CPACK_ADDCOMP_UNAME}_DOWNLOADED)
  488. SET(CPACK_ADDCOMP_STR "\n# Configuration for downloaded component \"${compname}\"\n")
  489. else ()
  490. SET(CPACK_ADDCOMP_STR "\n# Configuration for component \"${compname}\"\n")
  491. endif ()
  492. IF(NOT CPACK_MONOLITHIC_INSTALL)
  493. # If the user didn't set CPACK_COMPONENTS_ALL explicitly, update the
  494. # value of CPACK_COMPONENTS_ALL in the configuration file. This will
  495. # take care of any components that have been added after the CPack
  496. # moduled was included.
  497. IF(NOT CPACK_COMPONENTS_ALL_SET_BY_USER)
  498. GET_CMAKE_PROPERTY(CPACK_ADDCOMP_COMPONENTS COMPONENTS)
  499. SET(CPACK_ADDCOMP_STR "${CPACK_ADDCOMP_STR}\nSET(CPACK_COMPONENTS_ALL")
  500. FOREACH(COMP ${CPACK_ADDCOMP_COMPONENTS})
  501. SET(CPACK_ADDCOMP_STR "${CPACK_ADDCOMP_STR} ${COMP}")
  502. ENDFOREACH(COMP)
  503. SET(CPACK_ADDCOMP_STR "${CPACK_ADDCOMP_STR})\n")
  504. ENDIF(NOT CPACK_COMPONENTS_ALL_SET_BY_USER)
  505. ENDIF(NOT CPACK_MONOLITHIC_INSTALL)
  506. cpack_append_string_variable_set_command(
  507. CPACK_COMPONENT_${CPACK_ADDCOMP_UNAME}_DISPLAY_NAME
  508. CPACK_ADDCOMP_STR)
  509. cpack_append_string_variable_set_command(
  510. CPACK_COMPONENT_${CPACK_ADDCOMP_UNAME}_DESCRIPTION
  511. CPACK_ADDCOMP_STR)
  512. cpack_append_variable_set_command(
  513. CPACK_COMPONENT_${CPACK_ADDCOMP_UNAME}_GROUP
  514. CPACK_ADDCOMP_STR)
  515. cpack_append_variable_set_command(
  516. CPACK_COMPONENT_${CPACK_ADDCOMP_UNAME}_DEPENDS
  517. CPACK_ADDCOMP_STR)
  518. cpack_append_variable_set_command(
  519. CPACK_COMPONENT_${CPACK_ADDCOMP_UNAME}_INSTALL_TYPES
  520. CPACK_ADDCOMP_STR)
  521. cpack_append_string_variable_set_command(
  522. CPACK_COMPONENT_${CPACK_ADDCOMP_UNAME}_ARCHIVE_FILE
  523. CPACK_ADDCOMP_STR)
  524. cpack_append_option_set_command(
  525. CPACK_COMPONENT_${CPACK_ADDCOMP_UNAME}_HIDDEN
  526. CPACK_ADDCOMP_STR)
  527. cpack_append_option_set_command(
  528. CPACK_COMPONENT_${CPACK_ADDCOMP_UNAME}_REQUIRED
  529. CPACK_ADDCOMP_STR)
  530. cpack_append_option_set_command(
  531. CPACK_COMPONENT_${CPACK_ADDCOMP_UNAME}_DISABLED
  532. CPACK_ADDCOMP_STR)
  533. cpack_append_option_set_command(
  534. CPACK_COMPONENT_${CPACK_ADDCOMP_UNAME}_DOWNLOADED
  535. CPACK_ADDCOMP_STR)
  536. FILE(APPEND "${CPACK_OUTPUT_CONFIG_FILE}" "${CPACK_ADDCOMP_STR}")
  537. ENDMACRO(cpack_add_component)
  538. # Macro that adds a component group to the CPack installer
  539. MACRO(cpack_add_component_group grpname)
  540. STRING(TOUPPER ${grpname} CPACK_ADDGRP_UNAME)
  541. cpack_parse_arguments(CPACK_COMPONENT_GROUP_${CPACK_ADDGRP_UNAME}
  542. "DISPLAY_NAME;DESCRIPTION"
  543. "EXPANDED;BOLD_TITLE"
  544. ${ARGN}
  545. )
  546. SET(CPACK_ADDGRP_STR "\n# Configuration for component group \"${grpname}\"\n")
  547. cpack_append_string_variable_set_command(
  548. CPACK_COMPONENT_GROUP_${CPACK_ADDGRP_UNAME}_DISPLAY_NAME
  549. CPACK_ADDGRP_STR)
  550. cpack_append_string_variable_set_command(
  551. CPACK_COMPONENT_GROUP_${CPACK_ADDGRP_UNAME}_DESCRIPTION
  552. CPACK_ADDGRP_STR)
  553. cpack_append_option_set_command(
  554. CPACK_COMPONENT_GROUP_${CPACK_ADDGRP_UNAME}_EXPANDED
  555. CPACK_ADDGRP_STR)
  556. cpack_append_option_set_command(
  557. CPACK_COMPONENT_GROUP_${CPACK_ADDGRP_UNAME}_BOLD_TITLE
  558. CPACK_ADDGRP_STR)
  559. FILE(APPEND "${CPACK_OUTPUT_CONFIG_FILE}" "${CPACK_ADDGRP_STR}")
  560. ENDMACRO(cpack_add_component_group)
  561. # Macro that adds an installation type to the CPack installer
  562. MACRO(cpack_add_install_type insttype)
  563. STRING(TOUPPER ${insttype} CPACK_INSTTYPE_UNAME)
  564. cpack_parse_arguments(CPACK_INSTALL_TYPE_${CPACK_INSTTYPE_UNAME}
  565. "DISPLAY_NAME"
  566. ""
  567. ${ARGN}
  568. )
  569. SET(CPACK_INSTTYPE_STR
  570. "\n# Configuration for installation type \"${insttype}\"\n")
  571. SET(CPACK_INSTTYPE_STR
  572. "${CPACK_INSTTYPE_STR}LIST(APPEND CPACK_ALL_INSTALL_TYPES ${insttype})\n")
  573. cpack_append_string_variable_set_command(
  574. CPACK_INSTALL_TYPE_${CPACK_INSTTYPE_UNAME}_DISPLAY_NAME
  575. CPACK_INSTTYPE_STR)
  576. FILE(APPEND "${CPACK_OUTPUT_CONFIG_FILE}" "${CPACK_INSTTYPE_STR}")
  577. ENDMACRO(cpack_add_install_type)
  578. MACRO(cpack_configure_downloads site)
  579. cpack_parse_arguments(CPACK_DOWNLOAD
  580. "UPLOAD_DIRECTORY"
  581. "ALL;ADD_REMOVE;NO_ADD_REMOVE"
  582. ${ARGN}
  583. )
  584. SET(CPACK_CONFIG_DL_STR
  585. "\n# Downloaded components configuration\n")
  586. SET(CPACK_UPLOAD_DIRECTORY ${CPACK_DOWNLOAD_UPLOAD_DIRECTORY})
  587. SET(CPACK_DOWNLOAD_SITE ${site})
  588. cpack_append_string_variable_set_command(
  589. CPACK_DOWNLOAD_SITE
  590. CPACK_CONFIG_DL_STR)
  591. cpack_append_string_variable_set_command(
  592. CPACK_UPLOAD_DIRECTORY
  593. CPACK_CONFIG_DL_STR)
  594. cpack_append_option_set_command(
  595. CPACK_DOWNLOAD_ALL
  596. CPACK_CONFIG_DL_STR)
  597. IF (${CPACK_DOWNLOAD_ALL} AND NOT ${CPACK_DOWNLOAD_NO_ADD_REMOVE})
  598. SET(CPACK_DOWNLOAD_ADD_REMOVE ON)
  599. ENDIF (${CPACK_DOWNLOAD_ALL} AND NOT ${CPACK_DOWNLOAD_NO_ADD_REMOVE})
  600. SET(CPACK_ADD_REMOVE ${CPACK_DOWNLOAD_ADD_REMOVE})
  601. cpack_append_option_set_command(
  602. CPACK_ADD_REMOVE
  603. CPACK_CONFIG_DL_STR)
  604. FILE(APPEND "${CPACK_OUTPUT_CONFIG_FILE}" "${CPACK_CONFIG_DL_STR}")
  605. ENDMACRO(cpack_configure_downloads)
  606. # Macro for setting values if a user did not overwrite them
  607. MACRO(cpack_set_if_not_set name value)
  608. IF(NOT DEFINED "${name}")
  609. SET(${name} "${value}")
  610. ENDIF(NOT DEFINED "${name}")
  611. ENDMACRO(cpack_set_if_not_set)
  612. # Macro to encode variables for the configuration file
  613. # find any varable that stars with CPACK and create a variable
  614. # _CPACK_OTHER_VARIABLES_ that contains SET commands for
  615. # each cpack variable. _CPACK_OTHER_VARIABLES_ is then
  616. # used as an @ replacment in configure_file for the CPackConfig.
  617. MACRO(cpack_encode_variables)
  618. SET(_CPACK_OTHER_VARIABLES_)
  619. GET_CMAKE_PROPERTY(res VARIABLES)
  620. FOREACH(var ${res})
  621. IF("xxx${var}" MATCHES "xxxCPACK")
  622. SET(_CPACK_OTHER_VARIABLES_
  623. "${_CPACK_OTHER_VARIABLES_}\nSET(${var} \"${${var}}\")")
  624. ENDIF("xxx${var}" MATCHES "xxxCPACK")
  625. ENDFOREACH(var ${res})
  626. ENDMACRO(cpack_encode_variables)
  627. # Set the package name
  628. cpack_set_if_not_set(CPACK_PACKAGE_NAME "${CMAKE_PROJECT_NAME}")
  629. cpack_set_if_not_set(CPACK_PACKAGE_VERSION_MAJOR "0")
  630. cpack_set_if_not_set(CPACK_PACKAGE_VERSION_MINOR "1")
  631. cpack_set_if_not_set(CPACK_PACKAGE_VERSION_PATCH "1")
  632. cpack_set_if_not_set(CPACK_PACKAGE_VERSION
  633. "${CPACK_PACKAGE_VERSION_MAJOR}.${CPACK_PACKAGE_VERSION_MINOR}.${CPACK_PACKAGE_VERSION_PATCH}")
  634. cpack_set_if_not_set(CPACK_PACKAGE_VENDOR "Humanity")
  635. cpack_set_if_not_set(CPACK_PACKAGE_DESCRIPTION_SUMMARY
  636. "${CMAKE_PROJECT_NAME} built using CMake")
  637. cpack_set_if_not_set(CPACK_PACKAGE_DESCRIPTION_FILE
  638. "${CMAKE_ROOT}/Templates/CPack.GenericDescription.txt")
  639. cpack_set_if_not_set(CPACK_RESOURCE_FILE_LICENSE
  640. "${CMAKE_ROOT}/Templates/CPack.GenericLicense.txt")
  641. cpack_set_if_not_set(CPACK_RESOURCE_FILE_README
  642. "${CMAKE_ROOT}/Templates/CPack.GenericDescription.txt")
  643. cpack_set_if_not_set(CPACK_RESOURCE_FILE_WELCOME
  644. "${CMAKE_ROOT}/Templates/CPack.GenericWelcome.txt")
  645. cpack_set_if_not_set(CPACK_MODULE_PATH "${CMAKE_MODULE_PATH}")
  646. IF(CPACK_NSIS_MODIFY_PATH)
  647. SET(CPACK_NSIS_MODIFY_PATH ON)
  648. ENDIF(CPACK_NSIS_MODIFY_PATH)
  649. SET(__cpack_system_name ${CMAKE_SYSTEM_NAME})
  650. IF(${__cpack_system_name} MATCHES Windows)
  651. IF(CMAKE_CL_64)
  652. SET(__cpack_system_name win64)
  653. ELSE(CMAKE_CL_64)
  654. SET(__cpack_system_name win32)
  655. ENDIF(CMAKE_CL_64)
  656. ENDIF(${__cpack_system_name} MATCHES Windows)
  657. cpack_set_if_not_set(CPACK_SYSTEM_NAME "${__cpack_system_name}")
  658. # <project>-<major>.<minor>.<patch>-<release>-<platform>.<pkgtype>
  659. cpack_set_if_not_set(CPACK_PACKAGE_FILE_NAME
  660. "${CPACK_PACKAGE_NAME}-${CPACK_PACKAGE_VERSION}-${CPACK_SYSTEM_NAME}")
  661. cpack_set_if_not_set(CPACK_PACKAGE_INSTALL_DIRECTORY
  662. "${CPACK_PACKAGE_NAME} ${CPACK_PACKAGE_VERSION}")
  663. cpack_set_if_not_set(CPACK_PACKAGE_INSTALL_REGISTRY_KEY
  664. "${CPACK_PACKAGE_NAME} ${CPACK_PACKAGE_VERSION}")
  665. cpack_set_if_not_set(CPACK_PACKAGE_DEFAULT_LOCATION "/")
  666. cpack_set_if_not_set(CPACK_PACKAGE_RELOCATABLE "true")
  667. # always force to exactly "true" or "false" for CPack.Info.plist.in:
  668. if(CPACK_PACKAGE_RELOCATABLE)
  669. set(CPACK_PACKAGE_RELOCATABLE "true")
  670. else(CPACK_PACKAGE_RELOCATABLE)
  671. set(CPACK_PACKAGE_RELOCATABLE "false")
  672. endif(CPACK_PACKAGE_RELOCATABLE)
  673. macro(cpack_check_file_exists file description)
  674. if(NOT EXISTS "${file}")
  675. message(SEND_ERROR "CPack ${description} file: \"${file}\" could not be found.")
  676. endif(NOT EXISTS "${file}")
  677. endmacro(cpack_check_file_exists)
  678. cpack_check_file_exists("${CPACK_PACKAGE_DESCRIPTION_FILE}" "package description")
  679. cpack_check_file_exists("${CPACK_RESOURCE_FILE_LICENSE}" "license resource")
  680. cpack_check_file_exists("${CPACK_RESOURCE_FILE_README}" "readme resource")
  681. cpack_check_file_exists("${CPACK_RESOURCE_FILE_WELCOME}" "welcome resource")
  682. macro(cpack_optional_append _list _cond _item)
  683. if(${_cond})
  684. set(${_list} ${${_list}} ${_item})
  685. endif(${_cond})
  686. endmacro(cpack_optional_append _list _cond _item)
  687. # Provide options to choose generators
  688. # we might check here if the required tools for the generates exist
  689. # and set the defaults according to the results
  690. if(NOT CPACK_GENERATOR)
  691. if(UNIX)
  692. if(CYGWIN)
  693. option(CPACK_BINARY_CYGWIN "Enable to build Cygwin binary packages" ON)
  694. else(CYGWIN)
  695. if(APPLE)
  696. option(CPACK_BINARY_BUNDLE "Enable to build OSX bundles" OFF)
  697. option(CPACK_BINARY_DRAGNDROP "Enable to build OSX Drag And Drop package" OFF)
  698. option(CPACK_BINARY_PACKAGEMAKER "Enable to build PackageMaker packages" ON)
  699. option(CPACK_BINARY_OSXX11 "Enable to build OSX X11 packages" OFF)
  700. else(APPLE)
  701. option(CPACK_BINARY_TZ "Enable to build TZ packages" ON)
  702. endif(APPLE)
  703. option(CPACK_BINARY_STGZ "Enable to build STGZ packages" ON)
  704. option(CPACK_BINARY_TGZ "Enable to build TGZ packages" ON)
  705. option(CPACK_BINARY_TBZ2 "Enable to build TBZ2 packages" OFF)
  706. option(CPACK_BINARY_DEB "Enable to build Debian packages" OFF)
  707. option(CPACK_BINARY_RPM "Enable to build RPM packages" OFF)
  708. option(CPACK_BINARY_NSIS "Enable to build NSIS packages" OFF)
  709. endif(CYGWIN)
  710. else(UNIX)
  711. option(CPACK_BINARY_NSIS "Enable to build NSIS packages" ON)
  712. option(CPACK_BINARY_ZIP "Enable to build ZIP packages" OFF)
  713. endif(UNIX)
  714. cpack_optional_append(CPACK_GENERATOR CPACK_BINARY_BUNDLE Bundle)
  715. cpack_optional_append(CPACK_GENERATOR CPACK_BINARY_DRAGNDROP DragNDrop)
  716. cpack_optional_append(CPACK_GENERATOR CPACK_BINARY_PACKAGEMAKER PackageMaker)
  717. cpack_optional_append(CPACK_GENERATOR CPACK_BINARY_OSXX11 OSXX11)
  718. cpack_optional_append(CPACK_GENERATOR CPACK_BINARY_CYGWIN CygwinBinary)
  719. cpack_optional_append(CPACK_GENERATOR CPACK_BINARY_DEB DEB)
  720. cpack_optional_append(CPACK_GENERATOR CPACK_BINARY_RPM RPM)
  721. cpack_optional_append(CPACK_GENERATOR CPACK_BINARY_NSIS NSIS)
  722. cpack_optional_append(CPACK_GENERATOR CPACK_BINARY_STGZ STGZ)
  723. cpack_optional_append(CPACK_GENERATOR CPACK_BINARY_TGZ TGZ)
  724. cpack_optional_append(CPACK_GENERATOR CPACK_BINARY_TBZ2 TBZ2)
  725. cpack_optional_append(CPACK_GENERATOR CPACK_BINARY_TZ TZ)
  726. cpack_optional_append(CPACK_GENERATOR CPACK_BINARY_ZIP ZIP)
  727. endif(NOT CPACK_GENERATOR)
  728. # Provide options to choose source generators
  729. if(NOT CPACK_SOURCE_GENERATOR)
  730. if(UNIX)
  731. if(CYGWIN)
  732. option(CPACK_SOURCE_CYGWIN "Enable to build Cygwin source packages" ON)
  733. else(CYGWIN)
  734. option(CPACK_SOURCE_TBZ2 "Enable to build TBZ2 source packages" ON)
  735. option(CPACK_SOURCE_TGZ "Enable to build TGZ source packages" ON)
  736. option(CPACK_SOURCE_TZ "Enable to build TZ source packages" ON)
  737. option(CPACK_SOURCE_ZIP "Enable to build ZIP source packages" OFF)
  738. endif(CYGWIN)
  739. else(UNIX)
  740. option(CPACK_SOURCE_ZIP "Enable to build ZIP source packages" ON)
  741. endif(UNIX)
  742. cpack_optional_append(CPACK_SOURCE_GENERATOR CPACK_SOURCE_CYGWIN CygwinSource)
  743. cpack_optional_append(CPACK_SOURCE_GENERATOR CPACK_SOURCE_TGZ TGZ)
  744. cpack_optional_append(CPACK_SOURCE_GENERATOR CPACK_SOURCE_TBZ2 TBZ2)
  745. cpack_optional_append(CPACK_SOURCE_GENERATOR CPACK_SOURCE_TZ TZ)
  746. cpack_optional_append(CPACK_SOURCE_GENERATOR CPACK_SOURCE_ZIP ZIP)
  747. endif(NOT CPACK_SOURCE_GENERATOR)
  748. # mark the above options as advanced
  749. mark_as_advanced(CPACK_BINARY_CYGWIN CPACK_BINARY_PACKAGEMAKER CPACK_BINARY_OSXX11
  750. CPACK_BINARY_STGZ CPACK_BINARY_TGZ CPACK_BINARY_TBZ2
  751. CPACK_BINARY_DEB CPACK_BINARY_RPM CPACK_BINARY_TZ
  752. CPACK_BINARY_NSIS CPACK_BINARY_ZIP CPACK_BINARY_BUNDLE
  753. CPACK_SOURCE_CYGWIN CPACK_SOURCE_TBZ2 CPACK_SOURCE_TGZ
  754. CPACK_SOURCE_TZ CPACK_SOURCE_ZIP CPACK_BINARY_DRAGNDROP)
  755. # Set some other variables
  756. cpack_set_if_not_set(CPACK_INSTALL_CMAKE_PROJECTS
  757. "${CMAKE_BINARY_DIR};${CMAKE_PROJECT_NAME};ALL;/")
  758. cpack_set_if_not_set(CPACK_CMAKE_GENERATOR "${CMAKE_GENERATOR}")
  759. cpack_set_if_not_set(CPACK_TOPLEVEL_TAG "${CPACK_SYSTEM_NAME}")
  760. cpack_set_if_not_set(CPACK_NSIS_DISPLAY_NAME "${CPACK_PACKAGE_INSTALL_DIRECTORY}")
  761. cpack_set_if_not_set(CPACK_NSIS_PACKAGE_NAME "${CPACK_PACKAGE_INSTALL_DIRECTORY}")
  762. cpack_set_if_not_set(CPACK_OUTPUT_CONFIG_FILE
  763. "${CMAKE_BINARY_DIR}/CPackConfig.cmake")
  764. cpack_set_if_not_set(CPACK_SOURCE_OUTPUT_CONFIG_FILE
  765. "${CMAKE_BINARY_DIR}/CPackSourceConfig.cmake")
  766. cpack_set_if_not_set(CPACK_SET_DESTDIR OFF)
  767. cpack_set_if_not_set(CPACK_INSTALL_PREFIX "${CMAKE_INSTALL_PREFIX}")
  768. cpack_set_if_not_set(CPACK_NSIS_INSTALLER_ICON_CODE "")
  769. cpack_set_if_not_set(CPACK_NSIS_INSTALLER_MUI_ICON_CODE "")
  770. IF(DEFINED CPACK_COMPONENTS_ALL)
  771. IF(CPACK_MONOLITHIC_INSTALL)
  772. MESSAGE("CPack warning: both CPACK_COMPONENTS_ALL and CPACK_MONOLITHIC_INSTALL have been set.\nDefaulting to a monolithic installation.")
  773. SET(CPACK_COMPONENTS_ALL)
  774. ELSE(CPACK_MONOLITHIC_INSTALL)
  775. # The user has provided the set of components to be installed as
  776. # part of a component-based installation; trust her.
  777. SET(CPACK_COMPONENTS_ALL_SET_BY_USER TRUE)
  778. ENDIF(CPACK_MONOLITHIC_INSTALL)
  779. ELSE(DEFINED CPACK_COMPONENTS_ALL)
  780. # If the user has not specifically requested a monolithic installer
  781. # but has specified components in various "install" commands, tell
  782. # CPack about those components.
  783. IF(NOT CPACK_MONOLITHIC_INSTALL)
  784. GET_CMAKE_PROPERTY(CPACK_COMPONENTS_ALL COMPONENTS)
  785. LIST(LENGTH CPACK_COMPONENTS_ALL CPACK_COMPONENTS_LEN)
  786. IF(CPACK_COMPONENTS_LEN EQUAL 1)
  787. # Only one component: this is not a component-based installation
  788. # (at least, it isn't a component-based installation, but may
  789. # become one later if the user uses the cpack_add_* commands).
  790. SET(CPACK_COMPONENTS_ALL)
  791. ENDIF(CPACK_COMPONENTS_LEN EQUAL 1)
  792. SET(CPACK_COMPONENTS_LEN)
  793. ENDIF(NOT CPACK_MONOLITHIC_INSTALL)
  794. ENDIF(DEFINED CPACK_COMPONENTS_ALL)
  795. # CMake always generates a component named "Unspecified", which is
  796. # used to install everything that doesn't have an explicitly-provided
  797. # component. Since these files should always be installed, we'll make
  798. # them hidden and required.
  799. set(CPACK_COMPONENT_UNSPECIFIED_HIDDEN TRUE)
  800. set(CPACK_COMPONENT_UNSPECIFIED_REQUIRED TRUE)
  801. cpack_encode_variables()
  802. configure_file("${cpack_input_file}" "${CPACK_OUTPUT_CONFIG_FILE}" @ONLY IMMEDIATE)
  803. # Generate source file
  804. cpack_set_if_not_set(CPACK_SOURCE_INSTALLED_DIRECTORIES
  805. "${CMAKE_SOURCE_DIR};/")
  806. cpack_set_if_not_set(CPACK_SOURCE_TOPLEVEL_TAG "${CPACK_SYSTEM_NAME}-Source")
  807. cpack_set_if_not_set(CPACK_SOURCE_PACKAGE_FILE_NAME
  808. "${CPACK_PACKAGE_NAME}-${CPACK_PACKAGE_VERSION}-Source")
  809. cpack_set_if_not_set(CPACK_SOURCE_IGNORE_FILES
  810. "/CVS/;/\\\\\\\\.svn/;\\\\\\\\.swp$;\\\\\\\\.#;/#")
  811. SET(CPACK_INSTALL_CMAKE_PROJECTS "${CPACK_SOURCE_INSTALL_CMAKE_PROJECTS}")
  812. SET(CPACK_INSTALLED_DIRECTORIES "${CPACK_SOURCE_INSTALLED_DIRECTORIES}")
  813. SET(CPACK_GENERATOR "${CPACK_SOURCE_GENERATOR}")
  814. SET(CPACK_TOPLEVEL_TAG "${CPACK_SOURCE_TOPLEVEL_TAG}")
  815. SET(CPACK_PACKAGE_FILE_NAME "${CPACK_SOURCE_PACKAGE_FILE_NAME}")
  816. SET(CPACK_IGNORE_FILES "${CPACK_SOURCE_IGNORE_FILES}")
  817. SET(CPACK_STRIP_FILES "${CPACK_SOURCE_STRIP_FILES}")
  818. cpack_encode_variables()
  819. configure_file("${cpack_source_input_file}"
  820. "${CPACK_SOURCE_OUTPUT_CONFIG_FILE}" @ONLY IMMEDIATE)