-
Notifications
You must be signed in to change notification settings - Fork 0
/
CMakeLists.txt
64 lines (49 loc) · 2.06 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
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
cmake_minimum_required(VERSION 2.8)
if(CMAKE_COMPILER_IS_GNUCXX)
exec_program(
${CMAKE_CXX_COMPILER}
ARGS -dumpversion
OUTPUT_VARIABLE gcc_compiler_version)
message(STATUS "C++ compiler version: ${gcc_compiler_version} [${CMAKE_CXX_COMPILER}]")
if(gcc_compiler_version VERSION_LESS "4.5.2")
message(FATAL_ERROR "g++ version must be greater or equal to 4.5.2")
endif(gcc_compiler_version VERSION_LESS "4.5.2")
set(CMAKE_CXX_FLAGS "-std=c++0x")
endif(CMAKE_COMPILER_IS_GNUCXX)
if(MSVC)
if(MSVC_VERSION LESS 1600)
message(FATAL_ERROR "MSVC version must be greater of equal to 10.0")
endif(MSVC_VERSION LESS 1600)
endif(MSVC)
# Enumerate source files
file(GLOB src_policy src/policy/*.cpp)
file(GLOB src_value_function src/value_function/*.cpp)
file(GLOB src_detail src/detail/*.cpp)
set(src_detail_fann
src/detail/fann/doublefann.h
src/detail/fann/doublefann.c
src/detail/fann/fann_cpp.h)
# Enumerate header files
file(GLOB hdr rll/*.hpp)
file(GLOB hdr_policy rll/policy/*.hpp)
file(GLOB hdr_value_function rll/value_function/*.hpp)
file(GLOB hdr_detail rll/detail/*.hpp)
add_definitions(-DFANN_NO_DLL -D_CRT_SECURE_NO_WARNINGS)
include_directories(${CMAKE_CURRENT_SOURCE_DIR})
set(all_files
${hdr} ${hdr_policy} ${hdr_value_function} ${hdr_detail}
${src_policy} ${src_value_function} ${src_detail} ${src_detail_fann})
add_library(rll.int STATIC ${all_files})
add_library(rll.double STATIC ${all_files})
set_target_properties(rll.int PROPERTIES COMPILE_DEFINITIONS "RLL_INT")
set_target_properties(rll.double PROPERTIES COMPILE_DEFINITIONS "RLL_DOUBLE")
source_group(rll FILES ${hdr})
source_group(rll\\policy FILES ${hdr_policy})
source_group(rll\\value_function FILES ${hdr_value_function})
source_group(rll\\detail FILES ${hdr_detail})
source_group(src\\policy FILES ${src_policy})
source_group(src\\value_function FILES ${src_value_function})
source_group(src\\detail FILES ${src_detail})
source_group(src\\detail\\fann FILES ${src_detail_fann})
add_custom_target(doc COMMAND doxygen WORKING_DIRECTORY "${CMAKE_CURRENT_SOURCE_DIR}")
add_subdirectory(examples)