-
Notifications
You must be signed in to change notification settings - Fork 0
/
CMakeLists.txt
76 lines (57 loc) · 2.03 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
65
66
67
68
69
70
71
72
73
74
75
76
cmake_minimum_required (VERSION 2.6)
project (stochastic_games)
find_package (Threads)
option (TESTS
"Compile tests" OFF)
#Enable C++11
set(CMAKE_CXX_FLAGS
"${CMAKE_CXX_FLAGS} -std=c++11")
set(CMAKE_CXX_FLAGS "-Wall -Wextra ${CMAKE_CXX_FLAGS}")
if(APPLE)
set(EIGEN_INCLUDE_DIRS "/usr/local/include/eigen3" CACHE STRING "Path to eigen3 include dir")
#for glpk#
include_directories("/opt/local/include")
link_directories("/opt/local/lib")
else(APPLE)
find_package(PkgConfig)
pkg_search_module(EIGEN REQUIRED eigen3)
endif(APPLE)
set (DIRECTORIES
games
)
# Sub sources
foreach (DIRECTORY ${DIRECTORIES})
message("-- stochastic_games: Adding ${DIRECTORY}/")
set(SOURCES)
set(GRAPHIC_SOURCES)
include (${DIRECTORY}/Sources.cmake)
set (PREFIXED_SOURCES)
foreach (SOURCE ${SOURCES})
set (PREFIXED_SOURCES ${PREFIXED_SOURCES} ${DIRECTORY}/${SOURCE})
endforeach (SOURCE)
set (ALL_SOURCES ${ALL_SOURCES} ${PREFIXED_SOURCES})
endforeach (DIRECTORY)
include_directories(
"${PROJECT_SOURCE_DIR}"
"${EIGEN_INCLUDE_DIRS}"
)
add_library (stochastic_games ${ALL_SOURCES})
set (EXTRA_LIBS pthread)
set (EXTRA_LIBS ${EXTRA_LIBS} m stochastic_games glpk)
SET(CMAKE_RUNTIME_OUTPUT_DIRECTORY ${BINARY_DIR})
SET(EXECUTABLE_OUTPUT_PATH ${BINARY_DIR})
SET(LIBRARY_OUTPUT_PATH ${BINARY_DIR})
if (TESTS)
add_executable (test_zs_game tests/test_zs_game.cpp)
target_link_libraries (test_zs_game ${EXTRA_LIBS})
add_executable (test_li_game tests/test_li_game.cpp)
target_link_libraries (test_li_game ${EXTRA_LIBS})
add_executable (test_li_discretize tests/test_li_discretize.cpp)
target_link_libraries (test_li_discretize ${EXTRA_LIBS})
add_executable (test_li_discretize2 tests/test_li_discretize2.cpp)
target_link_libraries (test_li_discretize2 ${EXTRA_LIBS})
add_executable (test_glpk tests/test_glpk.cpp)
target_link_libraries (test_glpk ${EXTRA_LIBS})
add_executable (test_glpk2 tests/test_glpk2.cpp)
target_link_libraries (test_glpk2 ${EXTRA_LIBS})
endif (TESTS)