-
Notifications
You must be signed in to change notification settings - Fork 24
/
CMakeLists.txt
61 lines (50 loc) · 1.72 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
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
cmake_minimum_required(VERSION 3.9)
project(FontEdit)
set(CMAKE_PROJECT_VERSION_MAJOR 1)
set(CMAKE_PROJECT_VERSION_MINOR 1)
set(CMAKE_PROJECT_VERSION_PATCH 0)
set(APP_VERSION 1.1.0)
set(APP_BUILD 4)
set(APP_YEAR 2020)
set(CMAKE_CXX_STANDARD 17)
set(CMAKE_CXX_STANDARD_REQUIRED ON)
set(BUILD_TESTS ON)
set(CMAKE_RUNTIME_OUTPUT_DIRECTORY ${CMAKE_CURRENT_BINARY_DIR})
find_package(Qt5 COMPONENTS Widgets REQUIRED)
enable_testing()
add_subdirectory(gtest EXCLUDE_FROM_ALL)
add_subdirectory(gsl EXCLUDE_FROM_ALL)
add_subdirectory(lib)
add_subdirectory(app)
if(${BUILD_TESTS})
add_subdirectory(test)
endif()
if (APPLE)
add_custom_command(OUTPUT "${APP_TARGET_NAME}.dmg"
COMMAND macdeployqt
ARGS "${APP_TARGET_NAME}.app" "-libpath=/lib" "-dmg"
MAIN_DEPENDENCY ${APP_TARGET_NAME}.app
WORKING_DIRECTORY "${CMAKE_CURRENT_BINARY_DIR}")
add_custom_target(dmg
DEPENDS "${CMAKE_CURRENT_BINARY_DIR}/${APP_TARGET_NAME}.dmg"
)
elseif (WIN32)
message(STATUS "ADDING WINDOWS INSTALLER TARGET")
add_custom_command(OUTPUT "win"
COMMAND windeployqt.exe
ARGS "${APP_TARGET_NAME}.exe" "--dir" "win"
WORKING_DIRECTORY "${CMAKE_CURRENT_BINARY_DIR}")
add_custom_target(installer
DEPENDS "${CMAKE_CURRENT_BINARY_DIR}/win"
)
endif ()
set(CPACK_PACKAGE_VERSION "1.1.0")
set(CPACK_PACKAGE_CONTACT "[email protected]")
set(CPACK_PROJECT_HOMEPAGE_URL "https://kapusta.cc")
set(CPACK_DEBIAN_FILE_NAME DEB-DEFAULT)
set(CPACK_DEBIAN_PACKAGE_NAME "fontedit")
set(CPACK_DEBIAN_PACKAGE_RELEASE 3)
set(CPACK_DEBIAN_PACKAGE_DESCRIPTION
"Edit and convert fonts to byte arrays suitable for use in embedded systems' displays")
set(CPACK_DEBIAN_PACKAGE_SHLIBDEPS ON)
include(CPack)