CMakeLists.txt 2.37 KB
Newer Older
Thomas Moulard's avatar
Thomas Moulard committed
1
# Copyright 2010, Olivier Stasse, JRL, CNRS/AIST
2
#
Thomas Moulard's avatar
Thomas Moulard committed
3
4
5
6
7
# This file is part of dynamic-graph.
# dynamic-graph is free software: you can redistribute it and/or
# modify it under the terms of the GNU Lesser General Public License
# as published by the Free Software Foundation, either version 3 of
# the License, or (at your option) any later version.
8
#
Thomas Moulard's avatar
Thomas Moulard committed
9
10
11
12
13
14
# dynamic-graph is distributed in the hope that it will be useful, but
# WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
# General Lesser Public License for more details.  You should have
# received a copy of the GNU Lesser General Public License along with
# dynamic-graph. If not, see <http://www.gnu.org/licenses/>.
15
16
17

CMAKE_MINIMUM_REQUIRED(VERSION 2.6)

18
INCLUDE(cmake/base.cmake)
19
INCLUDE(cmake/boost.cmake)
20

21
22
23
24
SET(PROJECT_NAME dynamic-graph)
SET(PROJECT_VERSION 1.0.0.99)
SET(PROJECT_DESCRIPTION "Dynamic graph library")
SET(PROJECT_URL "http://github.com/jrl-umi3218/dynamic-graph")
25

26
27
SET(CUSTOM_HEADER_DIR "${PROJECT_NAME}")

28
# Defines paths.
29
SET(LIBRARY_OUTPUT_PATH ${PROJECT_BINARY_DIR}/lib)
30

31
32
# Disable -Werror on Unix for now.
SET(CXX_DISABLE_WERROR True)
33

34
SETUP_PROJECT()
35

36
37
38
# FIXME: to be changed into lib/dynamic-graph
# to avoid name collision when installing dynamic-graph in /usr.
SET(PLUGINDIR "lib/plugin")
39

40
41
42
43
44
# Add extra keys to pkg-config file to export the location of the
# plug-in directory in a robust manner.
SET(PKG_CONFIG_EXTRA
  "plugindirname=${PLUGINDIR}
plugindir=${CMAKE_INSTALL_PREFIX}/${PLUGINDIR}")
45

46
47
# Add dependency toward dynamic graph library in pkg-config file.
SET(PKG_CONFIG_LIBS "${PKG_CONFIG_LIBS} ${LIBINCL_KW}dynamic-graph${LIB_EXT}")
48

49
# Search for Boost.
50
SEARCH_FOR_BOOST()
51

52
53
# Search for Pthread.
INCLUDE(FindThreads)
54
IF(UNIX)
55
56
57
58
59
60
61
62
63
64
65
  IF(CMAKE_USE_PTHREADS_INIT)
    ADD_DEFINITIONS(-pthread)
  ELSE(CMAKE_USE_PTHREADS_INIT)
    MESSAGE(FATAL_ERROR
      "Pthread is required on Unix, but "
      ${CMAKE_THREAD_LIBS_INIT} " has been detected.")
  ENDIF(CMAKE_USE_PTHREADS_INIT)
ELSEIF(WIN32)
  # Nothing to do.
ELSE(UNIX)
  MESSAGE(FATAL_ERROR "Thread support for this platform is not implemented.")
66
67
ENDIF(UNIX)

68
# Remove additional warnings.
69
IF(WIN32)
70
  ADD_DEFINITIONS("/wd4251 /wd4275 /wd4101 /wd4355")
71
72
ENDIF(WIN32)

73
74
ADD_SUBDIRECTORY(src)
ADD_SUBDIRECTORY(include)
75
ADD_SUBDIRECTORY(tools)
76
ADD_SUBDIRECTORY(doc)
Francois Bleibel's avatar
Francois Bleibel committed
77
ADD_SUBDIRECTORY(unitTesting)
78
79

SETUP_PROJECT_FINALIZE()