CPack.cmake 37 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773774775776777778779780781782783784785786787788789790791792793794795796797798799800801802803804805806807808809810811812813814815816817818819820821822823824825826827828829830831832833834835836837838839840841842843844845846847848849850851852853854
  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. # Pick a configuration file
  392. SET(cpack_input_file "${CMAKE_ROOT}/Templates/CPackConfig.cmake.in")
  393. IF(EXISTS "${CMAKE_SOURCE_DIR}/CPackConfig.cmake.in")
  394. SET(cpack_input_file "${CMAKE_SOURCE_DIR}/CPackConfig.cmake.in")
  395. ENDIF(EXISTS "${CMAKE_SOURCE_DIR}/CPackConfig.cmake.in")
  396. SET(cpack_source_input_file "${CMAKE_ROOT}/Templates/CPackConfig.cmake.in")
  397. IF(EXISTS "${CMAKE_SOURCE_DIR}/CPackSourceConfig.cmake.in")
  398. SET(cpack_source_input_file "${CMAKE_SOURCE_DIR}/CPackSourceConfig.cmake.in")
  399. ENDIF(EXISTS "${CMAKE_SOURCE_DIR}/CPackSourceConfig.cmake.in")
  400. # Argument-parsing macro from http://www.cmake.org/Wiki/CMakeMacroParseArguments
  401. MACRO(cpack_parse_arguments prefix arg_names option_names)
  402. SET(${prefix}_DEFAULT_ARGS)
  403. FOREACH(arg_name ${arg_names})
  404. SET(${prefix}_${arg_name})
  405. ENDFOREACH(arg_name)
  406. FOREACH(option ${option_names})
  407. SET(${prefix}_${option} FALSE)
  408. ENDFOREACH(option)
  409. SET(current_arg_name DEFAULT_ARGS)
  410. SET(current_arg_list)
  411. FOREACH(arg ${ARGN})
  412. SET(larg_names ${arg_names})
  413. LIST(FIND larg_names "${arg}" is_arg_name)
  414. IF (is_arg_name GREATER -1)
  415. SET(${prefix}_${current_arg_name} ${current_arg_list})
  416. SET(current_arg_name ${arg})
  417. SET(current_arg_list)
  418. ELSE (is_arg_name GREATER -1)
  419. SET(loption_names ${option_names})
  420. LIST(FIND loption_names "${arg}" is_option)
  421. IF (is_option GREATER -1)
  422. SET(${prefix}_${arg} TRUE)
  423. ELSE (is_option GREATER -1)
  424. SET(current_arg_list ${current_arg_list} ${arg})
  425. ENDIF (is_option GREATER -1)
  426. ENDIF (is_arg_name GREATER -1)
  427. ENDFOREACH(arg)
  428. SET(${prefix}_${current_arg_name} ${current_arg_list})
  429. ENDMACRO(cpack_parse_arguments)
  430. # Macro that appends a SET command for the given variable name (var)
  431. # to the macro named strvar, but only if the variable named "var"
  432. # has been defined. The string will eventually be appended to a CPack
  433. # configuration file.
  434. MACRO(cpack_append_variable_set_command var strvar)
  435. IF (DEFINED ${var})
  436. SET(${strvar} "${${strvar}}SET(${var}")
  437. FOREACH(APPENDVAL ${${var}})
  438. SET(${strvar} "${${strvar}} ${APPENDVAL}")
  439. ENDFOREACH(APPENDVAL)
  440. SET(${strvar} "${${strvar}})\n")
  441. ENDIF (DEFINED ${var})
  442. ENDMACRO(cpack_append_variable_set_command)
  443. # Macro that appends a SET command for the given variable name (var)
  444. # to the macro named strvar, but only if the variable named "var"
  445. # has been defined and is a string. The string will eventually be
  446. # appended to a CPack configuration file.
  447. MACRO(cpack_append_string_variable_set_command var strvar)
  448. IF (DEFINED ${var})
  449. LIST(LENGTH ${var} CPACK_APP_VALUE_LEN)
  450. IF(${CPACK_APP_VALUE_LEN} EQUAL 1)
  451. SET(${strvar} "${${strvar}}SET(${var} \"${${var}}\")\n")
  452. ENDIF(${CPACK_APP_VALUE_LEN} EQUAL 1)
  453. ENDIF (DEFINED ${var})
  454. ENDMACRO(cpack_append_string_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 set to true. The string will eventually be
  458. # appended to a CPack configuration file.
  459. MACRO(cpack_append_option_set_command var strvar)
  460. IF (${var})
  461. LIST(LENGTH ${var} CPACK_APP_VALUE_LEN)
  462. IF(${CPACK_APP_VALUE_LEN} EQUAL 1)
  463. SET(${strvar} "${${strvar}}SET(${var} TRUE)\n")
  464. ENDIF(${CPACK_APP_VALUE_LEN} EQUAL 1)
  465. ENDIF (${var})
  466. ENDMACRO(cpack_append_option_set_command)
  467. # Macro that adds a component to the CPack installer
  468. MACRO(cpack_add_component compname)
  469. STRING(TOUPPER ${compname} CPACK_ADDCOMP_UNAME)
  470. cpack_parse_arguments(CPACK_COMPONENT_${CPACK_ADDCOMP_UNAME}
  471. "DISPLAY_NAME;DESCRIPTION;GROUP;DEPENDS;INSTALL_TYPES;ARCHIVE_FILE"
  472. "HIDDEN;REQUIRED;DISABLED;DOWNLOADED"
  473. ${ARGN}
  474. )
  475. if (CPACK_COMPONENT_${CPACK_ADDCOMP_UNAME}_DOWNLOADED)
  476. SET(CPACK_ADDCOMP_STR "\n# Configuration for downloaded component \"${compname}\"\n")
  477. else ()
  478. SET(CPACK_ADDCOMP_STR "\n# Configuration for component \"${compname}\"\n")
  479. endif ()
  480. IF(NOT CPACK_MONOLITHIC_INSTALL)
  481. # If the user didn't set CPACK_COMPONENTS_ALL explicitly, update the
  482. # value of CPACK_COMPONENTS_ALL in the configuration file. This will
  483. # take care of any components that have been added after the CPack
  484. # moduled was included.
  485. IF(NOT CPACK_COMPONENTS_ALL_SET_BY_USER)
  486. GET_CMAKE_PROPERTY(CPACK_ADDCOMP_COMPONENTS COMPONENTS)
  487. SET(CPACK_ADDCOMP_STR "${CPACK_ADDCOMP_STR}\nSET(CPACK_COMPONENTS_ALL")
  488. FOREACH(COMP ${CPACK_ADDCOMP_COMPONENTS})
  489. SET(CPACK_ADDCOMP_STR "${CPACK_ADDCOMP_STR} ${COMP}")
  490. ENDFOREACH(COMP)
  491. SET(CPACK_ADDCOMP_STR "${CPACK_ADDCOMP_STR})\n")
  492. ENDIF(NOT CPACK_COMPONENTS_ALL_SET_BY_USER)
  493. ENDIF(NOT CPACK_MONOLITHIC_INSTALL)
  494. cpack_append_string_variable_set_command(
  495. CPACK_COMPONENT_${CPACK_ADDCOMP_UNAME}_DISPLAY_NAME
  496. CPACK_ADDCOMP_STR)
  497. cpack_append_string_variable_set_command(
  498. CPACK_COMPONENT_${CPACK_ADDCOMP_UNAME}_DESCRIPTION
  499. CPACK_ADDCOMP_STR)
  500. cpack_append_variable_set_command(
  501. CPACK_COMPONENT_${CPACK_ADDCOMP_UNAME}_GROUP
  502. CPACK_ADDCOMP_STR)
  503. cpack_append_variable_set_command(
  504. CPACK_COMPONENT_${CPACK_ADDCOMP_UNAME}_DEPENDS
  505. CPACK_ADDCOMP_STR)
  506. cpack_append_variable_set_command(
  507. CPACK_COMPONENT_${CPACK_ADDCOMP_UNAME}_INSTALL_TYPES
  508. CPACK_ADDCOMP_STR)
  509. cpack_append_string_variable_set_command(
  510. CPACK_COMPONENT_${CPACK_ADDCOMP_UNAME}_ARCHIVE_FILE
  511. CPACK_ADDCOMP_STR)
  512. cpack_append_option_set_command(
  513. CPACK_COMPONENT_${CPACK_ADDCOMP_UNAME}_HIDDEN
  514. CPACK_ADDCOMP_STR)
  515. cpack_append_option_set_command(
  516. CPACK_COMPONENT_${CPACK_ADDCOMP_UNAME}_REQUIRED
  517. CPACK_ADDCOMP_STR)
  518. cpack_append_option_set_command(
  519. CPACK_COMPONENT_${CPACK_ADDCOMP_UNAME}_DISABLED
  520. CPACK_ADDCOMP_STR)
  521. cpack_append_option_set_command(
  522. CPACK_COMPONENT_${CPACK_ADDCOMP_UNAME}_DOWNLOADED
  523. CPACK_ADDCOMP_STR)
  524. FILE(APPEND "${CPACK_OUTPUT_CONFIG_FILE}" "${CPACK_ADDCOMP_STR}")
  525. ENDMACRO(cpack_add_component)
  526. # Macro that adds a component group to the CPack installer
  527. MACRO(cpack_add_component_group grpname)
  528. STRING(TOUPPER ${grpname} CPACK_ADDGRP_UNAME)
  529. cpack_parse_arguments(CPACK_COMPONENT_GROUP_${CPACK_ADDGRP_UNAME}
  530. "DISPLAY_NAME;DESCRIPTION"
  531. "EXPANDED;BOLD_TITLE"
  532. ${ARGN}
  533. )
  534. SET(CPACK_ADDGRP_STR "\n# Configuration for component group \"${grpname}\"\n")
  535. cpack_append_string_variable_set_command(
  536. CPACK_COMPONENT_GROUP_${CPACK_ADDGRP_UNAME}_DISPLAY_NAME
  537. CPACK_ADDGRP_STR)
  538. cpack_append_string_variable_set_command(
  539. CPACK_COMPONENT_GROUP_${CPACK_ADDGRP_UNAME}_DESCRIPTION
  540. CPACK_ADDGRP_STR)
  541. cpack_append_option_set_command(
  542. CPACK_COMPONENT_GROUP_${CPACK_ADDGRP_UNAME}_EXPANDED
  543. CPACK_ADDGRP_STR)
  544. cpack_append_option_set_command(
  545. CPACK_COMPONENT_GROUP_${CPACK_ADDGRP_UNAME}_BOLD_TITLE
  546. CPACK_ADDGRP_STR)
  547. FILE(APPEND "${CPACK_OUTPUT_CONFIG_FILE}" "${CPACK_ADDGRP_STR}")
  548. ENDMACRO(cpack_add_component_group)
  549. # Macro that adds an installation type to the CPack installer
  550. MACRO(cpack_add_install_type insttype)
  551. STRING(TOUPPER ${insttype} CPACK_INSTTYPE_UNAME)
  552. cpack_parse_arguments(CPACK_INSTALL_TYPE_${CPACK_INSTTYPE_UNAME}
  553. "DISPLAY_NAME"
  554. ""
  555. ${ARGN}
  556. )
  557. SET(CPACK_INSTTYPE_STR
  558. "\n# Configuration for installation type \"${insttype}\"\n")
  559. SET(CPACK_INSTTYPE_STR
  560. "${CPACK_INSTTYPE_STR}LIST(APPEND CPACK_ALL_INSTALL_TYPES ${insttype})\n")
  561. cpack_append_string_variable_set_command(
  562. CPACK_INSTALL_TYPE_${CPACK_INSTTYPE_UNAME}_DISPLAY_NAME
  563. CPACK_INSTTYPE_STR)
  564. FILE(APPEND "${CPACK_OUTPUT_CONFIG_FILE}" "${CPACK_INSTTYPE_STR}")
  565. ENDMACRO(cpack_add_install_type)
  566. MACRO(cpack_configure_downloads site)
  567. cpack_parse_arguments(CPACK_DOWNLOAD
  568. "UPLOAD_DIRECTORY"
  569. "ALL;ADD_REMOVE;NO_ADD_REMOVE"
  570. ${ARGN}
  571. )
  572. SET(CPACK_CONFIG_DL_STR
  573. "\n# Downloaded components configuration\n")
  574. SET(CPACK_UPLOAD_DIRECTORY ${CPACK_DOWNLOAD_UPLOAD_DIRECTORY})
  575. SET(CPACK_DOWNLOAD_SITE ${site})
  576. cpack_append_string_variable_set_command(
  577. CPACK_DOWNLOAD_SITE
  578. CPACK_CONFIG_DL_STR)
  579. cpack_append_string_variable_set_command(
  580. CPACK_UPLOAD_DIRECTORY
  581. CPACK_CONFIG_DL_STR)
  582. cpack_append_option_set_command(
  583. CPACK_DOWNLOAD_ALL
  584. CPACK_CONFIG_DL_STR)
  585. IF (${CPACK_DOWNLOAD_ALL} AND NOT ${CPACK_DOWNLOAD_NO_ADD_REMOVE})
  586. SET(CPACK_DOWNLOAD_ADD_REMOVE ON)
  587. ENDIF (${CPACK_DOWNLOAD_ALL} AND NOT ${CPACK_DOWNLOAD_NO_ADD_REMOVE})
  588. SET(CPACK_ADD_REMOVE ${CPACK_DOWNLOAD_ADD_REMOVE})
  589. cpack_append_option_set_command(
  590. CPACK_ADD_REMOVE
  591. CPACK_CONFIG_DL_STR)
  592. FILE(APPEND "${CPACK_OUTPUT_CONFIG_FILE}" "${CPACK_CONFIG_DL_STR}")
  593. ENDMACRO(cpack_configure_downloads)
  594. # Macro for setting values if a user did not overwrite them
  595. MACRO(cpack_set_if_not_set name value)
  596. IF(NOT DEFINED "${name}")
  597. SET(${name} "${value}")
  598. ENDIF(NOT DEFINED "${name}")
  599. ENDMACRO(cpack_set_if_not_set)
  600. # Macro to encode variables for the configuration file
  601. # find any varable that stars with CPACK and create a variable
  602. # _CPACK_OTHER_VARIABLES_ that contains SET commands for
  603. # each cpack variable. _CPACK_OTHER_VARIABLES_ is then
  604. # used as an @ replacment in configure_file for the CPackConfig.
  605. MACRO(cpack_encode_variables)
  606. SET(_CPACK_OTHER_VARIABLES_)
  607. GET_CMAKE_PROPERTY(res VARIABLES)
  608. FOREACH(var ${res})
  609. IF("xxx${var}" MATCHES "xxxCPACK")
  610. SET(_CPACK_OTHER_VARIABLES_
  611. "${_CPACK_OTHER_VARIABLES_}\nSET(${var} \"${${var}}\")")
  612. ENDIF("xxx${var}" MATCHES "xxxCPACK")
  613. ENDFOREACH(var ${res})
  614. ENDMACRO(cpack_encode_variables)
  615. # Set the package name
  616. cpack_set_if_not_set(CPACK_PACKAGE_NAME "${CMAKE_PROJECT_NAME}")
  617. cpack_set_if_not_set(CPACK_PACKAGE_VERSION_MAJOR "0")
  618. cpack_set_if_not_set(CPACK_PACKAGE_VERSION_MINOR "1")
  619. cpack_set_if_not_set(CPACK_PACKAGE_VERSION_PATCH "1")
  620. cpack_set_if_not_set(CPACK_PACKAGE_VERSION
  621. "${CPACK_PACKAGE_VERSION_MAJOR}.${CPACK_PACKAGE_VERSION_MINOR}.${CPACK_PACKAGE_VERSION_PATCH}")
  622. cpack_set_if_not_set(CPACK_PACKAGE_VENDOR "Humanity")
  623. cpack_set_if_not_set(CPACK_PACKAGE_DESCRIPTION_SUMMARY
  624. "${CMAKE_PROJECT_NAME} built using CMake")
  625. cpack_set_if_not_set(CPACK_PACKAGE_DESCRIPTION_FILE
  626. "${CMAKE_ROOT}/Templates/CPack.GenericDescription.txt")
  627. cpack_set_if_not_set(CPACK_RESOURCE_FILE_LICENSE
  628. "${CMAKE_ROOT}/Templates/CPack.GenericLicense.txt")
  629. cpack_set_if_not_set(CPACK_RESOURCE_FILE_README
  630. "${CMAKE_ROOT}/Templates/CPack.GenericDescription.txt")
  631. cpack_set_if_not_set(CPACK_RESOURCE_FILE_WELCOME
  632. "${CMAKE_ROOT}/Templates/CPack.GenericWelcome.txt")
  633. cpack_set_if_not_set(CPACK_MODULE_PATH "${CMAKE_MODULE_PATH}")
  634. IF(CPACK_NSIS_MODIFY_PATH)
  635. SET(CPACK_NSIS_MODIFY_PATH ON)
  636. ENDIF(CPACK_NSIS_MODIFY_PATH)
  637. SET(__cpack_system_name ${CMAKE_SYSTEM_NAME})
  638. IF(${__cpack_system_name} MATCHES Windows)
  639. IF(CMAKE_CL_64)
  640. SET(__cpack_system_name win64)
  641. ELSE(CMAKE_CL_64)
  642. SET(__cpack_system_name win32)
  643. ENDIF(CMAKE_CL_64)
  644. ENDIF(${__cpack_system_name} MATCHES Windows)
  645. cpack_set_if_not_set(CPACK_SYSTEM_NAME "${__cpack_system_name}")
  646. # <project>-<major>.<minor>.<patch>-<release>-<platform>.<pkgtype>
  647. cpack_set_if_not_set(CPACK_PACKAGE_FILE_NAME
  648. "${CPACK_PACKAGE_NAME}-${CPACK_PACKAGE_VERSION}-${CPACK_SYSTEM_NAME}")
  649. cpack_set_if_not_set(CPACK_PACKAGE_INSTALL_DIRECTORY
  650. "${CPACK_PACKAGE_NAME} ${CPACK_PACKAGE_VERSION}")
  651. cpack_set_if_not_set(CPACK_PACKAGE_INSTALL_REGISTRY_KEY
  652. "${CPACK_PACKAGE_NAME} ${CPACK_PACKAGE_VERSION}")
  653. cpack_set_if_not_set(CPACK_PACKAGE_DEFAULT_LOCATION "/")
  654. cpack_set_if_not_set(CPACK_PACKAGE_RELOCATABLE "true")
  655. # always force to exactly "true" or "false" for CPack.Info.plist.in:
  656. if(CPACK_PACKAGE_RELOCATABLE)
  657. set(CPACK_PACKAGE_RELOCATABLE "true")
  658. else(CPACK_PACKAGE_RELOCATABLE)
  659. set(CPACK_PACKAGE_RELOCATABLE "false")
  660. endif(CPACK_PACKAGE_RELOCATABLE)
  661. macro(cpack_check_file_exists file description)
  662. if(NOT EXISTS "${file}")
  663. message(SEND_ERROR "CPack ${description} file: \"${file}\" could not be found.")
  664. endif(NOT EXISTS "${file}")
  665. endmacro(cpack_check_file_exists)
  666. cpack_check_file_exists("${CPACK_PACKAGE_DESCRIPTION_FILE}" "package description")
  667. cpack_check_file_exists("${CPACK_RESOURCE_FILE_LICENSE}" "license resource")
  668. cpack_check_file_exists("${CPACK_RESOURCE_FILE_README}" "readme resource")
  669. cpack_check_file_exists("${CPACK_RESOURCE_FILE_WELCOME}" "welcome resource")
  670. macro(cpack_optional_append _list _cond _item)
  671. if(${_cond})
  672. set(${_list} ${${_list}} ${_item})
  673. endif(${_cond})
  674. endmacro(cpack_optional_append _list _cond _item)
  675. # Provide options to choose generators
  676. # we might check here if the required tools for the generates exist
  677. # and set the defaults according to the results
  678. if(NOT CPACK_GENERATOR)
  679. if(UNIX)
  680. if(CYGWIN)
  681. option(CPACK_BINARY_CYGWIN "Enable to build Cygwin binary packages" ON)
  682. else(CYGWIN)
  683. if(APPLE)
  684. option(CPACK_BINARY_BUNDLE "Enable to build OSX bundles" OFF)
  685. option(CPACK_BINARY_DRAGNDROP "Enable to build OSX Drag And Drop package" OFF)
  686. option(CPACK_BINARY_PACKAGEMAKER "Enable to build PackageMaker packages" ON)
  687. option(CPACK_BINARY_OSXX11 "Enable to build OSX X11 packages" OFF)
  688. else(APPLE)
  689. option(CPACK_BINARY_TZ "Enable to build TZ packages" ON)
  690. endif(APPLE)
  691. option(CPACK_BINARY_STGZ "Enable to build STGZ packages" ON)
  692. option(CPACK_BINARY_TGZ "Enable to build TGZ packages" ON)
  693. option(CPACK_BINARY_TBZ2 "Enable to build TBZ2 packages" OFF)
  694. option(CPACK_BINARY_DEB "Enable to build Debian packages" OFF)
  695. option(CPACK_BINARY_RPM "Enable to build RPM packages" OFF)
  696. option(CPACK_BINARY_NSIS "Enable to build NSIS packages" OFF)
  697. endif(CYGWIN)
  698. else(UNIX)
  699. option(CPACK_BINARY_NSIS "Enable to build NSIS packages" ON)
  700. option(CPACK_BINARY_ZIP "Enable to build ZIP packages" OFF)
  701. endif(UNIX)
  702. cpack_optional_append(CPACK_GENERATOR CPACK_BINARY_BUNDLE Bundle)
  703. cpack_optional_append(CPACK_GENERATOR CPACK_BINARY_DRAGNDROP DragNDrop)
  704. cpack_optional_append(CPACK_GENERATOR CPACK_BINARY_PACKAGEMAKER PackageMaker)
  705. cpack_optional_append(CPACK_GENERATOR CPACK_BINARY_OSXX11 OSXX11)
  706. cpack_optional_append(CPACK_GENERATOR CPACK_BINARY_CYGWIN CygwinBinary)
  707. cpack_optional_append(CPACK_GENERATOR CPACK_BINARY_DEB DEB)
  708. cpack_optional_append(CPACK_GENERATOR CPACK_BINARY_RPM RPM)
  709. cpack_optional_append(CPACK_GENERATOR CPACK_BINARY_NSIS NSIS)
  710. cpack_optional_append(CPACK_GENERATOR CPACK_BINARY_STGZ STGZ)
  711. cpack_optional_append(CPACK_GENERATOR CPACK_BINARY_TGZ TGZ)
  712. cpack_optional_append(CPACK_GENERATOR CPACK_BINARY_TBZ2 TBZ2)
  713. cpack_optional_append(CPACK_GENERATOR CPACK_BINARY_TZ TZ)
  714. cpack_optional_append(CPACK_GENERATOR CPACK_BINARY_ZIP ZIP)
  715. endif(NOT CPACK_GENERATOR)
  716. # Provide options to choose source generators
  717. if(NOT CPACK_SOURCE_GENERATOR)
  718. if(UNIX)
  719. if(CYGWIN)
  720. option(CPACK_SOURCE_CYGWIN "Enable to build Cygwin source packages" ON)
  721. else(CYGWIN)
  722. option(CPACK_SOURCE_TBZ2 "Enable to build TBZ2 source packages" ON)
  723. option(CPACK_SOURCE_TGZ "Enable to build TGZ source packages" ON)
  724. option(CPACK_SOURCE_TZ "Enable to build TZ source packages" ON)
  725. option(CPACK_SOURCE_ZIP "Enable to build ZIP source packages" OFF)
  726. endif(CYGWIN)
  727. else(UNIX)
  728. option(CPACK_SOURCE_ZIP "Enable to build ZIP source packages" ON)
  729. endif(UNIX)
  730. cpack_optional_append(CPACK_SOURCE_GENERATOR CPACK_SOURCE_CYGWIN CygwinSource)
  731. cpack_optional_append(CPACK_SOURCE_GENERATOR CPACK_SOURCE_TGZ TGZ)
  732. cpack_optional_append(CPACK_SOURCE_GENERATOR CPACK_SOURCE_TBZ2 TBZ2)
  733. cpack_optional_append(CPACK_SOURCE_GENERATOR CPACK_SOURCE_TZ TZ)
  734. cpack_optional_append(CPACK_SOURCE_GENERATOR CPACK_SOURCE_ZIP ZIP)
  735. endif(NOT CPACK_SOURCE_GENERATOR)
  736. # mark the above options as advanced
  737. mark_as_advanced(CPACK_BINARY_CYGWIN CPACK_BINARY_PACKAGEMAKER CPACK_BINARY_OSXX11
  738. CPACK_BINARY_STGZ CPACK_BINARY_TGZ CPACK_BINARY_TBZ2
  739. CPACK_BINARY_DEB CPACK_BINARY_RPM CPACK_BINARY_TZ
  740. CPACK_BINARY_NSIS CPACK_BINARY_ZIP CPACK_BINARY_BUNDLE
  741. CPACK_SOURCE_CYGWIN CPACK_SOURCE_TBZ2 CPACK_SOURCE_TGZ
  742. CPACK_SOURCE_TZ CPACK_SOURCE_ZIP CPACK_BINARY_DRAGNDROP)
  743. # Set some other variables
  744. cpack_set_if_not_set(CPACK_INSTALL_CMAKE_PROJECTS
  745. "${CMAKE_BINARY_DIR};${CMAKE_PROJECT_NAME};ALL;/")
  746. cpack_set_if_not_set(CPACK_CMAKE_GENERATOR "${CMAKE_GENERATOR}")
  747. cpack_set_if_not_set(CPACK_TOPLEVEL_TAG "${CPACK_SYSTEM_NAME}")
  748. cpack_set_if_not_set(CPACK_NSIS_DISPLAY_NAME "${CPACK_PACKAGE_INSTALL_DIRECTORY}")
  749. cpack_set_if_not_set(CPACK_NSIS_PACKAGE_NAME "${CPACK_PACKAGE_INSTALL_DIRECTORY}")
  750. cpack_set_if_not_set(CPACK_OUTPUT_CONFIG_FILE
  751. "${CMAKE_BINARY_DIR}/CPackConfig.cmake")
  752. cpack_set_if_not_set(CPACK_SOURCE_OUTPUT_CONFIG_FILE
  753. "${CMAKE_BINARY_DIR}/CPackSourceConfig.cmake")
  754. cpack_set_if_not_set(CPACK_SET_DESTDIR OFF)
  755. cpack_set_if_not_set(CPACK_INSTALL_PREFIX "${CMAKE_INSTALL_PREFIX}")
  756. cpack_set_if_not_set(CPACK_NSIS_INSTALLER_ICON_CODE "")
  757. cpack_set_if_not_set(CPACK_NSIS_INSTALLER_MUI_ICON_CODE "")
  758. IF(DEFINED CPACK_COMPONENTS_ALL)
  759. IF(CPACK_MONOLITHIC_INSTALL)
  760. MESSAGE("CPack warning: both CPACK_COMPONENTS_ALL and CPACK_MONOLITHIC_INSTALL have been set.\nDefaulting to a monolithic installation.")
  761. SET(CPACK_COMPONENTS_ALL)
  762. ELSE(CPACK_MONOLITHIC_INSTALL)
  763. # The user has provided the set of components to be installed as
  764. # part of a component-based installation; trust her.
  765. SET(CPACK_COMPONENTS_ALL_SET_BY_USER TRUE)
  766. ENDIF(CPACK_MONOLITHIC_INSTALL)
  767. ELSE(DEFINED CPACK_COMPONENTS_ALL)
  768. # If the user has not specifically requested a monolithic installer
  769. # but has specified components in various "install" commands, tell
  770. # CPack about those components.
  771. IF(NOT CPACK_MONOLITHIC_INSTALL)
  772. GET_CMAKE_PROPERTY(CPACK_COMPONENTS_ALL COMPONENTS)
  773. LIST(LENGTH CPACK_COMPONENTS_ALL CPACK_COMPONENTS_LEN)
  774. IF(CPACK_COMPONENTS_LEN EQUAL 1)
  775. # Only one component: this is not a component-based installation
  776. # (at least, it isn't a component-based installation, but may
  777. # become one later if the user uses the cpack_add_* commands).
  778. SET(CPACK_COMPONENTS_ALL)
  779. ENDIF(CPACK_COMPONENTS_LEN EQUAL 1)
  780. SET(CPACK_COMPONENTS_LEN)
  781. ENDIF(NOT CPACK_MONOLITHIC_INSTALL)
  782. ENDIF(DEFINED CPACK_COMPONENTS_ALL)
  783. # CMake always generates a component named "Unspecified", which is
  784. # used to install everything that doesn't have an explicitly-provided
  785. # component. Since these files should always be installed, we'll make
  786. # them hidden and required.
  787. set(CPACK_COMPONENT_UNSPECIFIED_HIDDEN TRUE)
  788. set(CPACK_COMPONENT_UNSPECIFIED_REQUIRED TRUE)
  789. cpack_encode_variables()
  790. configure_file("${cpack_input_file}" "${CPACK_OUTPUT_CONFIG_FILE}" @ONLY IMMEDIATE)
  791. # Generate source file
  792. cpack_set_if_not_set(CPACK_SOURCE_INSTALLED_DIRECTORIES
  793. "${CMAKE_SOURCE_DIR};/")
  794. cpack_set_if_not_set(CPACK_SOURCE_TOPLEVEL_TAG "${CPACK_SYSTEM_NAME}-Source")
  795. cpack_set_if_not_set(CPACK_SOURCE_PACKAGE_FILE_NAME
  796. "${CPACK_PACKAGE_NAME}-${CPACK_PACKAGE_VERSION}-Source")
  797. cpack_set_if_not_set(CPACK_SOURCE_IGNORE_FILES
  798. "/CVS/;/\\\\\\\\.svn/;\\\\\\\\.swp$;\\\\\\\\.#;/#")
  799. SET(CPACK_INSTALL_CMAKE_PROJECTS "${CPACK_SOURCE_INSTALL_CMAKE_PROJECTS}")
  800. SET(CPACK_INSTALLED_DIRECTORIES "${CPACK_SOURCE_INSTALLED_DIRECTORIES}")
  801. SET(CPACK_GENERATOR "${CPACK_SOURCE_GENERATOR}")
  802. SET(CPACK_TOPLEVEL_TAG "${CPACK_SOURCE_TOPLEVEL_TAG}")
  803. SET(CPACK_PACKAGE_FILE_NAME "${CPACK_SOURCE_PACKAGE_FILE_NAME}")
  804. SET(CPACK_IGNORE_FILES "${CPACK_SOURCE_IGNORE_FILES}")
  805. SET(CPACK_STRIP_FILES "${CPACK_SOURCE_STRIP_FILES}")
  806. cpack_encode_variables()
  807. configure_file("${cpack_source_input_file}"
  808. "${CPACK_SOURCE_OUTPUT_CONFIG_FILE}" @ONLY IMMEDIATE)