-
Notifications
You must be signed in to change notification settings - Fork 16
/
CMakeLists.txt
55 lines (44 loc) · 1.82 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
cmake_minimum_required(VERSION 3.26...3.29 FATAL_ERROR)
# 3.26 required for copy_directory_if_different
project(open_iA LANGUAGES CXX)
set(CMAKE_MODULE_PATH "${PROJECT_SOURCE_DIR}/cmake")
set(FLATPAK_APPID at.zfp.openia)
set(Toolkit_DIR "${PROJECT_SOURCE_DIR}/Toolkit")
set(TEST_DIR "${CMAKE_SOURCE_DIR}/test")
include(Common)
#-------------------------
# Subdirectories
#-------------------------
add_subdirectory(libs)
add_subdirectory(cmd) # Sets CMD test runner (TEST_CMD_EXECUTABLE), used in modules
set(GUI_EXECUTABLE_TARGET open_iA) # required in modules to set dependency on it
set(GUI_EXECUTABLE_FILE "${GUI_EXECUTABLE_TARGET}${CMAKE_EXECUTABLE_SUFFIX}") # required in modules to use as debugger command
if (openiA_TESTING_ENABLED)
if (MSVC)
# use the created .bat which makes sure all required dll's are in the path:
set(TEST_GUI_EXECUTABLE "${CMAKE_BINARY_DIR}/x64/open_iA_gui_Release.bat")
elseif(APPLE)
set(TEST_GUI_EXECUTABLE "${CMAKE_BINARY_DIR}/x64/Release/open_iA.app/Contents/MacOS/open_iA")
else()
# make sure the Mesa OpenGL Override version is set
set(TEST_GUI_EXECUTABLE "${CMAKE_SOURCE_DIR}/test/run_with_gl.sh" "${CMAKE_RUNTIME_OUTPUT_DIRECTORY}/${GUI_EXECUTABLE_TARGET}")
endif()
endif()
add_subdirectory(modules)
# modules might have added something to BUILD_INFO:
configure_file("${CMAKE_SOURCE_DIR}/cmake/version.h.in" "${CMAKE_BINARY_DIR}/version.h" @ONLY)
add_subdirectory(gui)
if (openiA_TESTING_ENABLED)
add_subdirectory(test)
endif()
#-------------------------
# Installation
#-------------------------
add_subdirectory(xinst)
# Text files:
install(FILES ${CMAKE_SOURCE_DIR}/LICENSE DESTINATION .)
install(FILES ${CMAKE_SOURCE_DIR}/README.md DESTINATION .)
if (FLATPAK_BUILD)
install(FILES ${CMAKE_SOURCE_DIR}/${FLATPAK_APPID}.appdata.xml DESTINATION share/metainfo)
endif()
include(CMakeCPack.cmake)