-
Notifications
You must be signed in to change notification settings - Fork 1
/
CMakeLists.txt
51 lines (41 loc) · 1.4 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.28.2)
# Get version
file(READ ${CMAKE_CURRENT_SOURCE_DIR}/props.json PROPS)
string(JSON VER GET ${PROPS} version)
# find curl
find_package(CURL REQUIRED)
project(stc
DESCRIPTION "Easily download collections and mods from steam."
VERSION ${VER})
set(CMAKE_CXX_STANDARD 26)
# check if build type is set if it isnt set it to release
if(NOT CMAKE_BUILD_TYPE)
set(DCKMAKE_BUILD_TYPE Release)
endif()
# Add the path to the source files for stc
file(GLOB_RECURSE STC_SOURCE_FILES "src/*.cpp")
# add compiler flags
set(CMAKE_CXX_FLAGS_DEBUG "-g")
set(CMAKE_CXX_FLAGS_RELEASE "-03")
# Add the executable target for stc
add_executable(stc ${STC_SOURCE_FILES})
install(TARGETS stc DESTINATION bin)
# add curl libraries
target_link_libraries(stc PRIVATE ${CURL_LIBRARIES})
target_include_directories(stc PRIVATE ${CURL_INCLUDE_DIRS})
# DEBIAN
set(CPACK_DEBIAN_PACKAGE_MAINTAINER "DRAGONTOS")
set(CPACK_DEBIAN_PACKAGE_LICENSE "GPLv3")
set(CPACK_DEBIAN_PACKAGE_DESCRIPTION ${DESCRIPTION})
set(CPACK_DEBIAN_PACKAGE_RELEASE_DIST ON)
set(CPACK_GENERATOR DEBIAN)
set(CPACK_PACKAGING_INSTALL_PREFIX "/usr")
# RPM
set(CPACK_PACKAGE_VENDOR "DRAGONTOS")
set(CPACK_RPM_PACKAGE_LICENSE "GPLv3")
set(CPACK_RPM_PACKAGE_DESCRIPTION ${DESCRIPTION})
set(CPACK_RPM_FILE_NAME "RPM-DEFAULT")
set(CPACK_RPM_PACKAGE_RELEASE_DIST ON)
set(CPACK_GENERATOR RPM)
set(CPACK_PACKAGING_INSTALL_PREFIX "/usr")
include(CPack)