-
Notifications
You must be signed in to change notification settings - Fork 23
/
Copy pathCMakeLists.txt
61 lines (47 loc) · 2.7 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
cmake_minimum_required (VERSION 2.8.12)
project(dqn-hfo)
add_definitions(${Caffe_DEFINITIONS})
option(CPU_ONLY "Use CPU only for Caffe" OFF)
if(CPU_ONLY)
add_definitions(-DCPU_ONLY)
endif()
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -std=c++11 -march=native -Wno-deprecated-declarations")
list(APPEND CMAKE_MODULE_PATH "${CMAKE_SOURCE_DIR}/cmake/Modules")
find_package(Boost 1.40 COMPONENTS filesystem system iostreams regex REQUIRED)
include_directories(${Boost_INCLUDE_DIRS})
find_package(GFLAGS REQUIRED)
include_directories(${GFLAGS_INCLUDE_DIR})
find_package(GLOG REQUIRED)
include_directories(${GLOG_INCLUDE_DIRS})
include(FindProtobuf)
find_package(Protobuf REQUIRED)
include_directories(${PROTOBUF_INCLUDE_DIRS})
find_package(CAFFE REQUIRED)
include_directories(${CAFFE_INCLUDE_DIRS})
find_package(HFO REQUIRED)
include_directories(${HFO_INCLUDE_DIRS})
file(GLOB SOURCES ${CMAKE_CURRENT_SOURCE_DIR}/src/*.cpp)
add_executable(dqn ${SOURCES})
target_link_libraries(dqn ${Boost_LIBRARIES})
target_link_libraries(dqn ${GFLAGS_LIBRARY})
target_link_libraries(dqn ${GLOG_LIBRARIES})
target_link_libraries(dqn ${PROTOBUF_LIBRARIES})
target_link_libraries(dqn ${CAFFE_LIBRARIES})
target_link_libraries(dqn ${HFO_LIBRARIES})
set_target_properties(dqn PROPERTIES RUNTIME_OUTPUT_DIRECTORY ${CMAKE_CURRENT_SOURCE_DIR}/bin)
configure_file(${CMAKE_CURRENT_SOURCE_DIR}/src/hfo_policies/dummy_teammate.cxx ${CMAKE_CURRENT_SOURCE_DIR}/build/src/hfo_policies/dummy_teammate.cpp)
add_executable(dummy_teammate ${CMAKE_CURRENT_SOURCE_DIR}/build/src/hfo_policies/dummy_teammate.cpp)
set_target_properties(dummy_teammate PROPERTIES RUNTIME_OUTPUT_DIRECTORY ${CMAKE_CURRENT_SOURCE_DIR}/bin)
target_link_libraries(dummy_teammate ${HFO_LIBRARIES})
configure_file(${CMAKE_CURRENT_SOURCE_DIR}/src/hfo_policies/dummy_goalie.cxx ${CMAKE_CURRENT_SOURCE_DIR}/build/src/hfo_policies/dummy_goalie.cpp)
add_executable(dummy_goalie ${CMAKE_CURRENT_SOURCE_DIR}/build/src/hfo_policies/dummy_goalie.cpp)
set_target_properties(dummy_goalie PROPERTIES RUNTIME_OUTPUT_DIRECTORY ${CMAKE_CURRENT_SOURCE_DIR}/bin)
target_link_libraries(dummy_goalie ${HFO_LIBRARIES})
configure_file(${CMAKE_CURRENT_SOURCE_DIR}/src/hfo_policies/chaser.cxx ${CMAKE_CURRENT_SOURCE_DIR}/build/src/hfo_policies/chaser.cpp)
add_executable(chaser ${CMAKE_CURRENT_SOURCE_DIR}/build/src/hfo_policies/chaser.cpp)
set_target_properties(chaser PROPERTIES RUNTIME_OUTPUT_DIRECTORY ${CMAKE_CURRENT_SOURCE_DIR}/bin)
target_link_libraries(chaser ${HFO_LIBRARIES})
add_custom_command(TARGET dqn POST_BUILD
COMMAND ln -sf ${HFO_ROOT_DIR}/bin/HFO ${CMAKE_CURRENT_SOURCE_DIR}/bin/)
add_custom_command(TARGET dqn POST_BUILD
COMMAND ln -sf ${HFO_ROOT_DIR}/bin/teams/base/config/formations-dt ${CMAKE_CURRENT_SOURCE_DIR}/bin/)