From 100835ba5e58118fd54ae7175f59896f260d2935 Mon Sep 17 00:00:00 2001 From: Philip Taylor Date: Fri, 3 Sep 2010 17:09:50 +0100 Subject: [PATCH] Added CMake build script. --- README | 10 ++++++++ build/CMakeLists.txt | 58 ++++++++++++++++++++++++++++++++++++++++++++ 2 files changed, 68 insertions(+) create mode 100644 build/CMakeLists.txt diff --git a/README b/README index 2e39de4..ea44970 100644 --- a/README +++ b/README @@ -55,6 +55,16 @@ studio 8 professional. They may also work with Express edition, but I've not tested that. +Building with CMake on Linux +---------------------------- + +The code can be built on Linux (and possibly on other platforms) +using CMake: + + cd build + cmake . + make + Documentation ------------- diff --git a/build/CMakeLists.txt b/build/CMakeLists.txt new file mode 100644 index 0000000..6030c64 --- /dev/null +++ b/build/CMakeLists.txt @@ -0,0 +1,58 @@ +cmake_minimum_required(VERSION 2.6) +project(AI4G) + +set(CMAKE_RUNTIME_OUTPUT_DIRECTORY ../bin) +set(CMAKE_ARCHIVE_OUTPUT_DIRECTORY ../lib) +set(SRC ../src) + +find_package(GLUT REQUIRED) + +include_directories(../include ${GLUT_INCLUDE_DIR} ${GL_INCLUDE_DIR}) + +add_library(aicore STATIC + ${SRC}/action.cpp + ${SRC}/aimath.cpp + ${SRC}/basesm.cpp + ${SRC}/core.cpp + ${SRC}/dectree.cpp + ${SRC}/kinematic.cpp + ${SRC}/learning.cpp + ${SRC}/location.cpp + ${SRC}/markovsm.cpp + ${SRC}/qlearning.cpp + ${SRC}/rules.cpp + ${SRC}/sm.cpp + ${SRC}/steering.cpp + ${SRC}/steerpipe.cpp + ${SRC}/timing.cpp + ${SRC}/demos/common/gl/app.cpp + ${SRC}/demos/common/gl/main.cpp +) + +set(DEMO_DEPS aicore ${GLUT_LIBRARY} ${OPENGL_LIBRARY}) + +add_executable(c03_flocking ${SRC}/demos/c03_flocking/flocking_demo.cpp ${SRC}/demos/c03_flocking/flock_steer.cpp) +add_executable(c03_kinematic ${SRC}/demos/c03_kinematic/kinematic_demo.cpp) +add_executable(c03_pipeline ${SRC}/demos/c03_pipeline/pipeline_demo.cpp) +add_executable(c03_priority ${SRC}/demos/c03_priority/priority_demo.cpp) +add_executable(c03_steering ${SRC}/demos/c03_steering/steering_demo.cpp) +add_executable(c05_action ${SRC}/demos/c05_action/action_demo.cpp) +add_executable(c05_dectree ${SRC}/demos/c05_dectree/dectree_demo.cpp) +add_executable(c05_hsm ${SRC}/demos/c05_hsm/hsm_demo.cpp) +add_executable(c05_markovsm ${SRC}/demos/c05_markovsm/markovsm_demo.cpp) +add_executable(c05_randectree ${SRC}/demos/c05_randectree/randectree_demo.cpp) +add_executable(c05_sm ${SRC}/demos/c05_sm/sm_demo.cpp) +add_executable(c07_simpleq ${SRC}/demos/c07_simpleq/simpleq_demo.cpp) + +target_link_libraries(c03_flocking ${DEMO_DEPS}) +target_link_libraries(c03_kinematic ${DEMO_DEPS}) +target_link_libraries(c03_pipeline ${DEMO_DEPS}) +target_link_libraries(c03_priority ${DEMO_DEPS}) +target_link_libraries(c03_steering ${DEMO_DEPS}) +target_link_libraries(c05_action ${DEMO_DEPS}) +target_link_libraries(c05_dectree ${DEMO_DEPS}) +target_link_libraries(c05_hsm ${DEMO_DEPS}) +target_link_libraries(c05_markovsm ${DEMO_DEPS}) +target_link_libraries(c05_randectree ${DEMO_DEPS}) +target_link_libraries(c05_sm ${DEMO_DEPS}) +target_link_libraries(c07_simpleq ${DEMO_DEPS})