forked from mhauskn/dqn
-
Notifications
You must be signed in to change notification settings - Fork 0
/
CMakeLists.txt
50 lines (39 loc) · 1.55 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
cmake_minimum_required (VERSION 2.6)
project(dqn)
option(CAFFE_CPU_ONLY "Use CPU only for Caffe" OFF)
option(USE_SDL "Use SDL for ALE" ON)
# Edit these paths to point to your caffe & ALE installations
set(ALE_ROOT_DIR "~/projects/Arcade-Learning-Environment")
set(CAFFE_ROOT_DIR "~/projects/caffe")
list(APPEND CMAKE_PREFIX_PATH ${ALE_ROOT_DIR} ${CAFFE_ROOT_DIR})
add_executable(dqn dqn_main.cpp dqn.cpp)
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -std=c++11 -O3 -march=native -Wno-deprecated-declarations")
list(APPEND CMAKE_MODULE_PATH "${CMAKE_SOURCE_DIR}/cmake/Modules")
find_package(Boost 1.40 COMPONENTS filesystem system REQUIRED)
include_directories(${Boost_INCLUDE_DIRS})
target_link_libraries(dqn ${Boost_LIBRARIES})
find_package(GFLAGS REQUIRED)
include_directories(${GFLAGS_INCLUDE_DIR})
target_link_libraries(dqn ${GFLAGS_LIBRARY})
find_package(GLOG REQUIRED)
include_directories(${GLOG_INCLUDE_DIRS})
target_link_libraries(dqn ${GLOG_LIBRARIES})
include(FindProtobuf)
find_package(Protobuf REQUIRED)
include_directories(${PROTOBUF_INCLUDE_DIRS})
target_link_libraries(dqn ${PROTOBUF_LIBRARIES})
find_package(CAFFE REQUIRED)
include_directories(${CAFFE_INCLUDE_DIRS})
target_link_libraries(dqn ${CAFFE_LIBRARIES})
find_package(ALE REQUIRED)
include_directories(${ALE_INCLUDE_DIRS})
target_link_libraries(dqn ${ALE_LIBRARIES})
if(USE_SDL)
find_package(SDL REQUIRED)
add_definitions(-D__USE_SDL)
include_directories(${SDL_INCLUDE_DIR})
target_link_libraries(dqn ${SDL_LIBRARY} ${SDL_MAIN_LIBRARY})
endif()
if(CPU_ONLY)
add_definitions(-DCPU_ONLY)
endif()