~robot3d-team/robot3d/trunk

« back to all changes in this revision

Viewing changes to CMakeLists.txt

  • Committer: Anne van Rossum
  • Date: 2010-08-10 15:58:55 UTC
  • Revision ID: anne@gamix-20100810155855-kve7x2vwouagdij9
Initial import

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
1
#
 
2
# Robot3D Physical realistic 3D simulator for robots
 
3
#
 
4
# @license GNU Lesser General Public License
 
5
#
 
6
# @author Anne C. van Rossum
 
7
#
 
8
# URLs used to create this CMakeLists.txt file:
 
9
#   http://www.cmake.org/cmake/help/cmake_tutorial.html
 
10
#   http://brunoabinader.blogspot.com/2009/12/how-cmake-simplifies-build-process-part.html
 
11
#   http://rachid.koucha.free.fr/tech_corner/cmake_manual.html
 
12
 
 
13
# I am not sure what the proper version number should be
 
14
CMAKE_MINIMUM_REQUIRED(VERSION 2.6)
 
15
 
 
16
# The project name (sets all _SOURCE_DIR)
 
17
PROJECT(SYMBRICATOR3D)
 
18
 
 
19
# The directory with all the FindXXX modules
 
20
SET(CMAKE_MODULE_PATH ${CMAKE_MODULE_PATH} "${CMAKE_SOURCE_DIR}/cmake/Modules/")
 
21
 
 
22
# The macro below forces the build directory to be different from source directory:
 
23
INCLUDE( MacroEnsureOutOfSourceBuild )
 
24
MACRO_ENSURE_OUT_OF_SOURCE_BUILD(
 
25
        "${PROJECT_NAME} requires an out of source build."
 
26
)
 
27
 
 
28
# Versioning
 
29
SET(SYMBRICATOR3D_VERSION_MAJOR 0)
 
30
SET(SYMBRICATOR3D_VERSION_MINOR 1)
 
31
 
 
32
# Use the FindXXX utility classes
 
33
FIND_PACKAGE(OpenGL REQUIRED)
 
34
FIND_PACKAGE(OpenCV REQUIRED)
 
35
FIND_PACKAGE(ODE REQUIRED)
 
36
FIND_PACKAGE(Delta3D REQUIRED)
 
37
FIND_PACKAGE(CEGUI REQUIRED)
 
38
FIND_PACKAGE(osg REQUIRED)
 
39
FIND_PACKAGE(osgShadow REQUIRED)
 
40
FIND_PACKAGE(XercesC REQUIRED)
 
41
FIND_PACKAGE(YARP REQUIRED)
 
42
 
 
43
FIND_PACKAGE(Boost REQUIRED COMPONENTS filesystem) 
 
44
# 1.38.0 COMPONENTS filesystem NO_MODULE)
 
45
 
 
46
# The directories where includes (.h, .hpp, .so) files can be found
 
47
INCLUDE_DIRECTORIES("${PROJECT_SOURCE_DIR}/inc")
 
48
 
 
49
# The header files of required libraries are located in
 
50
#INCLUDE_DIRECTORIES(${DELTA3D_INCLUDE_DIR})
 
51
INCLUDE_DIRECTORIES(${ODE_INCLUDE_DIRS})
 
52
INCLUDE_DIRECTORIES(${CEGUI_INCLUDE_DIR})
 
53
INCLUDE_DIRECTORIES(${OPENCV_INCLUDE_DIR})
 
54
INCLUDE_DIRECTORIES(${OSGSHADOW_INCLUDE_DIR})
 
55
INCLUDE_DIRECTORIES(${XERCES_INCLUDE_DIR})
 
56
INCLUDE_DIRECTORIES(${YARP_INCLUDE_DIRS})
 
57
INCLUDE_DIRECTORIES(${Boost_INCLUDE_DIR})
 
58
 
 
59
# The libraries itself can be found as 
 
60
# Be careful to include either LIBRARY or LIBRARIES, terminology depends per FindXXX file
 
61
SET(LIBS ${LIBS} ${ODE_LIBRARY})
 
62
SET(LIBS ${LIBS} ${CEGUI_LIBRARY})
 
63
SET(LIBS ${LIBS} ${OPENCV_LIBRARIES})
 
64
SET(LIBS ${LIBS} ${DELTA3D_LIBRARIES})
 
65
SET(LIBS ${LIBS} ${OSGSHADOW_LIBRARY})
 
66
SET(LIBS ${LIBS} ${XERCES_LIBRARY})
 
67
SET(LIBS ${LIBS} ${YARP_LIBRARIES})
 
68
SET(LIBS ${LIBS} ${Boost_LIBRARIES})
 
69
 
 
70
# Compiler flags
 
71
SET(CMAKE_CXX_FLAGS "-g -Wall -DdSINGLE")
 
72
 
 
73
# Some debug information
 
74
MESSAGE("${PROJECT_NAME} is using CXX flags: ${CMAKE_CXX_FLAGS}")
 
75
MESSAGE ("Libraries included: ${LIBS}")
 
76
MESSAGE ("Include directories: ${CEGUI_INCLUDE_DIR}")
 
77
 
 
78
# A series of customizable options
 
79
#   We have to add here flags like BUILD_AUDIO etc
 
80
OPTION( BUILD_SHARED_LIBS "Set to OFF to build static libraries" ON )
 
81
 
 
82
# Include directories of the project
 
83
#ADD_SUBDIRECTORY (inc)
 
84
ADD_SUBDIRECTORY (src)
 
85
 
 
86
# The directories in which the linker can search for libraries
 
87
LINK_DIRECTORIES(src/srCore src/srSensor src/srActuator src/srFactory src/srRobot)
 
88
 
 
89
# Linking the main 
 
90
ADD_LIBRARY(Robot3D SHARED inc/srCore/export.h)
 
91
SET_TARGET_PROPERTIES(Robot3D PROPERTIES LINKER_LANGUAGE C)
 
92
TARGET_LINK_LIBRARIES(Robot3D srCore srSensor srActuator srFactory srRobot ${LIBS})
 
93
 
 
94
#SET(INSTALL_FILES ${CMAKE_BUILD_DIR}/libRobot3D.so)
 
95
 
 
96
INSTALL(TARGETS Robot3D DESTINATION ${CMAKE_INSTALL_PREFIX}/lib)
 
97