1- if ( UNIX )
2- if ( EXISTS " ${CMAKE_ROOT} /Modules/CPack.cmake " )
3- set (CPACK_PACKAGE_VENDOR "OpenXRay Team" )
4- set (CPACK_PACKAGE_CONTACT "OpenXRay <[email protected] >" ) 5- set (CPACK_PACKAGE_DESCRIPTION ${CMAKE_PROJECT_DESCRIPTION} )
1+ set (CPACK_PACKAGE_VENDOR "OpenXRay Team" )
2+ set (CPACK_PACKAGE_CONTACT "OpenXRay <[email protected] > ")
3+ set (CPACK_PACKAGE_DESCRIPTION ${CMAKE_PROJECT_DESCRIPTION} )
4+
5+ set (CPACK_PACKAGE_FILE_NAME "openxray- ${CMAKE_PROJECT_VERSION} - ${CMAKE_SYSTEM_PROCESSOR} " )
66
7- set (CPACK_PACKAGE_FILE_NAME "openxray-${CMAKE_PROJECT_VERSION} -${CMAKE_SYSTEM_PROCESSOR} " )
7+ set (CPACK_STRIP_FILES TRUE )
8+ set (CPACK_SOURCE_IGNORE_FILES "/.gitattributes" )
9+ set (CPACK_RESOURCE_FILE_README ${PROJECT_SOURCE_DIR} /README.md )
10+ set (CPACK_RESOURCE_FILE_LICENSE ${PROJECT_SOURCE_DIR} /License.txt)
811
9- set (CPACK_STRIP_FILES TRUE )
10- set (CPACK_SOURCE_IGNORE_FILES "/.gitattributes" )
11- set (CPACK_RESOURCE_FILE_README ${PROJECT_SOURCE_DIR} /README.md )
12- set (CPACK_RESOURCE_FILE_LICENSE ${PROJECT_SOURCE_DIR} /License.txt)
12+ if (UNIX )
13+ # Try to find specific OS files to determine type of linux distribution
14+ find_file (FEDORA_FOUND fedora-release PATHS /etc)
15+ find_file (REDHAT_FOUND redhat-release inittab.RH PATHS /etc)
16+ find_file (CENTOS_FOUND centos-release PATHS /etc)
17+ # If we found debian then we don't need to check further for ubuntu
18+ # as it uses debian core.
19+ find_file (DEBIAN_FOUND debian_version debconf.conf PATHS /etc)
20+
21+ # --------------------------------------------------
22+ # Uninstall target
23+ # --------------------------------------------------
24+ # To clean system folder from libraries and binaries
25+ # that was installed with `sudo make install`
26+ # just run `sudo make uninstall`
27+ if (NOT TARGET uninstall)
28+ configure_file (
29+ "${CMAKE_CURRENT_SOURCE_DIR} /cmake/cmake_uninstall.cmake.in"
30+ "${CMAKE_CURRENT_BINARY_DIR} /cmake_uninstall.cmake"
31+ IMMEDIATE @ONLY)
32+
33+ add_custom_target (uninstall COMMAND ${CMAKE_COMMAND} -P ${CMAKE_CURRENT_BINARY_DIR} /cmake_uninstall.cmake)
34+ endif ()
1335
36+ if (exists "${CMAKE_ROOT} /Modules/CPack.cmake" )
1437 # --- SELECT PROPER CPACK GENERATOR ---
1538 if (DEBIAN_FOUND)
1639 set (CPACK_GENERATOR DEB)
@@ -37,12 +60,3 @@ if (UNIX)
3760 include (CPack)
3861 endif ()
3962endif ()
40-
41- # TODO: Need to be implemented in future
42- if (WIN32 )
43- #set(CPACK_GENERATOR NSIS)
44- endif ()
45-
46- if (APPLE )
47- #set(CPACK_GENERATOR "DRAGNDROP")
48- endif ()
0 commit comments