forked from thclark/cpplot
-
Notifications
You must be signed in to change notification settings - Fork 0
/
CMakeLists.txt
38 lines (23 loc) · 1.1 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
cmake_minimum_required(VERSION 3.6)
project(cpplot)
# Add cmake modules
set(CMAKE_MODULE_PATH ${CMAKE_MODULE_PATH} "${CMAKE_SOURCE_DIR}/cmake/")
# Set make options
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -std=c++11")
set(CMAKE_VERBOSE_MAKEFILE ON)
# Add directories where third party tools exist
set(THIRD_PARTY_DIR ${CMAKE_SOURCE_DIR}/../thirdparty)
message("-- Defined THIRD_PARTY_DIR: ${THIRD_PARTY_DIR}")
if (${CMAKE_HOST_SYSTEM_NAME} STREQUAL "Windows")
# Set run-time library building default to static. This only applies to MSVS compiler,
# since all google units have default MT.
set(CMAKE_CXX_FLAGS_RELEASE "${CMAKE_CXX_FLAGS_RELEASE} /MT")
set(CMAKE_CXX_FLAGS_DEBUG "${CMAKE_CXX_FLAGS_DEBUG} /MTd")
# If windows, set find_library_suffixes to both static and shared(.lib; .dll)
set(CMAKE_FIND_LIBRARY_SUFFIXES ${CMAKE_SHARED_LIBRARY_SUFFIX} ${CMAKE_STATIC_LIBRARY_SUFFIX})
endif()
# Add include directories so the test routines can pick up the library contents
include_directories(source)
# Add the souce and test directories
add_subdirectory(source)
add_subdirectory(test)