-
Notifications
You must be signed in to change notification settings - Fork 5
/
CMakeLists.txt
75 lines (64 loc) · 2.16 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
65
66
67
68
69
70
71
72
73
74
75
# :copyright: (c) 2017 Alex Huszagh.
# :license: MIT, see licenses/mit.md for more details.
set(CMAKE_LEGACY_CYGWIN_WIN32 1)
cmake_minimum_required(VERSION 2.8)
project(multi_index CXX)
enable_testing()
# FLAGS
# -----
set(CMAKE_CXX_STANDARD 14)
set(CXX_STANDARD TRUE)
include_directories(include third_party/brigand/include)
if(${CMAKE_CXX_COMPILER_ID} STREQUAL "GNU")
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -Werror -std=c++14")
elseif(${CMAKE_CXX_COMPILER_ID} STREQUAL "Clang")
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -Werror -std=c++14")
elseif(MSVC)
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} /std:c++14 -WX")
set(CMAKE_CXX_FLAGS_DEBUG "${CMAKE_CXX_FLAGS_DEBUG} /MTd /Od /Fd${CMAKE_BINARY_DIR}/${PROJECT_NAME}.pdb")
set(CMAKE_CXX_FLAGS_RELEASE "${CMAKE_CXX_FLAGS_RELEASE} /MT /Ox /Zi /Fd${CMAKE_BINARY_DIR}/${PROJECT_NAME}.pdb")
set(CMAKE_CXX_FLAGS_MINSIZEREL "${CMAKE_CXX_FLAGS_MINSIZEREL} /MT /Zi /Fd${CMAKE_BINARY_DIR}/${PROJECT_NAME}.pdb")
set(CMAKE_CXX_FLAGS_RELWITHDEBINFO "${CMAKE_CXX_FLAGS_RELWITHDEBINFO} /MT /Fd${CMAKE_BINARY_DIR}/${PROJECT_NAME}.pdb")
endif()
if(BUILD_STATIC)
if(MINGW OR MSYS OR CYGWIN)
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -static")
elseif(UNIX)
set(CMAKE_POSITION_INDEPENDENT_CODE ON)
add_definitions(-fPIC)
endif()
endif()
# TESTS
# -----
set(TEST_FILES
test/test_all_main.cpp
test/test_basic.cpp
test/test_capacity.cpp
test/test_comparison.cpp
# test/test_composite_key.cpp
test/test_conv_iterators.cpp
test/test_copy_assignment.cpp
test/test_hash_ops.cpp
test/test_iterators.cpp
test/test_key_extractors.cpp
# test/test_list_ops.cpp
test/test_modifiers.cpp
test/test_mpl_ops.cpp
test/test_observers.cpp
test/test_projection.cpp
test/test_range.cpp
# test/test_rearrange.cpp
test/test_set_ops.cpp
test/test_special_set_ops.cpp
test/test_update.cpp
)
add_executable(multi_index_tests ${TEST_FILES})
if(MSVC)
set_target_properties(multi_index_tests PROPERTIES
COMPILE_OPTIONS "/EHsc"
)
endif()
add_test(NAME multi_index_tests
COMMAND multi_index_tests
WORKING_DIRECTORY ${CMAKE_CURRENT_SOURCE_DIR}
)