CMakeLists.txt 2.96 KB
Newer Older
Guilhem Saurel's avatar
Guilhem Saurel committed
1
2
# Copyright (c) 2012, 2020, CNRS
# Authors: Florent Lamiraux, Guilhem Saurel
Steve Tonneau's avatar
Steve Tonneau committed
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
#
# This file is part of hpp-rbprm-corba.
# hpp-rbprm-corba 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.
#
# hpp-rbprm-corba 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
# hpp-rbprm-corba.  If not, see
# <http://www.gnu.org/licenses/>.

Guilhem Saurel's avatar
Guilhem Saurel committed
18
CMAKE_MINIMUM_REQUIRED(VERSION 3.1)
Guilhem Saurel's avatar
Guilhem Saurel committed
19
20
21

SET(PROJECT_NAME hpp-rbprm-corba)
SET(PROJECT_DESCRIPTION "Corba server for reachability based planning")
Steve Tonneau's avatar
Steve Tonneau committed
22

Guilhem Saurel's avatar
Guilhem Saurel committed
23
24
SET(CUSTOM_HEADER_DIR hpp/corbaserver/rbprm)
SET(PROJECT_USE_CMAKE_EXPORT TRUE)
Steve Tonneau's avatar
Steve Tonneau committed
25
26
SET(CXX_DISABLE_WERROR true)

27
INCLUDE(cmake/hpp.cmake)
Guilhem Saurel's avatar
Guilhem Saurel committed
28
INCLUDE(cmake/idl.cmake)
Guilhem Saurel's avatar
Guilhem Saurel committed
29
INCLUDE(cmake/python.cmake)
Steve Tonneau's avatar
Steve Tonneau committed
30

Guilhem Saurel's avatar
Guilhem Saurel committed
31
32
COMPUTE_PROJECT_ARGS(PROJECT_ARGS LANGUAGES CXX)
PROJECT(${PROJECT_NAME} ${PROJECT_ARGS})
Steve Tonneau's avatar
Steve Tonneau committed
33

34
35
LIST(APPEND PKG_CONFIG_ADDITIONAL_VARIABLES cmake_plugin)

Guilhem Saurel's avatar
Guilhem Saurel committed
36
FINDPYTHON()
37

Guilhem Saurel's avatar
Guilhem Saurel committed
38
39
ADD_PROJECT_DEPENDENCY("hpp-rbprm" REQUIRED)
ADD_PROJECT_DEPENDENCY("hpp-affordance-corba" REQUIRED)
40
ADD_PROJECT_DEPENDENCY("hpp-gepetto-viewer")
Steve Tonneau's avatar
Steve Tonneau committed
41
ADD_REQUIRED_DEPENDENCY("omniORB4 >= 4.1.4")
Guilhem Saurel's avatar
Guilhem Saurel committed
42
ADD_REQUIRED_DEPENDENCY("octomap >= 1.8")
Steve Tonneau's avatar
Steve Tonneau committed
43

44
set(CMAKE_MODULE_PATH "${PROJECT_SOURCE_DIR}/cmake/find-external/CDD")
Guilhem Saurel's avatar
Guilhem Saurel committed
45
ADD_PROJECT_DEPENDENCY(CDD REQUIRED)
Guilhem Saurel's avatar
Guilhem Saurel committed
46

Guilhem Saurel's avatar
Guilhem Saurel committed
47
if(OCTOMAP_INCLUDE_DIRS AND OCTOMAP_LIBRARY_DIRS)
stevet's avatar
stevet committed
48
49
50
51
52
53
54
55
        include_directories(${OCTOMAP_INCLUDE_DIRS})
        link_directories(${OCTOMAP_LIBRARY_DIRS})
  string(REPLACE "." ";" VERSION_LIST ${OCTOMAP_VERSION})
  list(GET VERSION_LIST 0 OCTOMAP_MAJOR_VERSION)
  list(GET VERSION_LIST 1 OCTOMAP_MINOR_VERSION)
  list(GET VERSION_LIST 2 OCTOMAP_PATCH_VERSION)
  add_definitions (-DOCTOMAP_MAJOR_VERSION=${OCTOMAP_MAJOR_VERSION}
                   -DOCTOMAP_MINOR_VERSION=${OCTOMAP_MINOR_VERSION}
stevet's avatar
stevet committed
56
                   -DOCTOMAP_PATCH_VERSION=${OCTOMAP_PATCH_VERSION}  -DHPP_FCL_HAVE_OCTOMAP=1)
stevet's avatar
stevet committed
57
58
59
60
61
        message(STATUS "FCL uses Octomap" ${OCTOMAP_MINOR_VERSION})
else()
        message(STATUS "FCL does not use Octomap")
endif()

Guilhem Saurel's avatar
Guilhem Saurel committed
62
63
64
65
66
67
68
69
70
71
72
73
74
75
SET(${PROJECT_NAME}_HEADERS
  include/${CUSTOM_HEADER_DIR}/server.hh
  )

SET(${PROJECT_NAME}_SOURCES
  src/${PROJECT_NAME}.cc
  )

# Stand alone corba server
ADD_EXECUTABLE(hpp-rbprm-server ${${PROJECT_NAME}_SOURCES} ${${PROJECT_NAME}_HEADERS})
TARGET_INCLUDE_DIRECTORIES(hpp-rbprm-server PUBLIC $<INSTALL_INTERFACE:include>)
TARGET_LINK_LIBRARIES(hpp-rbprm-server hpp-corbaserver::hpp-corbaserver)
INSTALL(TARGETS hpp-rbprm-server EXPORT ${TARGETS_EXPORT_NAME} DESTINATION bin)

Steve Tonneau's avatar
Steve Tonneau committed
76
ADD_SUBDIRECTORY(src)
77
ADD_SUBDIRECTORY(tests)
Steve Tonneau's avatar
Steve Tonneau committed
78

Guilhem Saurel's avatar
Guilhem Saurel committed
79
CONFIG_FILES (include/${CUSTOM_HEADER_DIR}/doc.hh)
Guilhem Saurel's avatar
Guilhem Saurel committed
80
PKG_CONFIG_APPEND_LIBS(${PROJECT_NAME})
Guilhem Saurel's avatar
Guilhem Saurel committed
81
82

INSTALL(FILES package.xml DESTINATION share/${PROJECT_NAME})