-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathCMakeLists.txt
103 lines (90 loc) · 3.26 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
cmake_minimum_required(VERSION 3.14)
project(foxogram
VERSION 1.0.0
DESCRIPTION "Desktop client for foxogram"
LANGUAGES CXX)
set(CMAKE_CXX_STANDARD 17)
set(CMAKE_AUTOUIC_SEARCH_PATHS src/ui)
set(CMAKE_AUTOUIC ON)
set(CMAKE_AUTORCC ON)
set(CMAKE_AUTORCC_SEARCH_PATHS src/ui)
set(LIBFOXOGRAM_INSTALL OFF)
set(IXWEBSOCKET_INSTALL OFF)
if(NOT DEFINED CMAKE_BUILD_TYPE AND NOT DEFINED CMAKE_CONFIGURATION_TYPES)
set(CMAKE_BUILD_TYPE Release CACHE STRING "Build type" FORCE)
set_property(CACHE CMAKE_BUILD_TYPE PROPERTY STRINGS "Debug" "Release" "MinSizeRel" "RelWithDebInfo")
endif()
find_package(Qt6 COMPONENTS Core Gui Widgets REQUIRED)
qt_standard_project_setup()
qt_add_executable(foxogram)
include(FetchContent)
FetchContent_Declare(libfoxogram GIT_REPOSITORY https://github.com/Foxocorp/foxogram-lib
GIT_TAG main
)
FetchContent_MakeAvailable(libfoxogram)
target_link_libraries(foxogram PUBLIC libfoxogram
Qt6::Core
Qt6::Gui
Qt6::Widgets
)
set(sources
include/IconButton.h
include/DigitInput.h
include/FoxogramLoginForm.h
include/FoxogramSignupForm.h
include/FoxogramMainWindow.h
include/FoxogramModal.h
include/FoxogramVerifyEmailModal.h
src/IconButton.cpp
src/DigitInput.cpp
src/FoxogramLoginForm.cpp
src/FoxogramSignupForm.cpp
src/FoxogramMainWindow.cpp
src/FoxogramModal.cpp
src/FoxogramVerifyEmailModal.cpp
src/main.cpp
src/ui/FoxogramSignup.ui
src/ui/FoxogramLogin.ui
src/ui/FoxogramModal.ui
src/ui/assets.qrc
)
target_include_directories(foxogram
PUBLIC
"$<BUILD_INTERFACE:${CMAKE_CURRENT_SOURCE_DIR}/include>"
"$<BUILD_INTERFACE:${CMAKE_CURRENT_BINARY_DIR}/include>"
)
source_group(TREE "${CMAKE_CURRENT_SOURCE_DIR}" FILES ${sources})
set_target_properties(foxogram PROPERTIES
MACOSX_BUNDLE TRUE
)
include(CMakePackageConfigHelpers)
target_sources(foxogram PRIVATE ${sources})
qt_generate_deploy_app_script(
TARGET foxogram
OUTPUT_SCRIPT deploy_script
NO_UNSUPPORTED_PLATFORM_ERROR
)
set_target_properties(foxogram PROPERTIES
SOVERSION ${PROJECT_VERSION})
install(TARGETS foxogram
BUNDLE DESTINATION .
RUNTIME DESTINATION ${CMAKE_INSTALL_BINDIR}
)
install(SCRIPT ${deploy_script})
if (APPLE)
install(CODE "execute_process(COMMAND cp \"${OPENSSL_SSL_LIBRARY}\" \"${CMAKE_INSTALL_PREFIX}/foxogram.app/Contents/Frameworks/libssl.3.dylib\")
execute_process(COMMAND cp \"${OPENSSL_CRYPTO_LIBRARY}\" \"${CMAKE_INSTALL_PREFIX}/foxogram.app/Contents/Frameworks/libcrypto.3.dylib\")")
elseif (WIN32)
find_package(OpenSSL COMPONENTS SSL Crypto REQUIRED)
if(OPENSSL_VERSION VERSION_GREATER_EQUAL "3.0.0")
set(openssldlls "${OPENSSL_INCLUDE_DIR}/../libssl-3-x64.dll;${OPENSSL_INCLUDE_DIR}/../libcrypto-3-x64.dll")
else ()
set(openssldlls "${OPENSSL_INCLUDE_DIR}/../libssl-1_1-x64.dll;${OPENSSL_INCLUDE_DIR}/../libcrypto-1_1-x64.dll")
endif ()
install(FILES ${openssldlls}
DESTINATION ${CMAKE_INSTALL_BINDIR})
elseif (UNIX)
install(FILES ${OPENSSL_LIBRARIES}
DESTINATION ${CMAKE_INSTALL_BINDIR})
endif()
set(CPACK_BUNDLE_STARTUP_COMMAND ${PROJECT_BINARY_DIR}/startup.sh)