🛠️🐜 Antkeeper superbuild with dependencies included https://antkeeper.com
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

379 lines
13 KiB

5 years ago
5 years ago
5 years ago
5 years ago
5 years ago
5 years ago
5 years ago
5 years ago
5 years ago
5 years ago
5 years ago
  1. # Prevent in-source builds
  2. if(${CMAKE_SOURCE_DIR} STREQUAL ${CMAKE_BINARY_DIR})
  3. message(FATAL_ERROR "In-source builds prohibited. Call CMake from a build/<platform> directory.")
  4. endif()
  5. cmake_minimum_required(VERSION 3.7)
  6. # Create superbuild project
  7. project(antkeeper-superbuild VERSION "0.0.1")
  8. # Setup package variables
  9. set(PACKAGE_NAME ${PROJECT_NAME})
  10. set(PACKAGE_VERSION ${PROJECT_VERSION})
  11. set(PACKAGE_VERSION_MAJOR ${PROJECT_VERSION_MAJOR})
  12. set(PACKAGE_VERSION_MINOR ${PROJECT_VERSION_MINOR})
  13. set(PACKAGE_VERSION_PATCH ${PROJECT_VERSION_PATCH})
  14. get_filename_component(PACKAGE_PLATFORM ${CMAKE_BINARY_DIR} NAME CACHE)
  15. if(CMAKE_BUILD_TYPE STREQUAL "Debug")
  16. set(PACKAGE_BUILD_TYPE debug)
  17. else()
  18. set(PACKAGE_BUILD_TYPE release)
  19. endif()
  20. set(PACKAGE_FILENAME ${PACKAGE_NAME}-${PACKAGE_VERSION}-${PACKAGE_PLATFORM})
  21. set(PACKAGE_INSTALL_DIR ${CMAKE_SOURCE_DIR}/bin/${PACKAGE_BUILD_TYPE}/${PACKAGE_FILENAME})
  22. set(PACKAGE_DIST_DIR ${CMAKE_SOURCE_DIR}/dist/${PACKAGE_BUILD_TYPE})
  23. # Create output directories
  24. file(MAKE_DIRECTORY ${PACKAGE_INSTALL_DIR})
  25. file(MAKE_DIRECTORY ${PACKAGE_DIST_DIR})
  26. # Check for architecture mismatches
  27. if("${CMAKE_SIZEOF_VOID_P}" STREQUAL "4")
  28. if (PACKAGE_PLATFORM MATCHES "64$")
  29. message(FATAL_ERROR "Compiler architecture is 32-bit but target architecture is 64-bit.")
  30. endif()
  31. else()
  32. if (PACKAGE_PLATFORM MATCHES "32$")
  33. message(FATAL_ERROR "Compiler architecture is 64-bit but target architecture is 32-bit.")
  34. endif()
  35. endif()
  36. # Options
  37. set(BLENDER "blender" CACHE FILEPATH "Path to Blender executable")
  38. set(INKSCAPE "inkscape" CACHE FILEPATH "Path to Inkscape executable")
  39. # Set C++ compiler flags
  40. if(CMAKE_COMPILER_IS_GNUCC)
  41. set(CMAKE_CXX_FLAGS "-Wall -Wextra")
  42. set(CMAKE_CXX_FLAGS_DEBUG "${CMAKE_CXX_FLAGS} -g")
  43. set(CMAKE_CXX_FLAGS_RELEASE "${CMAKE_CXX_FLAGS} -O3")
  44. elseif(MSVC)
  45. set(CMAKE_CXX_FLAGS "/MP /W3 /MT /GR- /GS- /D_WIN32_WINNT=0x0501 /DWINVER=0x0501")
  46. set(CMAKE_CXX_FLAGS_DEBUG "${CMAKE_CXX_FLAGS}")
  47. set(CMAKE_CXX_FLAGS_RELEASE "${CMAKE_CXX_FLAGS} /O2")
  48. endif()
  49. # Set C compiler flags
  50. set(CMAKE_C_FLAGS "${CMAKE_CXX_FLAGS}")
  51. set(CMAKE_C_FLAGS_DEBUG "${CMAKE_CXX_FLAGS_DEBUG}")
  52. set(CMAKE_C_FLAGS_RELEASE "${CMAKE_CXX_FLAGS_RELEASE}")
  53. # Set executable linker flags
  54. if(MSVC)
  55. set(CMAKE_EXE_LINKER_FLAGS "${CMAKE_EXE_LINKER_FLAGS} /nologo")
  56. set(CMAKE_EXE_LINKER_FLAGS_RELEASE "${CMAKE_EXE_LINKER_FLAGS_RELEASE} /OPT:REF /OPT:ICF /INCREMENTAL:NO")
  57. endif()
  58. # Setup module directories
  59. set(MODULE_SOURCE_DIR "${PROJECT_SOURCE_DIR}/modules")
  60. set(MODULE_BUILD_DIR "${PROJECT_BINARY_DIR}/modules/build")
  61. set(MODULE_INSTALL_DIR "${CMAKE_BINARY_DIR}/modules/install")
  62. # Include ExternalProject_Add macro
  63. include(${CMAKE_ROOT}/Modules/ExternalProject.cmake)
  64. # Build SDL2 module
  65. ExternalProject_Add(SDL2
  66. SOURCE_DIR ${MODULE_SOURCE_DIR}/SDL2
  67. BINARY_DIR ${MODULE_BUILD_DIR}/SDL2
  68. INSTALL_DIR ${MODULE_INSTALL_DIR}
  69. CMAKE_ARGS
  70. "-DCMAKE_BUILD_TYPE=${CMAKE_BUILD_TYPE}"
  71. "-DCMAKE_INSTALL_PREFIX=${MODULE_INSTALL_DIR}"
  72. "-DCMAKE_C_FLAGS='${CMAKE_C_FLAGS}'"
  73. "-DCMAKE_C_FLAGS_DEBUG='${CMAKE_C_FLAGS_DEBUG}'"
  74. "-DCMAKE_C_FLAGS_RELEASE='${CMAKE_C_FLAGS_RELEASE}'"
  75. "-DSDL_SHARED=OFF"
  76. "-DSDL_STATIC=ON"
  77. "-DSDL_LIBC=ON"
  78. "-DSDL_FORCE_STATIC_VCRT=ON"
  79. "-DSDL_ASSERTIONS=disabled"
  80. "-DSDL_ATOMIC=ON"
  81. "-DSDL_AUDIO=OFF"
  82. "-DSDL_VIDEO=ON"
  83. "-DSDL_RENDER=OFF"
  84. "-DSDL_EVENTS=ON"
  85. "-DSDL_JOYSTICK=ON"
  86. "-DSDL_HAPTIC=ON"
  87. "-DSDL_HIDAPI=ON"
  88. "-DSDL_POWER=OFF"
  89. "-DSDL_THREADS=ON"
  90. "-DSDL_TIMERS=ON"
  91. "-DSDL_FILE=OFF"
  92. "-DSDL_LOADSO=ON"
  93. "-DSDL_CPUINFO=OFF"
  94. "-DSDL_FILESYSTEM=OFF"
  95. "-DSDL_SENSOR=OFF"
  96. "-DSDL_LOCALE=OFF"
  97. "-DSDL_MISC=OFF"
  98. "-DSDL_DIRECTX=OFF"
  99. "-DSDL_WASAPI=OFF"
  100. "-DSDL_RENDER_D3D=OFF"
  101. BUILD_ALWAYS 0)
  102. # Build OpenAL Soft module
  103. ExternalProject_Add(openal-soft
  104. SOURCE_DIR ${MODULE_SOURCE_DIR}/openal-soft
  105. BINARY_DIR ${MODULE_BUILD_DIR}/openal-soft
  106. INSTALL_DIR ${MODULE_INSTALL_DIR}
  107. CMAKE_ARGS
  108. "-DCMAKE_BUILD_TYPE=${CMAKE_BUILD_TYPE}"
  109. "-DCMAKE_INSTALL_PREFIX=${MODULE_INSTALL_DIR}"
  110. "-DCMAKE_C_FLAGS='${CMAKE_C_FLAGS}'"
  111. "-DCMAKE_C_FLAGS_DEBUG='${CMAKE_C_FLAGS_DEBUG}'"
  112. "-DCMAKE_C_FLAGS_RELEASE='${CMAKE_C_FLAGS_RELEASE}'"
  113. "-DCMAKE_CXX_FLAGS='${CMAKE_CXX_FLAGS}'"
  114. "-DCMAKE_CXX_FLAGS_DEBUG='${CMAKE_CXX_FLAGS_DEBUG}'"
  115. "-DCMAKE_CXX_FLAGS_RELEASE='${CMAKE_CXX_FLAGS_RELEASE}'"
  116. "-DLIBTYPE=STATIC"
  117. "-DFORCE_STATIC_VCRT=ON"
  118. "-DALSOFT_UTILS=OFF"
  119. "-DALSOFT_EXAMPLES=OFF"
  120. BUILD_ALWAYS 0)
  121. # Build EnTT module
  122. ExternalProject_Add(entt
  123. SOURCE_DIR ${MODULE_SOURCE_DIR}/entt
  124. BINARY_DIR ${MODULE_BUILD_DIR}/entt
  125. INSTALL_DIR ${MODULE_INSTALL_DIR}
  126. CMAKE_ARGS
  127. "-DCMAKE_BUILD_TYPE=${CMAKE_BUILD_TYPE}"
  128. "-DCMAKE_INSTALL_PREFIX=${MODULE_INSTALL_DIR}"
  129. "-DCMAKE_CXX_FLAGS='${CMAKE_CXX_FLAGS}'"
  130. "-DCMAKE_CXX_FLAGS_DEBUG='${CMAKE_CXX_FLAGS_DEBUG}'"
  131. "-DCMAKE_CXX_FLAGS_RELEASE='${CMAKE_CXX_FLAGS_RELEASE}'"
  132. BUILD_ALWAYS 0)
  133. # Build nlohmann-json module
  134. ExternalProject_Add(nlohmann-json
  135. SOURCE_DIR ${MODULE_SOURCE_DIR}/nlohmann
  136. BINARY_DIR ${MODULE_BUILD_DIR}/nlohmann
  137. INSTALL_DIR ${MODULE_INSTALL_DIR}
  138. CMAKE_ARGS
  139. "-DCMAKE_BUILD_TYPE=${CMAKE_BUILD_TYPE}"
  140. "-DCMAKE_INSTALL_PREFIX=${MODULE_INSTALL_DIR}"
  141. "-DCMAKE_CXX_FLAGS='${CMAKE_CXX_FLAGS}'"
  142. "-DCMAKE_CXX_FLAGS_DEBUG='${CMAKE_CXX_FLAGS_DEBUG}'"
  143. "-DCMAKE_CXX_FLAGS_RELEASE='${CMAKE_CXX_FLAGS_RELEASE}'"
  144. BUILD_ALWAYS 0)
  145. # Build dr_wav module
  146. ExternalProject_Add(dr_wav
  147. SOURCE_DIR ${MODULE_SOURCE_DIR}/dr_wav
  148. BINARY_DIR ${MODULE_BUILD_DIR}/dr_wav
  149. INSTALL_DIR ${MODULE_INSTALL_DIR}
  150. CMAKE_ARGS
  151. "-DCMAKE_BUILD_TYPE=${CMAKE_BUILD_TYPE}"
  152. "-DCMAKE_INSTALL_PREFIX=${MODULE_INSTALL_DIR}"
  153. "-DCMAKE_C_FLAGS='${CMAKE_C_FLAGS}'"
  154. "-DCMAKE_C_FLAGS_DEBUG='${CMAKE_C_FLAGS_DEBUG}'"
  155. "-DCMAKE_C_FLAGS_RELEASE='${CMAKE_C_FLAGS_RELEASE}'"
  156. BUILD_ALWAYS 0)
  157. # Build stb module
  158. ExternalProject_Add(stb
  159. SOURCE_DIR ${MODULE_SOURCE_DIR}/stb
  160. BINARY_DIR ${MODULE_BUILD_DIR}/stb
  161. INSTALL_DIR ${MODULE_INSTALL_DIR}
  162. CMAKE_ARGS
  163. "-DCMAKE_BUILD_TYPE=${CMAKE_BUILD_TYPE}"
  164. "-DCMAKE_INSTALL_PREFIX=${MODULE_INSTALL_DIR}"
  165. "-DCMAKE_C_FLAGS='${CMAKE_C_FLAGS}'"
  166. "-DCMAKE_C_FLAGS_DEBUG='${CMAKE_C_FLAGS_DEBUG}'"
  167. "-DCMAKE_C_FLAGS_RELEASE='${CMAKE_C_FLAGS_RELEASE}'"
  168. BUILD_ALWAYS 0)
  169. # Build TinyEXR module
  170. ExternalProject_Add(tinyexr
  171. SOURCE_DIR ${MODULE_SOURCE_DIR}/tinyexr
  172. BINARY_DIR ${MODULE_BUILD_DIR}/tinyexr
  173. INSTALL_DIR ${MODULE_INSTALL_DIR}
  174. CMAKE_ARGS
  175. "-DCMAKE_BUILD_TYPE=${CMAKE_BUILD_TYPE}"
  176. "-DCMAKE_INSTALL_PREFIX=${MODULE_INSTALL_DIR}"
  177. "-DCMAKE_CXX_FLAGS='${CMAKE_CXX_FLAGS}'"
  178. "-DCMAKE_CXX_FLAGS_DEBUG='${CMAKE_CXX_FLAGS_DEBUG}'"
  179. "-DCMAKE_CXX_FLAGS_RELEASE='${CMAKE_CXX_FLAGS_RELEASE}'"
  180. "-DTINYEXR_BUILD_SAMPLE=OFF"
  181. "-DTINYEXR_USE_MINIZ=OFF"
  182. "-DTINYEXR_USE_STB_ZLIB=ON"
  183. BUILD_ALWAYS 0)
  184. # Build glad module
  185. ExternalProject_Add(glad
  186. SOURCE_DIR ${MODULE_SOURCE_DIR}/glad
  187. BINARY_DIR ${MODULE_BUILD_DIR}/glad
  188. INSTALL_DIR ${MODULE_INSTALL_DIR}
  189. CMAKE_ARGS
  190. "-DCMAKE_BUILD_TYPE=${CMAKE_BUILD_TYPE}"
  191. "-DCMAKE_INSTALL_PREFIX=${MODULE_INSTALL_DIR}"
  192. "-DCMAKE_C_FLAGS='${CMAKE_C_FLAGS}'"
  193. "-DCMAKE_C_FLAGS_DEBUG='${CMAKE_C_FLAGS_DEBUG}'"
  194. "-DCMAKE_C_FLAGS_RELEASE='${CMAKE_C_FLAGS_RELEASE}'"
  195. BUILD_ALWAYS 0)
  196. # Build cxxopts module
  197. ExternalProject_Add(cxxopts
  198. SOURCE_DIR ${MODULE_SOURCE_DIR}/cxxopts
  199. BINARY_DIR ${MODULE_BUILD_DIR}/cxxopts
  200. INSTALL_DIR ${MODULE_INSTALL_DIR}
  201. CMAKE_ARGS
  202. "-DCMAKE_BUILD_TYPE=${CMAKE_BUILD_TYPE}"
  203. "-DCMAKE_INSTALL_PREFIX=${MODULE_INSTALL_DIR}"
  204. "-DCMAKE_CXX_FLAGS='${CMAKE_CXX_FLAGS}'"
  205. "-DCMAKE_CXX_FLAGS_DEBUG='${CMAKE_CXX_FLAGS_DEBUG}'"
  206. "-DCMAKE_CXX_FLAGS_RELEASE='${CMAKE_CXX_FLAGS_RELEASE}'"
  207. "-DCXXOPTS_BUILD_EXAMPLES=OFF"
  208. "-DCXXOPTS_BUILD_TESTS=OFF"
  209. BUILD_ALWAYS 0)
  210. # Build PhysicsFS module
  211. ExternalProject_Add(physfs
  212. SOURCE_DIR ${MODULE_SOURCE_DIR}/physfs
  213. BINARY_DIR ${MODULE_BUILD_DIR}/physfs
  214. INSTALL_DIR ${MODULE_INSTALL_DIR}
  215. CMAKE_ARGS
  216. "-DCMAKE_BUILD_TYPE=${CMAKE_BUILD_TYPE}"
  217. "-DCMAKE_INSTALL_PREFIX=${MODULE_INSTALL_DIR}"
  218. "-DCMAKE_C_FLAGS='${CMAKE_C_FLAGS}'"
  219. "-DCMAKE_C_FLAGS_DEBUG='${CMAKE_C_FLAGS_DEBUG}'"
  220. "-DCMAKE_C_FLAGS_RELEASE='${CMAKE_C_FLAGS_RELEASE}'"
  221. "-DPHYSFS_ARCHIVE_ZIP=ON"
  222. "-DPHYSFS_ARCHIVE_7Z=OFF"
  223. "-DPHYSFS_ARCHIVE_GRP=OFF"
  224. "-DPHYSFS_ARCHIVE_WAD=OFF"
  225. "-DPHYSFS_ARCHIVE_HOG=OFF"
  226. "-DPHYSFS_ARCHIVE_MVL=OFF"
  227. "-DPHYSFS_ARCHIVE_QPAK=OFF"
  228. "-DPHYSFS_ARCHIVE_SLB=OFF"
  229. "-DPHYSFS_ARCHIVE_ISO9660=OFF"
  230. "-DPHYSFS_ARCHIVE_VDF=OFF"
  231. "-DPHYSFS_BUILD_STATIC=ON"
  232. "-DPHYSFS_BUILD_SHARED=OFF"
  233. "-DPHYSFS_BUILD_TEST=OFF"
  234. BUILD_ALWAYS 0)
  235. # Build FreeType module
  236. ExternalProject_Add(freetype
  237. SOURCE_DIR ${MODULE_SOURCE_DIR}/freetype
  238. BINARY_DIR ${MODULE_BUILD_DIR}/freetype
  239. INSTALL_DIR ${MODULE_INSTALL_DIR}
  240. CMAKE_ARGS
  241. "-DCMAKE_BUILD_TYPE=${CMAKE_BUILD_TYPE}"
  242. "-DCMAKE_INSTALL_PREFIX=${MODULE_INSTALL_DIR}"
  243. "-DCMAKE_C_FLAGS='${CMAKE_C_FLAGS}'"
  244. "-DCMAKE_C_FLAGS_DEBUG='${CMAKE_C_FLAGS_DEBUG}'"
  245. "-DCMAKE_C_FLAGS_RELEASE='${CMAKE_C_FLAGS_RELEASE}'"
  246. "-DBUILD_SHARED_LIBS=false"
  247. "-DFT_DISABLE_ZLIB=ON"
  248. "-DFT_DISABLE_BZIP2=ON"
  249. "-DFT_DISABLE_PNG=ON"
  250. "-DFT_DISABLE_HARFBUZZ=ON"
  251. "-DFT_DISABLE_BROTLI=ON"
  252. BUILD_ALWAYS 0)
  253. # Build antkeeper-source module
  254. ExternalProject_Add(antkeeper-source
  255. DEPENDS SDL2 openal-soft entt nlohmann-json dr_wav stb tinyexr glad physfs freetype
  256. SOURCE_DIR ${MODULE_SOURCE_DIR}/antkeeper-source
  257. BINARY_DIR ${MODULE_BUILD_DIR}/antkeeper-source
  258. INSTALL_DIR ${PACKAGE_INSTALL_DIR}
  259. CMAKE_ARGS
  260. "-DCMAKE_BUILD_TYPE=${CMAKE_BUILD_TYPE}"
  261. "-DCMAKE_INSTALL_PREFIX=${PACKAGE_INSTALL_DIR}"
  262. "-DPACKAGE_PLATFORM=${PACKAGE_PLATFORM}"
  263. "-DCMAKE_PREFIX_PATH=${MODULE_INSTALL_DIR}"
  264. "-DVERSION_STRING=${PROJECT_VERSION}"
  265. "-DCMAKE_CXX_FLAGS='${CMAKE_CXX_FLAGS}'"
  266. "-DCMAKE_CXX_FLAGS_DEBUG='${CMAKE_CXX_FLAGS_DEBUG}'"
  267. "-DCMAKE_CXX_FLAGS_RELEASE='${CMAKE_CXX_FLAGS_RELEASE}'"
  268. "-DCMAKE_EXE_LINKER_FLAGS='${CMAKE_EXE_LINKER_FLAGS}'"
  269. "-DCMAKE_EXE_LINKER_FLAGS_DEBUG='${CMAKE_EXE_LINKER_FLAGS_DEBUG}'"
  270. "-DCMAKE_EXE_LINKER_FLAGS_RELEASE='${CMAKE_EXE_LINKER_FLAGSRELEASE}'"
  271. BUILD_ALWAYS 1)
  272. # Build antkeeper-data module (if exists)
  273. if(EXISTS ${MODULE_SOURCE_DIR}/antkeeper-data/CMakeLists.txt)
  274. ExternalProject_Add(antkeeper-data
  275. DEPENDS antkeeper-source
  276. SOURCE_DIR ${MODULE_SOURCE_DIR}/antkeeper-data
  277. BINARY_DIR ${MODULE_BUILD_DIR}/antkeeper-data
  278. INSTALL_DIR ${PACKAGE_INSTALL_DIR}
  279. CMAKE_ARGS
  280. "-DCMAKE_BUILD_TYPE=${CMAKE_BUILD_TYPE}"
  281. "-DCMAKE_INSTALL_PREFIX=${PACKAGE_INSTALL_DIR}"
  282. "-DPACKAGE_PLATFORM=${PACKAGE_PLATFORM}"
  283. "-DCMAKE_PREFIX_PATH=${MODULE_INSTALL_DIR}"
  284. "-DBLENDER=${BLENDER}"
  285. "-DINKSCAPE=${INKSCAPE}"
  286. BUILD_ALWAYS 1)
  287. endif()
  288. # Create install target
  289. install(DIRECTORY "${PACKAGE_INSTALL_DIR}/" DESTINATION . COMPONENT "package" USE_SOURCE_PERMISSIONS FILES_MATCHING PATTERN "*")
  290. # Create clean-build target
  291. add_custom_target(clean-build
  292. COMMAND git clean -fdX
  293. WORKING_DIRECTORY "${PROJECT_BINARY_DIR}")
  294. # Create cpack target
  295. add_custom_target(cpack
  296. COMMAND "${CMAKE_COMMAND}" --build . --target package
  297. WORKING_DIRECTORY "${CMAKE_CURRENT_BINARY_DIR}"
  298. DEPENDS antkeeper-source
  299. VERBATIM)
  300. # Create dist target
  301. add_custom_target(dist DEPENDS cpack)
  302. # Configure CPack variables
  303. set(CPACK_PACKAGE_NAME "${PACKAGE_NAME}")
  304. set(CPACK_PACKAGE_VERSION_MAJOR "${PROJECT_VERSION_MAJOR}")
  305. set(CPACK_PACKAGE_VERSION_MINOR "${PROJECT_VERSION_MINOR}")
  306. set(CPACK_PACKAGE_VERSION_PATCH "${PROJECT_VERSION_PATCH}")
  307. set(CPACK_PACKAGE_FILE_NAME "${PACKAGE_NAME}-${PACKAGE_VERSION}-${PACKAGE_PLATFORM}")
  308. set(CPACK_PACKAGE_DESCRIPTION "")
  309. set(CPACK_PACKAGE_CONTACT "Christopher J. Howard <cjhoward@cjhoward.org>")
  310. set(CPACK_COMPONENTS_ALL "package")
  311. # Configure .tgz and .zip distribution packages
  312. set(CPACK_ARCHIVE_COMPONENT_INSTALL ON)
  313. #set(CPACK_ARCHIVE_FILE_NAME "${CPACK_PACKAGE_FILE_NAME}.zip")
  314. #set(CPACK_ARCHIVE_PACKAGE_FILE_NAME "${CPACK_PACKAGE_FILE_NAME}.zip")
  315. # Configure .deb distribution package
  316. set(CPACK_DEB_COMPONENT_INSTALL ON)
  317. set(CPACK_DEBIAN_PACKAGE_PACKAGE_NAME "${CPACK_PACKAGE_NAME}")
  318. set(CPACK_DEBIAN_PACKAGE_FILE_NAME "${CPACK_PACKAGE_FILE_NAME}.deb")
  319. set(CPACK_DEBIAN_PACKAGE_DEPENDS "")
  320. # Configure NSIS installer package
  321. #set(CPACK_NSIS_MUI_ICON "${PROJECT_SOURCE_DIR}/data/icons/app-icon.ico")
  322. #set(CPACK_PACKAGE_INSTALL_DIRECTORY "App")
  323. # Build distribution packages according to target platform
  324. set(CPACK_GENERATOR "")
  325. if(PACKAGE_PLATFORM MATCHES "linux")
  326. set(CPACK_GENERATOR "TGZ;DEB")
  327. add_custom_command(TARGET dist
  328. COMMAND ${CMAKE_COMMAND} -E make_directory ${PACKAGE_DIST_DIR}
  329. COMMAND ${CMAKE_COMMAND} -E copy "${CPACK_PACKAGE_FILE_NAME}-package.tar.gz" "${PACKAGE_DIST_DIR}/${PACKAGE_FILENAME}.tar.gz"
  330. COMMAND ${CMAKE_COMMAND} -E copy "${CPACK_DEBIAN_PACKAGE_FILE_NAME}" "${PACKAGE_DIST_DIR}")
  331. elseif(PACKAGE_PLATFORM MATCHES "win")
  332. set(CPACK_GENERATOR "ZIP;NSIS")
  333. add_custom_command(TARGET dist
  334. COMMAND ${CMAKE_COMMAND} -E make_directory ${PACKAGE_DIST_DIR}
  335. COMMAND ${CMAKE_COMMAND} -E copy "${CPACK_PACKAGE_FILE_NAME}-package.zip" "${PACKAGE_DIST_DIR}/${PACKAGE_FILENAME}.zip"
  336. COMMAND ${CMAKE_COMMAND} -E copy "${CPACK_PACKAGE_FILE_NAME}.exe" "${PACKAGE_DIST_DIR}/${PACKAGE_FILENAME}.exe")
  337. elseif(PACKAGE_PLATFORM MATCHES "osx")
  338. set(CPACK_GENERATOR "ZIP;NSIS")
  339. add_custom_command(TARGET dist
  340. COMMAND ${CMAKE_COMMAND} -E make_directory ${PACKAGE_DIST_DIR}
  341. COMMAND ${CMAKE_COMMAND} -E copy "${CPACK_PACKAGE_FILE_NAME}-package.zip" "${PACKAGE_DIST_DIR}/${PACKAGE_FILENAME}.zip")
  342. endif()
  343. # Include CPack macro
  344. include(CPack)