-
Notifications
You must be signed in to change notification settings - Fork 3
/
CMakeLists.txt
51 lines (42 loc) · 1.93 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
cmake_minimum_required(VERSION 3.19)
project(katvan LANGUAGES CXX VERSION "0.8.0")
enable_testing()
#
# The Rust standard library for MSVC targets always requests linking to the non
# debug CRT library, no matter the profile. However actual linking of the
# typstdriver DLL is done by the C++ compiler, which might try to use the debug
# CRT. Also we could work with pre-built Qt that uses the debug CRT. This makes
# things... not work. Until something like the -Zlink-directives flag for rustc
# stabilizes, Windows builds MUST NOT be done in Debug mode.
#
# See: https://github.com/rust-lang/rust/issues/39016
#
if(MSVC)
list(REMOVE_ITEM CMAKE_CONFIGURATION_TYPES "Debug")
endif()
set(CMAKE_CXX_STANDARD 20)
set(CMAKE_CXX_STANDARD_REQUIRED ON)
find_package(Qt6 REQUIRED COMPONENTS Core)
qt_standard_project_setup(REQUIRES 6.5)
add_subdirectory(typstdriver)
add_subdirectory(core)
add_subdirectory(shell)
add_subdirectory(tests)
if(APPLE)
set_property(TARGET katvan PROPERTY INSTALL_RPATH "@executable_path/../Frameworks/")
install(TARGETS katvan DESTINATION ${CMAKE_BINARY_DIR}/dist)
install(TARGETS typstdriver DESTINATION ${CMAKE_BINARY_DIR}/dist/Katvan.app/Contents/Frameworks)
elseif(UNIX)
include(GNUInstallDirs)
if(APPIMAGE_INSTALL)
set_property(TARGET katvan PROPERTY INSTALL_RPATH "$ORIGIN/../lib")
install(TARGETS typstdriver DESTINATION lib)
else()
set_property(TARGET katvan PROPERTY INSTALL_RPATH "$ORIGIN/../${CMAKE_INSTALL_LIBDIR}/katvan:$ORIGIN/../${CMAKE_INSTALL_LIBDIR}")
install(TARGETS typstdriver DESTINATION ${CMAKE_INSTALL_LIBDIR}/katvan)
endif()
install(TARGETS katvan DESTINATION ${CMAKE_INSTALL_BINDIR})
install(FILES assets/katvan.desktop DESTINATION share/applications)
install(FILES assets/katvan.svg DESTINATION share/icons/hicolor/scalable/apps)
install(FILES assets/katvan_48x48.png DESTINATION share/icons/hicolor/48x48/apps RENAME katvan.png)
endif()