-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathCMakeLists.txt
43 lines (33 loc) · 1.09 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
cmake_minimum_required(VERSION 3.0)
project(interpolation)
if(MSVC)
add_definitions(/bigobj)
else()
set(DEBUG_FLAGS "-std=c++14")
set(RELEASE_FLAGS "-std=c++14")
set(CMAKE_CXX_FLAGS ${RELEASE_FLAGS})
set(CMAKE_CXX_FLAGS_DEBUG ${DEBUG_FLAGS})
endif()
file(GLOB_RECURSE srcs src/*.cpp include/interpolation/*.h)
# Organize files into directories
foreach(FILE ${srcs})
# Get the directory of the source file
get_filename_component(PARENT_DIR "${FILE}" PATH)
# Remove common directory prefix to make the group
string(REPLACE "${CMAKE_CURRENT_SOURCE_DIR}" "" GROUP "${PARENT_DIR}")
if(MSVC)
# Make sure we are using windows slashes
string(REPLACE "/" "\\" GROUP "${GROUP}")
endif()
# Group into "Source Files" and "Header Files"
if ("${FILE}" MATCHES ".*\\.cpp")
set(GROUP "Source Files${GROUP}")
elseif("${FILE}" MATCHES ".*\\.h")
set(GROUP "Header Files${GROUP}")
endif()
source_group("${GROUP}" FILES "${FILE}")
endforeach()
include_directories(include)
include_directories(../eigen)
include_directories(../json/include)
add_executable(${PROJECT_NAME} ${srcs})