-
Notifications
You must be signed in to change notification settings - Fork 0
/
CMakeLists.txt
executable file
·44 lines (31 loc) · 1.3 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
cmake_minimum_required(VERSION 3.4.1)
project(StringAdapter)
include_directories(include)
set(CMAKE_CXX_STANDARD 17)
set(CMAKE_CXX_STANDARD_REQUIRED ON)
if(NOT COMMAND testBuilder_build)
add_subdirectory(testBuilder)
testBuilder_set_current_working_directory_to_default_binary_directory()
endif()
add_subdirectory(LibObj)
testBuilder_add_include(StringAdapter include)
testBuilder_add_source(StringAdapter src/indexed_iterator.cpp)
testBuilder_add_library(StringAdapter LibObj)
testBuilder_build_shared_library(StringAdapter)
if (NOT TARGET gtest AND NOT TARGET gtest_main)
# Prevent overriding the parent project's compiler/linker
# settings on Windows
set(gtest_force_shared_crt ON CACHE BOOL "" FORCE)
# Add googletest directly to our build. This defines
# the gtest and gtest_main targets.
add_subdirectory(googletest)
# The gtest/gtest_main targets carry header search path
# dependencies automatically when using CMake 2.8.11 or
# later. Otherwise we have to add them here ourselves.
if (CMAKE_VERSION VERSION_LESS 2.8.11)
include_directories("${gtest_SOURCE_DIR}/include")
endif()
endif()
# Now simply link against gtest or gtest_main as needed. Eg
add_subdirectory(tests)
set(STRING_ADAPTER_INCLUDE ${CMAKE_CURRENT_SOURCE_DIR}/include PARENT_SCOPE)