@@ -82,6 +82,18 @@ set(CUSTOM_TEST_DIR "${CMAKE_SOURCE_DIR}/test")
82
82
set (CUSTOM_TEST_SCRIPTS_DIR "${CUSTOM_TEST_DIR} /scripts" )
83
83
set (CUSTOM_SHELL_SHABANG "#!/bin/sh -e" )
84
84
85
+ # cpack variables
86
+ set (CPACK_GENERATOR "ZIP" )
87
+ set (CPACK_STRIP_FILES true )
88
+ set (CPACK_PACKAGE_NAME "${CMAKE_PROJECT_NAME} " )
89
+ set (CPACK_PACKAGE_FILE_NAME "${CMAKE_PROJECT_NAME} -${direwolf_VERSION} _${CMAKE_SYSTEM_PROCESSOR} " )
90
+ set (CPACK_PACKAGE_CONTACT "https://github.com/wb2osz/direwolf" )
91
+ set (CPACK_PACKAGE_DESCRIPTION_SUMMARY "Dire Wolf is a software soundcard AX.25 packet modem/TNC and APRS encoder/decoder" )
92
+ set (CPACK_PACKAGE_DESCRIPTION_FILE "${CMAKE_SOURCE_DIR} /README.md" )
93
+ set (CPACK_RESOURCE_FILE_README "${CMAKE_SOURCE_DIR} /README.md" )
94
+ set (CPACK_RESOURCE_FILE_LICENSE "${CMAKE_SOURCE_DIR} /LICENSE" )
95
+ set (CPACK_SOURCE_IGNORE_FILES "${PROJECT_BINARY_DIR} ;/.git/;.gitignore;menu.yml;.travis.yml;.appveyor.yml;default.nix;.envrc;TODOs.org;/.scripts/" )
96
+
85
97
# if we don't set build_type
86
98
if (NOT DEFINED CMAKE_BUILD_TYPE OR "${CMAKE_BUILD_TYPE} " STREQUAL "" )
87
99
set (CMAKE_BUILD_TYPE Release CACHE STRING "Build type" FORCE)
@@ -152,6 +164,23 @@ elseif (C_GCC)
152
164
set (CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -fmax-errors=1" )
153
165
endif ()
154
166
167
+ # set installation directories
168
+ if (WIN32 OR CYGWIN )
169
+ set (INSTALL_BIN_DIR "." )
170
+ set (INSTALL_DOC_DIR "doc" )
171
+ set (INSTALL_CONF_DIR "." )
172
+ set (INSTALL_SCRIPTS_DIR "scripts" )
173
+ set (INSTALL_MAN_DIR "man" )
174
+ set (INSTALL_DATA_DIR "data" )
175
+ else ()
176
+ set (INSTALL_BIN_DIR "bin" )
177
+ set (INSTALL_DOC_DIR "share/doc/${CMAKE_PROJECT_NAME} " )
178
+ set (INSTALL_CONF_DIR "${INSTALL_DOC_DIR} /conf" )
179
+ set (INSTALL_SCRIPTS_DIR "${INSTALL_DOC_DIR} /scripts" )
180
+ set (INSTALL_MAN_DIR "share/man/man1" )
181
+ set (INSTALL_DATA_DIR "share/${PROJECT_NAME} " )
182
+ endif (WIN32 OR CYGWIN )
183
+
155
184
# requirements
156
185
set (THREADS_PREFER_PTHREAD_FLAG ON )
157
186
find_package (Threads REQUIRED)
@@ -224,9 +253,9 @@ add_subdirectory(scripts)
224
253
add_subdirectory (conf)
225
254
226
255
# install basic docs
227
- install (FILES ${CMAKE_SOURCE_DIR} /CHANGES.md DESTINATION share/ doc / ${CMAKE_PROJECT_NAME } )
228
- install (FILES ${CMAKE_SOURCE_DIR} /LICENSE DESTINATION share/ doc / ${CMAKE_PROJECT_NAME } )
229
- install (FILES ${CMAKE_SOURCE_DIR} /external/LICENSE DESTINATION share/ doc / ${CMAKE_PROJECT_NAME } /external)
256
+ install (FILES ${CMAKE_SOURCE_DIR} /CHANGES.md DESTINATION ${INSTALL_DOC_DIR } )
257
+ install (FILES ${CMAKE_SOURCE_DIR} /LICENSE DESTINATION ${INSTALL_DOC_DIR } )
258
+ install (FILES ${CMAKE_SOURCE_DIR} /external/LICENSE DESTINATION ${INSTALL_DOC_DIR } /external)
230
259
add_subdirectory (doc )
231
260
add_subdirectory (man)
232
261
0 commit comments