CMakeLists.txt 3.16 KB
Newer Older
1
2
3
# Copyright 2010, Olivier Stasse, JRL, CNRS/AIST
#
# This file is part of dynamic-graph.
4
5
6
# dynamic-graph is free software: 
# Redistribution and use in source and binary forms, with or without
# modification, are permitted provided that the following conditions are met:
7
#
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
# * Redistributions of source code must retain the above copyright notice, this
#   list of conditions and the following disclaimer.
#
# * Redistributions in binary form must reproduce the above copyright notice,
#   this list of conditions and the following disclaimer in the documentation
#   and/or other materials provided with the distribution.
#
# THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
# AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
# IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
# DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE
# FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
# DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
# SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER
# CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
# OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
# OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
25

26
27
28
29
####################################
### Main Library
####################################
SET(LIBRARY_NAME ${PROJECT_NAME})
30

31
# Verbosity level
32
IF (NOT (\"${CMAKE_VERBOSITY_LEVEL}\" STREQUAL \"\"))
florent's avatar
florent committed
33
  ADD_DEFINITIONS(-DVP_DEBUG_MODE=${CMAKE_VERBOSITY_LEVEL} -DVP_DEBUG)
34
ENDIF (NOT (\"${CMAKE_VERBOSITY_LEVEL}\" STREQUAL \"\"))
35

36
37
# Declare boost include directories
include_directories(${Boost_INCLUDE_DIRS})
38
link_directories(${Boost_LIBRARY_DIRS})
39

40
ADD_LIBRARY(${LIBRARY_NAME}
41
42
  SHARED
  debug/debug.cpp
florent's avatar
florent committed
43

44
45
46
  dgraph/entity.cpp
  dgraph/factory.cpp
  dgraph/pool.cpp
florent's avatar
florent committed
47

48
49
50
  exception/exception-abstract.cpp
  exception/exception-factory.cpp
  exception/exception-signal.cpp
51
  exception/exception-traces.cpp
florent's avatar
florent committed
52

53
  signal/signal-array.cpp
54
  signal/signal-caster.cpp
55
  signal/signal-cast-helper.cpp
56
57
58

  command/value.cpp
  command/command.cpp
59
60
  )

61
SET_TARGET_PROPERTIES(${LIBRARY_NAME} PROPERTIES SOVERSION ${PROJECT_VERSION})
62

florent's avatar
florent committed
63

florent's avatar
florent committed
64
IF (UNIX)
65
  TARGET_LINK_LIBRARIES(${LIBRARY_NAME} ${CMAKE_DL_LIBS} pthread)
florent's avatar
florent committed
66
67
ENDIF (UNIX)

68
TARGET_LINK_LIBRARIES(${LIBRARY_NAME} ${Boost_LIBRARIES})
69

70
71
72
#IF (UNIX AND NOT APPLE)
#  TARGET_LINK_LIBRARIES(${LIBRARY_NAME} ${JRL_MAL_LDFLAGS_OTHER})
#ENDIF (UNIX AND NOT APPLE)
73

74
INSTALL(TARGETS ${LIBRARY_NAME}
75
  DESTINATION ${CMAKE_INSTALL_LIBDIR})
florent's avatar
florent committed
76

77
78
79
####################################
### Plugins
####################################
florent's avatar
florent committed
80
SET(plugins_list
81
82
	traces/tracer
	traces/tracer-real-time
83
)
84

85
SET(tracer-real-time_dependency tracer)
86

87
FOREACH(plugin_file ${plugins_list})
88
89
90
91
92
93
94
95
96
97
98
99
100
  GET_FILENAME_COMPONENT(plugin ${plugin_file} NAME)
  ADD_LIBRARY(${plugin} SHARED "${plugin_file}.cpp")

  TARGET_LINK_LIBRARIES(${plugin}
    ${PROJECT_NAME} ${${plugin}_dependency}
    ${Boost_LIBRARIES})

  SET_TARGET_PROPERTIES(${plugin}
    PROPERTIES
    PREFIX ""
    )

  INSTALL(TARGETS ${plugin} DESTINATION ${PLUGINDIR})
101
ENDFOREACH(plugin_file)