Merge pull request #2851 from ilammy/x11-cliprdr/improve-format-support
[platform/upstream/freerdp.git] / CMakeCPack.cmake
1
2 # Generate .txt license file for CPack (PackageMaker requires a file extension)
3 configure_file(${CMAKE_CURRENT_SOURCE_DIR}/LICENSE ${CMAKE_CURRENT_BINARY_DIR}/LICENSE.txt @ONLY)
4
5 SET(CPACK_BINARY_ZIP "ON")
6
7 # Workaround to remove c++ compiler macros and defines for Eclipse.
8 # If c++ macros/defines are set __cplusplus is also set which causes
9 # problems when compiling freerdp/jni. To prevent this problem we set the macros to "".
10
11 if (ANDROID AND CMAKE_EXTRA_GENERATOR STREQUAL "Eclipse CDT4")
12         set(CMAKE_EXTRA_GENERATOR_CXX_SYSTEM_DEFINED_MACROS "")
13         message(STATUS "Disabled CXX system defines for eclipse (workaround).")
14 endif()
15
16 set(CPACK_SOURCE_IGNORE_FILES "/\\\\.git/;/\\\\.gitignore;/CMakeCache.txt")
17
18 if(NOT WIN32)
19         if(APPLE AND (NOT IOS))
20
21                 if(WITH_SERVER)
22                         set(CPACK_PACKAGE_EXECUTABLES ${CPACK_PACKAGE_EXECUTABLES} "mfreerdp-server")
23                 endif()
24         endif()
25     
26         if(WITH_X11)
27                 set(CPACK_PACKAGE_EXECUTABLES "xfreerdp")
28
29                 if(WITH_SERVER)
30                         set(CPACK_PACKAGE_EXECUTABLES ${CPACK_PACKAGE_EXECUTABLES} "xfreerdp-server")
31                 endif()
32     endif()
33 endif()
34
35 set(CPACK_SYSTEM_NAME "${CMAKE_SYSTEM_NAME}-${CMAKE_SYSTEM_PROCESSOR}")
36 set(CPACK_TOPLEVEL_TAG "${CMAKE_SYSTEM_NAME}-${CMAKE_SYSTEM_PROCESSOR}")
37
38 string(TOLOWER ${CMAKE_PROJECT_NAME} CMAKE_PROJECT_NAME_lower)
39 set(CPACK_PACKAGE_FILE_NAME "${CMAKE_PROJECT_NAME_lower}-${FREERDP_VERSION_FULL}-${CPACK_SYSTEM_NAME}")
40 set(CPACK_SOURCE_PACKAGE_FILE_NAME "${CMAKE_PROJECT_NAME_lower}-${FREERDP_VERSION_FULL}-${CPACK_SYSTEM_NAME}")
41
42 set(CPACK_PACKAGE_NAME "FreeRDP")
43 set(CPACK_PACKAGE_VENDOR "FreeRDP")
44 set(CPACK_PACKAGE_VERSION ${FREERDP_VERSION_FULL})
45 set(CPACK_PACKAGE_VERSION_MAJOR ${FREERDP_VERSION_MAJOR})
46 set(CPACK_PACKAGE_VERSION_MINOR ${FREERDP_VERSION_MINOR})
47 set(CPACK_PACKAGE_VERSION_PATCH ${FREERDP_VERSION_REVISION})
48 SET(CPACK_PACKAGE_DESCRIPTION_SUMMARY "FreeRDP: A Remote Desktop Protocol Implementation")
49
50 set(CPACK_PACKAGE_CONTACT "Marc-Andre Moreau")
51 set(CPACK_DEBIAN_PACKAGE_MAINTAINER "marcandre.moreau@gmail.com")
52 set(CPACK_DEBIAN_ARCHITECTURE ${CMAKE_SYSTEM_PROCESSOR})
53
54 set(CPACK_PACKAGE_INSTALL_DIRECTORY "FreeRDP")
55 set(CPACK_PACKAGE_DESCRIPTION_FILE "${CMAKE_CURRENT_BINARY_DIR}/LICENSE.txt")
56 set(CPACK_RESOURCE_FILE_LICENSE "${CMAKE_CURRENT_BINARY_DIR}/LICENSE.txt")
57
58 set(CPACK_NSIS_MODIFY_PATH ON)
59 set(CPACK_PACKAGE_ICON "${CMAKE_SOURCE_DIR}/resources\\\\FreeRDP_Install.bmp")
60 set(CPACK_NSIS_MUI_ICON "${CMAKE_SOURCE_DIR}/resources\\\\FreeRDP_Icon_96px.ico")
61 set(CPACK_NSIS_MUI_UNICON "${CMAKE_SOURCE_DIR}/resource\\\\FreeRDP_Icon_96px.ico")
62
63 set(CPACK_COMPONENTS_ALL client server libraries headers symbols tools)
64
65 if(MSVC)
66         if(MSVC_RUNTIME STREQUAL "dynamic")
67                 set(CMAKE_INSTALL_SYSTEM_RUNTIME_LIBS_SKIP TRUE)
68                 include(InstallRequiredSystemLibraries)
69
70                 install(PROGRAMS ${CMAKE_INSTALL_SYSTEM_RUNTIME_LIBS}
71                         DESTINATION ${CMAKE_INSTALL_BINDIR}
72                         COMPONENT libraries)
73         endif()
74 endif()
75
76 set(CPACK_COMPONENT_CLIENT_DISPLAY_NAME "Client")
77 set(CPACK_COMPONENT_CLIENT_GROUP "Applications")
78
79 set(CPACK_COMPONENT_SERVER_DISPLAY_NAME "Server")
80 set(CPACK_COMPONENT_SERVER_GROUP "Applications")
81
82 set(CPACK_COMPONENT_LIBRARIES_DISPLAY_NAME "Libraries")
83 set(CPACK_COMPONENT_LIBRARIES_GROUP "Runtime")
84
85 set(CPACK_COMPONENT_HEADERS_DISPLAY_NAME "Headers")
86 set(CPACK_COMPONENT_HEADERS_GROUP "Development")
87
88 set(CPACK_COMPONENT_SYMBOLS_DISPLAY_NAME "Symbols")
89 set(CPACK_COMPONENT_SYMBOLS_GROUP "Development")
90
91 set(CPACK_COMPONENT_TOOLS_DISPLAY_NAME "Tools")
92 set(CPACK_COMPONENT_TOOLS_GROUP "Applications")
93
94 set(CPACK_COMPONENT_GROUP_RUNTIME_DESCRIPTION "Runtime")
95 set(CPACK_COMPONENT_GROUP_APPLICATIONS_DESCRIPTION "Applications")
96 set(CPACK_COMPONENT_GROUP_DEVELOPMENT_DESCRIPTION "Development")
97
98 configure_file("${CMAKE_SOURCE_DIR}/CMakeCPackOptions.cmake.in"
99         "${CMAKE_BINARY_DIR}/CMakeCPackOptions.cmake" @ONLY)
100 set(CPACK_PROJECT_CONFIG_FILE "${CMAKE_BINARY_DIR}/CMakeCPackOptions.cmake")
101
102 include(CPack)