-
Notifications
You must be signed in to change notification settings - Fork 0
/
CMakeLists.txt
53 lines (42 loc) · 1.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
cmake_minimum_required(VERSION 3.20)
# Enable IDE folders
set_property(GLOBAL PROPERTY USE_FOLDERS ON)
# Force x86_64 architecture on MacOSX
if(APPLE)
set(CMAKE_OSX_ARCHITECTURES "x86_64")
# Disable deprecation warnings
add_compile_options(
-Wno-deprecated-declarations
)
endif()
list(APPEND CMAKE_MODULE_PATH "${CMAKE_CURRENT_SOURCE_DIR}/cmake")
# Get the latest abbreviated commit hash of the working branch
execute_process(
COMMAND git log -1 --format=%h
WORKING_DIRECTORY ${CMAKE_CURRENT_LIST_DIR}
OUTPUT_VARIABLE GIT_HASH
OUTPUT_STRIP_TRAILING_WHITESPACE
)
# Get the current working branch
if(NOT DEFINED GIT_BRANCH)
execute_process(
COMMAND git rev-parse --abbrev-ref HEAD
WORKING_DIRECTORY ${CMAKE_CURRENT_LIST_DIR}
OUTPUT_VARIABLE GIT_BRANCH
OUTPUT_STRIP_TRAILING_WHITESPACE
)
endif()
project(gmsv_async_postgres
VERSION 1.0.0
LANGUAGES C CXX
HOMEPAGE_URL "https://github.com/Pika-Software/gmsv_async_postgres"
)
# Enable -fPIC flag
set(CMAKE_POSITION_INDEPENDENT_CODE ON)
# Require C++ 17
set(CMAKE_CXX_STANDARD 17)
set(CMAKE_CXX_STANDARD_REQUIRED ON)
set(CMAKE_CXX_EXTENSIONS OFF)
find_package(PostgreSQL REQUIRED)
find_package(GarrysmodCommon REQUIRED)
add_subdirectory(source)