-
Notifications
You must be signed in to change notification settings - Fork 40
/
CMakeLists.txt
34 lines (30 loc) · 1.03 KB
/
CMakeLists.txt
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
cmake_minimum_required(VERSION 3.6)
project(Plater
VERSION 1.1
DESCRIPTION "3D-printer parts placer and plate generator"
LANGUAGES CXX
)
# Re-run cmake whenever Git index changes
set_property(GLOBAL APPEND
PROPERTY CMAKE_CONFIGURE_DEPENDS "${CMAKE_SOURCE_DIR}/.git/index"
)
add_subdirectory(plater)
add_subdirectory(gui)
# Packaging
include(GNUInstallDirs)
set(CMAKE_INSTALL_DOCDIR ${CMAKE_INSTALL_DATAROOTDIR}/doc/plater)
install(FILES ${CMAKE_CURRENT_SOURCE_DIR}/LICENSE DESTINATION ${CMAKE_INSTALL_DOCDIR})
if(EXISTS ${CMAKE_CURRENT_SOURCE_DIR}/.git/index)
find_package(Git REQUIRED)
execute_process(
COMMAND "${GIT_EXECUTABLE}" describe --always --long --tags
WORKING_DIRECTORY ${CMAKE_CURRENT_SOURCE_DIR}
OUTPUT_VARIABLE GIT_VERSION
OUTPUT_STRIP_TRAILING_WHITESPACE
)
set(CPACK_PACKAGE_FILE_NAME Plater-${GIT_VERSION}-${CMAKE_SYSTEM_NAME})
set(CPACK_SOURCE_PACKAGE_FILE_NAME Plater-${GIT_VERSION}-Source)
endif()
set(CPACK_GENERATOR 7Z)
set(CPACK_SOURCE_GENERATOR 7Z)
include(CPack)