-
Notifications
You must be signed in to change notification settings - Fork 0
/
CMakeLists.txt
109 lines (92 loc) · 2.27 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
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
cmake_minimum_required(VERSION 3.16)
project(TombRaiderLinuxLauncher)
set(CMAKE_AUTOMOC ON)
set(CMAKE_AUTORCC ON)
set(CMAKE_AUTOUIC ON)
set(CMAKE_BUILD_TYPE Debug)
find_package(Qt5 COMPONENTS Core Gui Test Widgets WebEngineWidgets Sql REQUIRED)
find_package(CURL REQUIRED)
# Set policy for Boost to ensure compatibility with newer CMake versions
if(POLICY CMP0167)
cmake_policy(SET CMP0167 NEW)
endif()
find_package(Boost REQUIRED COMPONENTS system filesystem)
find_package(OpenSSL REQUIRED)
add_subdirectory(libs/miniz)
# suppress ZERO_CHECK dont think its needed
#set(CMAKE_SUPPRESS_REGENERATION true)
set(SOURCES
src/main.cpp
src/Network.h
src/Network.cpp
src/Controller.h
src/Controller.cpp
src/FileManager.h
src/FileManager.cpp
src/Model.h
src/Model.cpp
src/Data.h
src/Data.cpp
src/TombRaiderLinuxLauncher.h
src/TombRaiderLinuxLauncher.cpp
src/TombRaiderLinuxLauncher.ui
src/resources.qrc
)
set(TEST_SOURCES
src/main.cpp
src/Network.h
src/Network.cpp
src/Controller.h
src/Controller.cpp
src/FileManager.h
src/FileManager.cpp
src/Model.h
src/Model.cpp
src/Data.h
src/Data.cpp
)
add_executable(${PROJECT_NAME} ${SOURCES} )
# create the test executable
#enable_testing(false)
#add_executable(${PROJECT_NAME}Test ${TEST_SOURCES})
#add_test(NAME ${PROJECT_NAME}Test COMMAND ${PROJECT_NAME}Test)
# I think it should link to miniz here also
target_link_libraries(${PROJECT_NAME} PUBLIC
Qt5::Core
Qt5::Gui
Qt5::Widgets
Qt5::WebEngineWidgets
Qt5::Sql
miniz
${CURL_LIBRARY}
OpenSSL::SSL
Boost::system
Boost::filesystem
)
# link to Qt5::Test
# the test will be a console qt application
#target_link_libraries(${PROJECT_NAME}Test PUBLIC
# Qt5::Core
# Qt5::Gui
# Qt5::Test
# Qt5::Widgets
# Qt5::Sql
# miniz
# ${CURL_LIBRARY}
#)
target_include_directories(${PROJECT_NAME} PRIVATE
${CURL_INCLUDE_DIR}
${Boost_INCLUDE_DIRS}
libs/miniz
src
)
set_target_properties(${PROJECT_NAME} PROPERTIES
CXX_STANDARD 17
CXX_STANDARD_REQUIRED ON
)
install(TARGETS ${PROJECT_NAME}
DESTINATION ${CMAKE_INSTALL_PREFIX}/bin
)
install(FILES ${CMAKE_SOURCE_DIR}/database/tombll.db
DESTINATION ${CMAKE_INSTALL_PREFIX}/share/${PROJECT_NAME}
)