-
Notifications
You must be signed in to change notification settings - Fork 333
/
CMakeLists.txt
48 lines (37 loc) · 1.56 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
cmake_minimum_required(VERSION 3.0)
project(magent)
IF (APPLE)
set(CMAKE_CXX_COMPILER "/usr/local/opt/llvm/bin/clang++")
link_directories("/usr/local/opt/llvm/lib")
include_directories( "/usr/local/include" )
link_directories("/usr/local/lib/")
ENDIF()
file(GLOB autopilot_sources src/*.cc src/gridworld/*.cc src/discrete_snake/*.cc src/utility/*.cc)
set(LIB_SRC_FILES ${autopilot_sources})
file(GLOB autopilot_sources src/render/*.cc src/render/*/*.cc src/render/*/*/*.cc)
set(RENDER_SRC_FILES ${autopilot_sources})
set (CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -g -Wall -std=c++11 -O3")
set (CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -Wno-unused-variable -Wno-reorder -Wno-sign-compare -Wno-missing-braces")
set (CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -fopenmp -pthread -DDEBUG")
# runtime library
add_library(magent SHARED ${LIB_SRC_FILES})
add_executable(testlib ${LIB_SRC_FILES})
# render
add_executable(render ${RENDER_SRC_FILES})
IF (APPLE)
target_link_libraries(render boost_system jsoncpp argp omp)
ELSE()
target_link_libraries(render boost_system jsoncpp)
ENDIF()
set_target_properties( render
PROPERTIES
RUNTIME_OUTPUT_DIRECTORY "${CMAKE_BINARY_DIR}/render/")
# copy frontend and demo
add_custom_command(
TARGET render POST_BUILD
COMMAND ${CMAKE_COMMAND} -E copy_directory "${CMAKE_SOURCE_DIR}/src/render/frontend/" "${CMAKE_BINARY_DIR}/render"
)
add_custom_command(
TARGET render POST_BUILD
COMMAND ${CMAKE_COMMAND} -E copy_directory "${CMAKE_SOURCE_DIR}/src/render/backend/demo/" "${CMAKE_BINARY_DIR}/render/"
)