-
Notifications
You must be signed in to change notification settings - Fork 17
/
CMakeLists.txt
61 lines (49 loc) · 1.57 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.28)
project(cake LANGUAGES CXX)
set (CANDY_VERSION "5.10.4")
set (CAKE_RELEASE "1")
set(CMAKE_AUTOUIC ON)
set(CMAKE_AUTOMOC ON)
set(CMAKE_AUTORCC ON)
set(CMAKE_CXX_STANDARD 17)
set(CMAKE_CXX_STANDARD_REQUIRED ON)
set (CAKE_VERSION "${CANDY_VERSION}-${CAKE_RELEASE}")
configure_file("setup.iss.in" "setup.iss" @ONLY)
add_compile_definitions(CAKE_VERSION="${CAKE_VERSION}")
find_package(Qt6 REQUIRED COMPONENTS Widgets Gui Core Network)
add_executable(cake
define.h main.cc
mainwindow.h mainwindow.cc
candylist.h candylist.cc
candyitem.h candyitem.cc
detailarea.h detailarea.cc
startoption.h startoption.cc
feedback.h feedback.cc
keepalive.h keepalive.cc
update.h update.cc
about.h about.cc
images.qrc admin.rc
)
target_link_libraries(${CMAKE_PROJECT_NAME} PRIVATE Qt6::Widgets Qt6::Gui Qt6::Core Qt6::Network)
set_target_properties(cake PROPERTIES
QT_TARGET_DESCRIPTION "Cake"
)
if(CMAKE_BUILD_TYPE STREQUAL "Debug")
set_target_properties(cake PROPERTIES WIN32_EXECUTABLE FALSE)
else()
set_target_properties(cake PROPERTIES WIN32_EXECUTABLE TRUE)
endif()
include(FetchContent)
FetchContent_Declare(
candy
GIT_REPOSITORY https://github.com/lanthora/candy.git
GIT_TAG "v${CANDY_VERSION}"
EXCLUDE_FROM_ALL
)
set(CANDY_DEVEL "1" CACHE BOOL "" FORCE)
set(CANDY_NOEXE "1" CACHE BOOL "" FORCE)
FetchContent_MakeAvailable(candy)
include_directories(${candy_SOURCE_DIR}/src/cffi/)
target_link_libraries(${CMAKE_PROJECT_NAME} PRIVATE libcandy)
include(GNUInstallDirs)
install(TARGETS cake)