-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathCMakeLists.txt
50 lines (39 loc) · 1.28 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
cmake_minimum_required(VERSION 3.11)
set (CMAKE_CXX_STANDARD 17)
project(tejk_it_izi)
#build app test
set(BUILD_TEJK_IT_IZI_TESTS OFF CACHE BOOL "build tests of the application modules")
#variables for gtest
set(BUILD_GTEST ON CACHE BOOL "force build gtest" FORCE)
set(gtest_force_shared_crt ON CACHE BOOL "force shared crt for windows" FORCE)
#variables for postgresql connector
set(SKIP_BUILD_TEST TRUE)
set(BUILD_TEST FALSE)
set(SKIP_PQXX_SHARED TRUE)
include(FetchContent)
#not entirely sure if it works this way?
set(FETCHCONTENT_UPDATES_DISCONNECTED ON CACHE BOOL "dont update 3rd party libs" FORCE)
FetchContent_Declare(
googletest
GIT_REPOSITORY https://github.com/google/googletest.git
GIT_TAG release-1.8.0
)
FetchContent_Declare(
libpqxx
GIT_REPOSITORY https://github.com/jtv/libpqxx.git
GIT_TAG 6.4.4 #later versions force c++17
)
if(BUILD_TEJK_IT_IZI_TESTS)
FetchContent_GetProperties(googletest)
if(NOT googletest_POPULATED)
FetchContent_Populate(googletest)
add_subdirectory(${googletest_SOURCE_DIR} ${googletest_BINARY_DIR})
endif()
endif()
FetchContent_GetProperties(libpqxx)
if(NOT libpqxx_POPULATED)
FetchContent_Populate(libpqxx)
add_subdirectory(${libpqxx_SOURCE_DIR} ${libpqxx_BINARY_DIR})
endif()
add_subdirectory(server)
add_subdirectory(client)