-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathCMakeLists.txt
40 lines (30 loc) · 1.05 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
cmake_minimum_required (VERSION 3.8)
project ("GenAppUtils")
enable_testing()
set(CMAKE_CXX_STANDARD 17)
set(CMAKE_CXX_STANDARD_REQUIRED ON)
set(CMAKE_CXX_EXTENSIONS OFF)
if(CMAKE_CXX_COMPILER_ID STREQUAL "MSVC")
SET(COMPILER_FLAGS "/D WIN32 /W4 /WX /EHsc")
else()
SET(COMPILER_FLAGS "-g -Wall -Werror -pedantic -pedantic-errors -Wextra -Wwrite-strings")
endif()
SET(CMAKE_CXX_FLAGS " ${COMPILER_FLAGS}")
SET(CMAKE_LIBRARY_OUTPUT_DIRECTORY "${CMAKE_BINARY_DIR}")
SET(CMAKE_RUNTIME_OUTPUT_DIRECTORY "${CMAKE_BINARY_DIR}")
SET(CMAKE_ARCHIVE_OUTPUT_DIRECTORY "${CMAKE_BINARY_DIR}")
#3rdparties area
if(NOT DEFINED MEM_MODEL)
message( FATAL_ERROR "Memory model not defined, exiting...")
else()
if("x64" STREQUAL MEM_MODEL)
SET(3RDPARTIES_ROOT_ARCH "${3RDPARTIES_ROOT}/x64")
else()
SET(3RDPARTIES_ROOT_ARCH "${3RDPARTIES_ROOT}/x86")
endif()
endif()
message("Using root 3rdparties from ${3RDPARTIES_ROOT_ARCH}")
#GoogleTest
SET(GOOGLETEST_INC "${3RDPARTIES_ROOT_ARCH}/googletest/include")
SET(GOOGLETEST_LIB "${3RDPARTIES_ROOT_ARCH}/googletest/lib")
add_subdirectory ("src")