CMakeLists.txt 902 Bytes
Newer Older
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
cmake_minimum_required(VERSION 3.5)
set(CMAKE_CXX_STANDARD 14)

project(torcs_agent_torcsAgent LANGUAGES CXX)

#set cmake module path
set(CMAKE_MODULE_PATH ${CMAKE_MODULE_PATH} ${CMAKE_CURRENT_SOURCE_DIR}/cmake)

# add dependencies
find_package(Armadillo REQUIRED)
set(INCLUDE_DIRS ${INCLUDE_DIRS} ${Armadillo_INCLUDE_DIRS})
set(LIBS ${LIBS} ${Armadillo_LIBRARIES})

# additional commands
set(LIBS ${LIBS} mxnet)

# create static library
include_directories(${INCLUDE_DIRS})
add_library(torcs_agent_torcsAgent torcs_agent_torcsAgent.cpp)
target_include_directories(torcs_agent_torcsAgent PUBLIC ${CMAKE_CURRENT_SOURCE_DIR} ${INCLUDE_DIRS})
target_link_libraries(torcs_agent_torcsAgent PUBLIC ${LIBS})
set_target_properties(torcs_agent_torcsAgent PROPERTIES LINKER_LANGUAGE CXX)

# export cmake project
export(TARGETS torcs_agent_torcsAgent FILE torcs_agent_torcsAgent.cmake)

# additional commands end