-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathCMakeLists.txt
100 lines (85 loc) · 2.85 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
#[[**************************************************************************
* gta5hla GTA V Hardlinking Assistant
* Copyright (C) 2022 Syping
*
* Redistribution and use in source and binary forms, with or without modification,
* are permitted provided that the following conditions are met:
*
* 1. Redistributions of source code must retain the above copyright notice,
* this list of conditions and the following disclaimer.
*
* 2. Redistributions in binary form must reproduce the above copyright notice,
* this list of conditions and the following disclaimer in the documentation
* and/or other materials provided with the distribution.
*
* This software is provided as-is, no warranties are given to you, we are not
* responsible for anything with use of the software, you are self responsible.
****************************************************************************]]
cmake_minimum_required(VERSION 3.7)
project(gta5hla VERSION 0.1.2 LANGUAGES CXX)
set(CMAKE_INCLUDE_CURRENT_DIR ON)
set(CMAKE_AUTOUIC ON)
set(CMAKE_AUTOMOC ON)
set(CMAKE_AUTORCC ON)
set(CMAKE_CXX_STANDARD 11)
set(CMAKE_CXX_STANDARD_REQUIRED ON)
set(FORCE_QT_VERSION "" CACHE STRING "Force Qt Version")
if(FORCE_QT_VERSION)
set(QT_VERSION_MAJOR ${FORCE_QT_VERSION})
else()
find_package(QT NAMES Qt6 Qt5 COMPONENTS Core REQUIRED)
endif()
find_package(Qt${QT_VERSION_MAJOR} COMPONENTS Widgets REQUIRED)
if(WIN32)
list(APPEND GTA5HLA_LIBS
version
)
list(APPEND GTA5HLA_DEFINES
-DUNICODE
-D_UNICODE
-DWIN32
)
string(TIMESTAMP gta5hla_BUILD_YEAR "%Y" UTC)
configure_file(src/win32/gta5hla.rc.in "${gta5hla_BINARY_DIR}/resources/gta5hla.rc" @ONLY)
configure_file(src/win32/gta5hla.exe.manifest "${gta5hla_BINARY_DIR}/resources/gta5hla.exe.manifest" COPYONLY)
list(APPEND GTA5HLA_RESOURCES
"${gta5hla_BINARY_DIR}/resources/gta5hla.rc"
)
endif()
list(APPEND GTA5HLA_DEFINES
-DGTA5HLA_CMAKE
-DGTA5HLA_GUI
-DGTA5HLA_PROJECT
)
set(GTA5HLA_SOURCES
src/main.cpp
src/HardlinkAssistant.cpp
src/HardlinkThread.cpp
src/ProgressDialog.cpp
src/UserInterface.cpp
)
set(GTA5HLA_HEADERS
src/HardlinkAssistant.h
src/HardlinkThread.h
src/ProgressDialog.h
src/UserInterface.h
)
set(GTA5HLA_FORMS
src/ProgressDialog.ui
src/UserInterface.ui
)
configure_file(src/gta5hla_config.h.in "${gta5hla_BINARY_DIR}/include/gta5hla_config.h" @ONLY)
list(APPEND GTA5HLA_HEADERS
"${gta5hla_BINARY_DIR}/include/gta5hla_config.h"
)
add_executable(gta5hla
WIN32
${GTA5HLA_HEADERS}
${GTA5HLA_SOURCES}
${GTA5HLA_FORMS}
${GTA5HLA_RESOURCES}
)
target_compile_definitions(gta5hla PRIVATE ${GTA5HLA_DEFINES})
target_include_directories(gta5hla PRIVATE "${gta5hla_BINARY_DIR}/include")
target_link_libraries(gta5hla PRIVATE Qt${QT_VERSION_MAJOR}::Widgets ${GTA5HLA_LIBS})
install(TARGETS gta5hla DESTINATION bin)