-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathCMakeLists.txt
31 lines (26 loc) · 981 Bytes
/
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
project("ext-stl" CXX C)
cmake_minimum_required(VERSION 2.6)
find_package(GTest REQUIRED)
find_package(Threads)
set(CMAKE_CXX_FLAGS_DEBUG "-DDEBUG -g -O0 -Wall -std=c++11")
set(CMAKE_CXX_FLAGS_RELEASE "-O2 -Wall -std=c++11")
include_directories(${CMAKE_CURRENT_SOURCE_DIR})
set(EXECUTABLE_OUTPUT_PATH ${CMAKE_BINARY_DIR}/bin)
if ("${CMAKE_BUILD_TYPE}" MATCHES "Debug")
aux_source_directory(${CMAKE_CURRENT_SOURCE_DIR}/test TEST_SRCS)
foreach(i ${TEST_SRCS})
get_filename_component(name ${i} NAME_WE)
set(name "${name}_unittest")
add_executable(${name} ${i})
target_link_libraries(${name} ${GTEST_BOTH_LIBRARIES})
target_link_libraries(${name} pthread)
endforeach()
endif()
if ("${CMAKE_BUILD_TYPE}" MATCHES "Release")
aux_source_directory(${CMAKE_CURRENT_SOURCE_DIR}/benchmark BENCH_SRCS)
foreach(i ${BENCH_SRCS})
get_filename_component(name ${i} NAME_WE)
set(name "${name}_bench")
add_executable(${name} ${i})
endforeach()
endif()