-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathCMakeLists.txt
64 lines (43 loc) · 1.43 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
cmake_minimum_required(VERSION 3.22)
project(pg-fort VERSION 0.1.0)
# compiler settings
include(CheckCXXCompilerFlag)
check_cxx_compiler_flag("-std=c++20" COMPILER_SUPPORTS_CXX20)
if(NOT COMPILER_SUPPORTS_CXX20)
message(FATAL_ERROR "The compiler ${CMAKE_CXX_COMPILER} has no C++20 support. Please use a different C++ compiler.")
endif()
set(CMAKE_C_STANDARD 99)
set(CMAKE_CXX_STANDARD 20)
set(CMAKE_CXX_STANDARD_REQUIRED ON)
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -std=c++20")
option(BUILD_SHARED_LIBS "Build using shared libraries" ON)
# path
set(CMAKE_LIBRARY_PATH /usr/lib/x86_64-linux-gnu)
# dependencies
find_package(PkgConfig)
# libpqxx
pkg_check_modules(LIBPQXX REQUIRED libpqxx)
# libctemplate
pkg_check_modules(LIBCTEMPLATE REQUIRED libctemplate)
# protobuf
find_package(Protobuf REQUIRED)
include_directories(${Protobuf_INCLUDE_DIRS})
# libpg_query
find_library(LIBPG_QUERY pg_query)
# executable
add_subdirectory(src/bin/pg-fort)
# libraries
add_subdirectory(src/lib/common)
add_subdirectory(src/lib/concurrency)
add_subdirectory(src/lib/conn)
add_subdirectory(src/lib/proxy-server)
add_subdirectory(src/lib/query)
add_subdirectory(src/lib/schema)
add_subdirectory(src/lib/session)
add_subdirectory(src/lib/state-machine)
# tests
add_subdirectory(tests)
# cpack
set(CPACK_PROJECT_NAME ${PROJECT_NAME})
set(CPACK_PROJECT_VERSION ${PROJECT_VERSION})
include(CPack)