Book a Demo!
CoCalc Logo Icon
StoreFeaturesDocsShareSupportNewsAboutPoliciesSign UpSign In
Kitware
GitHub Repository: Kitware/CMake
Path: blob/master/Tests/CPackInnoSetupGenerator/CMakeLists.txt
3150 views
1
cmake_minimum_required(VERSION 3.13)
2
3
project(CPackInnoSetupGenerator VERSION 42.0 HOMEPAGE_URL "https://www.example.com")
4
5
add_executable(hello main.c)
6
file(MAKE_DIRECTORY ${CMAKE_CURRENT_BINARY_DIR}/empty)
7
8
install(TARGETS hello DESTINATION / COMPONENT application)
9
install(DIRECTORY ${CMAKE_CURRENT_BINARY_DIR}/empty DESTINATION / COMPONENT extras)
10
install(FILES my_bitmap.bmp DESTINATION awesome COMPONENT extras)
11
install(FILES my_file.txt DESTINATION / COMPONENT hidden_component)
12
install(FILES my_file.txt DESTINATION / COMPONENT hidden_component2)
13
14
set(CPACK_GENERATOR "INNOSETUP")
15
16
set(CPACK_PACKAGE_NAME "Hello, World!") # Test constant escape (like {cm:...}, see code documentation)
17
set(CPACK_PACKAGE_VENDOR "Sheldon Cooper")
18
set(CPACK_PACKAGE_INSTALL_DIRECTORY "hello_world")
19
set(CPACK_PACKAGE_INSTALL_REGISTRY_KEY "hello_world")
20
set(CPACK_PACKAGE_FILE_NAME "hello_world_setup")
21
set(CPACK_SYSTEM_NAME "win32")
22
set(CPACK_PACKAGE_ICON "${CMAKE_CURRENT_SOURCE_DIR}/my_bitmap.bmp")
23
set(CPACK_VERBATIM_VARIABLES ON)
24
set(CPACK_PACKAGE_EXECUTABLES "hello" "Hello, World!")
25
set(CPACK_CREATE_DESKTOP_LINKS hello)
26
27
set(CPACK_INNOSETUP_INSTALL_ROOT "{autopf}\\Sheldon Cooper")
28
set(CPACK_INNOSETUP_PROGRAM_MENU_FOLDER ".")
29
set(CPACK_INNOSETUP_IGNORE_LICENSE_PAGE ON)
30
set(CPACK_INNOSETUP_IGNORE_README_PAGE OFF) # Test if only readme page is shown
31
set(CPACK_INNOSETUP_SETUP_AppComments ON) # Test if CPACK_INNOSETUP_USE_CMAKE_BOOL_FORMAT works
32
set(CPACK_INNOSETUP_CUSTOM_INSTALL_INSTRUCTIONS "extras/empty"
33
"Name: \"{userdocs}\\empty\"\; Check: ReturnTrue\; Components: accessories\\extras")
34
set(CPACK_INNOSETUP_MENU_LINKS "https://www.example.com" "Web"
35
"my_file.txt" "Text")
36
set(CPACK_INNOSETUP_RUN_EXECUTABLES hello)
37
set(CPACK_INNOSETUP_CREATE_UNINSTALL_LINK ON)
38
# Test if this macro is available in the code file below containing the check function
39
set(CPACK_INNOSETUP_DEFINE_PascalMacro "end;")
40
set(CPACK_INNOSETUP_CODE_FILES "${CMAKE_CURRENT_SOURCE_DIR}/Code.pas")
41
set(CPACK_INNOSETUP_EXECUTABLE "ISCC.exe")
42
43
include(CPackComponent)
44
45
cpack_add_install_type(basic DISPLAY_NAME "Basic installation")
46
cpack_add_install_type(full DISPLAY_NAME "\"Large\" installation") # Test double quote syntax
47
cpack_add_component_group(accessories DISPLAY_NAME "Accessories")
48
49
cpack_add_component(application DISPLAY_NAME "Application" INSTALL_TYPES basic full REQUIRED)
50
cpack_add_component(extras DISPLAY_NAME "Additional components" INSTALL_TYPES full GROUP accessories)
51
cpack_add_component(hidden_component HIDDEN)
52
cpack_add_component(hidden_component2 HIDDEN DISABLED)
53
set(CPACK_INNOSETUP_extras_INSTALL_DIRECTORY "{userdocs}")
54
55
include(CPack)
56
57