-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathCMakeLists.txt
28 lines (21 loc) · 950 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
cmake_minimum_required(VERSION 2.8)
project(data_set)
set(project_SRCS main.cpp data_set.cpp item.cpp string_clean.cpp)
SET(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -std=c++11 -Wall -lboost_program_options")
add_executable(${PROJECT_NAME} ${project_SRCS})
option(build_tests "Build the project's unit tests" OFF)
if (build_tests) # cmake -Dbuild_tests=BOOL:ON <path>
add_subdirectory(tests)
if(DEFINED ENV{GTEST_ROOT})
# e.g.(Linux) export GTEST_ROOT=/home/michael/gtest/gtest-1.6.0
message("... using gtest found in $ENV{GTEST_ROOT}")
ELSE()
message("GTEST_ROOT is not defined. You must tell CMAKE where to find
the gtest_source")
#exit early
return()
endif()
# a target binary directory is specified for out of tree sources
add_subdirectory($ENV{GTEST_ROOT} ${CMAKE_CURRENT_BINARY_DIR}/gtest)
#add_subdirectory($ENV{GMOCK_ROOT} ${CMAKE_CURRENT_BINARY_DIR}/gmock)
endif()