forked from SpatioTemporal/STARE
-
Notifications
You must be signed in to change notification settings - Fork 0
/
CMakeLists.txt
50 lines (37 loc) · 1.71 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
cmake_minimum_required(VERSION 3.4)
project(STARE)
option(CUTE_INCLUDE_DIR "Location of the CUTE headers." ON )
if(DEFINED ENV{CUTE_INCLUDE_DIR})
set( CUTE_INCLUDE_DIR $ENV{CUTE_INCLUDE_DIR} )
endif()
# If an environment variable was not set, then guess.
if(CUTE_INCLUDE_DIR MATCHES "ON")
set( CUTE_INCLUDE_DIR ${PROJECT_SOURCE_DIR}/cute )
endif()
message("\n------------ Running cmake for project STARE ------------\n")
if(EXISTS "${CUTE_INCLUDE_DIR}")
message( " CUTE_INCLUDE_DIR: ${CUTE_INCLUDE_DIR}\n ")
else()
message( FATAL_ERROR " CUTE_INCLUDE_DIR not found! ${CUTE_INCLUDE_DIR}\n ")
endif()
# Set CC and CXX before calling cmake...
# set(CMAKE_C_COMPILER gcc)
# set(CMAKE_CXX_COMPILER g++)
if(${CMAKE_SYSTEM_NAME} MATCHES "Darwin")
set(CMAKE_C_FLAGS "-g -Wall -D_BOOL_EXISTS -D__macosx -UDIAGNOSE -fPIC ${CMAKE_C_FLAGS}")
set(CMAKE_CXX_FLAGS "-std=c++11 -g -Wall -D_BOOL_EXISTS -D__macosx -UDIAGNOSE -fPIC ${CMAKE_CXX_FLAGS}")
elseif(UNIX)
set(CMAKE_C_FLAGS "-g -Wall -D_BOOL_EXISTS -D__unix -UDIAGNOSE -fPIC ${CMAKE_C_FLAGS}")
set(CMAKE_CXX_FLAGS "-std=c++11 -g -Wall -D_BOOL_EXISTS -D__unix -UDIAGNOSE -fPIC ${CMAKE_CXX_FLAGS}")
else()
message(FATAL_ERROR " Platform ${CMAKE_SYSTEM_NAME} not handled.")
endif()
#add_subdirectory is used when the subdirectory has its own CMakeLists.txt
# Otherwise, include_directories is used to access files in the directory
include_directories(${PROJECT_SOURCE_DIR}/include )
add_subdirectory(${PROJECT_SOURCE_DIR}/tests/CUTE)
add_subdirectory(${PROJECT_SOURCE_DIR}/src)
add_subdirectory(${PROJECT_SOURCE_DIR}/app)
#target_include_directories(hstm PUBLIC ${CUTE_INCLUDE_DIR}/cute)
#file(GLOB SOURCES "/src/")
#add_library( STARE STATIC ${SOURCES} )