2012-10-03 18:08:49 +04:00
|
|
|
cmake_minimum_required(VERSION 2.8)
|
|
|
|
|
|
|
|
project(CPackWiXGenerator)
|
|
|
|
|
|
|
|
add_library(mylib mylib.cpp)
|
|
|
|
|
2013-10-23 14:14:39 +04:00
|
|
|
add_executable(my-libapp mylibapp.cpp)
|
|
|
|
target_link_libraries(my-libapp mylib)
|
|
|
|
|
|
|
|
add_executable(my-other-app myotherapp.cpp)
|
2012-10-03 18:08:49 +04:00
|
|
|
|
|
|
|
install(TARGETS mylib
|
|
|
|
ARCHIVE
|
|
|
|
DESTINATION lib
|
|
|
|
COMPONENT libraries)
|
|
|
|
|
2013-11-20 00:38:09 +04:00
|
|
|
install(TARGETS my-libapp
|
2012-10-03 18:08:49 +04:00
|
|
|
RUNTIME
|
|
|
|
DESTINATION bin
|
|
|
|
COMPONENT applications)
|
|
|
|
|
2013-11-20 00:38:09 +04:00
|
|
|
install(TARGETS my-other-app
|
|
|
|
RUNTIME
|
|
|
|
DESTINATION bin
|
|
|
|
COMPONENT applications2)
|
|
|
|
|
2012-10-03 18:08:49 +04:00
|
|
|
install(FILES mylib.h "file with spaces.h"
|
|
|
|
DESTINATION include
|
|
|
|
COMPONENT headers)
|
|
|
|
|
|
|
|
set(CPACK_GENERATOR "WIX")
|
|
|
|
|
|
|
|
set(CPACK_PACKAGE_NAME "MyLib")
|
|
|
|
set(CPACK_PACKAGE_VENDOR "CMake.org")
|
|
|
|
set(CPACK_PACKAGE_CONTACT "somebody@cmake.org")
|
|
|
|
set(CPACK_PACKAGE_DESCRIPTION_SUMMARY
|
|
|
|
"MyLib - CPack Component Installation Example")
|
|
|
|
|
|
|
|
set(CPACK_PACKAGE_VERSION_MAJOR "1")
|
|
|
|
set(CPACK_PACKAGE_VERSION_MINOR "0")
|
|
|
|
set(CPACK_PACKAGE_VERSION_PATCH "0")
|
|
|
|
set(CPACK_PACKAGE_INSTALL_DIRECTORY "CPack Component Example")
|
|
|
|
|
|
|
|
set(CPACK_WIX_UPGRADE_GUID "BF20CE5E-7F7C-401D-8F7C-AB45E8D170E6")
|
2013-03-01 06:09:58 +04:00
|
|
|
set(CPACK_WIX_UNINSTALL "1")
|
2013-10-23 14:14:39 +04:00
|
|
|
|
|
|
|
set(CPACK_PACKAGE_EXECUTABLES
|
|
|
|
"my-libapp" "CPack WiX Test"
|
|
|
|
"my-other-app" "Second CPack WiX Test"
|
|
|
|
)
|
2012-10-03 18:08:49 +04:00
|
|
|
|
2013-12-17 01:30:11 +04:00
|
|
|
set(CPACK_WIX_PATCH_FILE "${CMAKE_CURRENT_SOURCE_DIR}/patch.xml")
|
|
|
|
|
2013-12-26 18:23:54 +04:00
|
|
|
set(CPACK_RESOURCE_FILE_LICENSE "${CMAKE_CURRENT_SOURCE_DIR}/license.txt")
|
|
|
|
|
2012-10-03 18:08:49 +04:00
|
|
|
include(CPack)
|
|
|
|
|
|
|
|
cpack_add_install_type(Full DISPLAY_NAME "Everything")
|
|
|
|
cpack_add_install_type(Developer)
|
|
|
|
|
|
|
|
cpack_add_component_group(Runtime)
|
|
|
|
|
|
|
|
cpack_add_component_group(Development
|
|
|
|
EXPANDED
|
|
|
|
DESCRIPTION "All of the tools you'll ever need to develop software")
|
|
|
|
|
|
|
|
cpack_add_component(applications
|
2013-11-20 00:38:09 +04:00
|
|
|
REQUIRED
|
2012-10-03 18:08:49 +04:00
|
|
|
DISPLAY_NAME "MyLib Application"
|
|
|
|
DESCRIPTION "An extremely useful application that makes use of MyLib"
|
|
|
|
GROUP Runtime
|
|
|
|
INSTALL_TYPES Full)
|
|
|
|
|
2013-11-20 00:38:09 +04:00
|
|
|
cpack_add_component(applications2
|
|
|
|
DISPLAY_NAME "MyLib Extra Application"
|
|
|
|
DESCRIPTION "Another extremely useful application that makes use of MyLib"
|
|
|
|
GROUP Runtime
|
|
|
|
INSTALL_TYPES Full)
|
|
|
|
|
2012-10-03 18:08:49 +04:00
|
|
|
cpack_add_component(documentation
|
|
|
|
DISPLAY_NAME "MyLib Documentation"
|
|
|
|
DESCRIPTION "The extensive suite of MyLib Application documentation files"
|
|
|
|
GROUP Runtime
|
|
|
|
INSTALL_TYPES Full)
|
|
|
|
|
|
|
|
cpack_add_component(libraries
|
|
|
|
DISPLAY_NAME "Libraries"
|
|
|
|
DESCRIPTION "Static libraries used to build programs with MyLib"
|
|
|
|
GROUP Development
|
|
|
|
INSTALL_TYPES Developer Full)
|
|
|
|
|
|
|
|
cpack_add_component(headers
|
|
|
|
DISPLAY_NAME "C++ Headers"
|
|
|
|
DESCRIPTION "C/C++ header files for use with MyLib"
|
|
|
|
GROUP Development
|
|
|
|
DEPENDS libraries
|
|
|
|
INSTALL_TYPES Developer Full)
|