Commit b2a7e14e authored by Thomas Moulard's avatar Thomas Moulard
Browse files

Switch completely to submodule.

parent 17425f0c
......@@ -15,179 +15,62 @@
CMAKE_MINIMUM_REQUIRED(VERSION 2.6)
SET(PROJECT_NAME dynamic-graph)
project(${PROJECT_NAME})
# --- PROJECT VERSION -----------------------
SET(${PROJECT_NAME}_VERSION_MAJOR "1")
SET(${PROJECT_NAME}_VERSION_MINOR "0")
SET(${PROJECT_NAME}_VERSION_PATCH "0")
SET(${PROJECT_NAME}_VERSION "${${PROJECT_NAME}_VERSION_MAJOR}.${${PROJECT_NAME}_VERSION_MINOR}.${${PROJECT_NAME}_VERSION_PATCH}")
SET(PROJECT_VERSION ${${PROJECT_NAME}_VERSION}.99)
INCLUDE(cmake/base.cmake)
SET(CMAKE_VERBOSE_MAKEFILE true)
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")
# Defines paths.
SET(LIBRARY_OUTPUT_PATH ${PROJECT_BINARY_DIR}/lib)
# Get the OS
SET(OS ${CMAKE_SYSTEM_NAME})
# Disable -Werror on Unix for now.
SET(CXX_DISABLE_WERROR True)
#----------------------------------------------------
# --- GENERIC FLAGS ---------------------------------
#----------------------------------------------------
# For CMAKE Modules
SET(CMAKE_MODULE_PATH "${CMAKE_CURRENT_SOURCE_DIR}/CMakeModules")
SETUP_PROJECT()
# Specify the compile flags for the overall library.
IF(WIN32)
SET(LIBDIR_KW "/LIBPATH:")
SET(LIBINCL_KW "")
SET(LIB_EXT ".lib")
ENDIF(WIN32)
# FIXME: to be changed into lib/dynamic-graph
# to avoid name collision when installing dynamic-graph in /usr.
SET(PLUGINDIR "lib/plugin")
IF(UNIX)
SET(LIBDIR_KW "-L")
SET(LIBINCL_KW "-l")
SET(LIB_EXT "")
ENDIF(UNIX)
# 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}")
# Link flags
SET(${PROJECT_NAME}_LINK_SRC_FLAGS "")
SET(${PROJECT_NAME}_LINK_FLAGS "${LIBDIR_KW}${${PROJECT_NAME}_BINARY_DIR}/lib ")
SET(${PROJECT_NAME}_LINK_FLAGS "${${PROJECT_NAME}_LINK_FLAGS} ${LIBINCLUSION_KW}${${PROJECT_NAME}_INTERN_LIBS}${LIBINCLUSION_EXT}")
IF(UNIX)
SET(${PROJECT_NAME}_LINK_SRC_FLAGS "${${PROJECT_NAME}_LINK_SRC_FLAGS} -ldl")
SET(${PROJECT_NAME}_LINK_FLAGS "${${PROJECT_NAME}_LINK_FLAGS} -ldl")
ENDIF(UNIX)
# Add dependency toward dynamic graph library in pkg-config file.
SET(PKG_CONFIG_LIBS "${PKG_CONFIG_LIBS} ${LIBINCL_KW}dynamic-graph${LIB_EXT}")
# Release flags
IF(\"${CMAKE_BUILD_TYPE}\" STREQUAL \"\" )
ELSE(\"${CMAKE_BUILD_TYPE}\" STREQUAL \"\" )
IF(${CMAKE_BUILD_TYPE} STREQUAL DEBUG)
SET(${PROJECT_NAME}_CXXFLAGS ${CMAKE_CXX_FLAGS_DEBUG}) # Useless since CXX_FLAGS, not CXXFLAGS.
ENDIF(${CMAKE_BUILD_TYPE} STREQUAL DEBUG)
IF(${CMAKE_BUILD_TYPE} STREQUAL RELEASE)
SET(${PROJECT_NAME}_CXXFLAGS ${CMAKE_CXX_FLAGS_RELEASE}) # Same here.
ENDIF(${CMAKE_BUILD_TYPE} STREQUAL RELEASE)
ENDIF (\"${CMAKE_BUILD_TYPE}\" STREQUAL \"\")
# Search for Boost.
SET(Boost_USE_STATIC_LIBS OFF)
SET(Boost_USE_MULTITHREAD ON)
FIND_PACKAGE(Boost 1.33 COMPONENTS thread REQUIRED)
SET(PKG_CONFIG_CFLAGS "${PKG_CONFIG_CFLAGS} -I${Boost_INCLUDE_DIR}")
SET(PKG_CONFIG_LIBS "${PKG_CONFIG_LIBS} ${LIBDIR_KW}${Boost_LIBRARY_DIRS}")
# --- Default options -------------------------------------------------
OPTION(BUILD_SHARED_LIBS "Build ${PROJECT_NAME} with shared libraries." ON)
OPTION(GENERATE_DOC "Generate html documentation" ON)
# --- BOOST ---------------------------------------------------
SET(Boost_THREAD_FOUND 0)
FIND_PACKAGE(Boost COMPONENTS thread REQUIRED)
IF(Boost_THREAD_FOUND)
#MESSAGE(STATUS "Boost_THREAD_LIBRARY:" ${Boost_THREAD_LIBRARY})
#MESSAGE(STATUS "Boost_THREAD_LIBRARY_RELEASE:" ${Boost_THREAD_LIBRARY_RELEASE})
#MESSAGE(STATUS "Boost_THREAD_LIBRARY_DEBUG:" ${Boost_THREAD_LIBRARY_DEBUG})
ADD_DEFINITIONS(-DHAVE_LIBBOOST_THREAD)
# Look for the type of pattern to find.
SET(BOOST_PATTERN_TOFIND "")
IF(${CMAKE_BUILD_TYPE} MATCHES RELEASE)
SET(BOOST_PATTERN_TOFIND optimized)
ENDIF(${CMAKE_BUILD_TYPE} MATCHES RELEASE)
IF(${CMAKE_BUILD_TYPE} MATCHES DEBUG)
SET(BOOST_PATTERN_TOFIND debug)
ENDIF(${CMAKE_BUILD_TYPE} MATCHES DEBUG)
IF(BOOST_PATTERN_TOFIND)
SET(BOOST_THREAD_LIST_LENGTH 0)
LIST(LENGTH Boost_THREAD_LIBRARY BOOST_THREAD_LIST_LENGTH)
# Debug or optimized library.
IF(${BOOST_THREAD_LIST_LENGTH} MATCHES 4)
LIST(FIND Boost_THREAD_LIBRARY ${BOOST_PATTERN_TOFIND} BTLB_index)
LIST(REMOVE_AT Boost_THREAD_LIBRARY ${BTLB_index})
LIST(GET Boost_THREAD_LIBRARY ${BTLB_index} BOOST_THREAD_LIB_NAME)
# Default strategy
ELSE(${BOOST_THREAD_LIST_LENGTH} MATCHES 4)
SET(BOOST_THREAD_LIB_NAME ${Boost_THREAD_LIBRARY})
ENDIF(${BOOST_THREAD_LIST_LENGTH} MATCHES 4)
# Default strategy
ELSE(BOOST_PATTERN_TOFIND)
SET(BOOST_THREAD_LIB_NAME ${Boost_THREAD_LIBRARY})
ENDIF(BOOST_PATTERN_TOFIND)
# --- PTHREAD -------------------------------------------------------
FIND_PACKAGE(PTHREAD REQUIRED)
IF(PTHREAD_FOUND)
ADD_DEFINITIONS(-DHAVE_PTHREAD)
IF(UNIX)
ADD_DEFINITIONS(-pthread)
ENDIF(UNIX)
INCLUDE_DIRECTORIES(${PTHREAD_INCLUDE_DIRS})
LINK_DIRECTORIES(${PTHREAD_LIBRARY_DIRS})
ENDIF(PTHREAD_FOUND)
ELSE(Boost_THREAD_FOUND)
MESSAGE("WARNING: Boost thread not found. Trying without the thread library")
FIND_PACKAGE(Boost)
IF(NOT Boost_FOUND)
MESSAGE(SEND_ERROR "!! ERROR: Boost not found.")
ENDIF(NOT Boost_FOUND)
ENDIF(Boost_THREAD_FOUND)
MESSAGE(STATUS "Boost thread lib name: ${BOOST_THREAD_LIB_NAME} ${Boost_THREAD_LIBRARY}")
INCLUDE_DIRECTORIES(${Boost_INCLUDE_DIRS})
LINK_DIRECTORIES(${Boost_LIBRARY_DIRS})
#
# Look for dependencies
#
# Load Pkgconfig macros
INCLUDE(FindPkgConfig)
SET(PACKAGE_REQUIREMENTS "")
# Documentation.
INCLUDE(cmake/doxygen.cmake)
_SETUP_PROJECT_DOCUMENTATION()
#
# pkg-config file
#
SET(install_pkg_prefix "\${prefix}")
SET(install_pkg_exec_prefix "\${exec_prefix}")
SET(install_pkg_libdir "\${libdir}")
SET(install_pkg_datarootdir "\${datarootdir}")
SET(install_pkg_include_dir "\${includedir}")
ADD_DEFINITIONS(-DHAVE_LIBBOOST_THREAD)
# Search for Pthread.
INCLUDE(FindThreads)
IF(UNIX)
SET (${PROJECT_NAME}_LDFLAGS "-Wl,-R${install_pkg_libdir} ${LIBINCL_KW}${PROJECT_NAME}${LIB_EXT} ${${PROJECT_NAME}_LDFLAGS}")
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.")
ENDIF(UNIX)
# Remove additional warnings.
IF(WIN32)
SET (${PROJECT_NAME}_LDFLAGS "${LIBINCL_KW}${PROJECT_NAME}${LIB_EXT} ${${PROJECT_NAME}_LDFLAGS}")
ENDIF(WIN32)
# Install the file in the appropriate place.
SET(install_libdir_pkgconfig ${CMAKE_INSTALL_PREFIX}/lib/pkgconfig)
CONFIGURE_FILE(${CMAKE_CURRENT_SOURCE_DIR}/dynamic-graph.pc.cmake
${CMAKE_CURRENT_BINARY_DIR}/dynamic-graph.pc)
INSTALL(FILES ${CMAKE_CURRENT_BINARY_DIR}/dynamic-graph.pc
DESTINATION ${install_libdir_pkgconfig}
PERMISSIONS OWNER_READ GROUP_READ WORLD_READ OWNER_WRITE)
# Uninstall target.
CONFIGURE_FILE(
"${CMAKE_CURRENT_SOURCE_DIR}/cmake_uninstall.cmake.in"
"${CMAKE_CURRENT_BINARY_DIR}/cmake_uninstall.cmake"
IMMEDIATE @ONLY)
ADD_CUSTOM_TARGET(uninstall
"${CMAKE_COMMAND}" -P "${CMAKE_CURRENT_BINARY_DIR}/cmake_uninstall.cmake")
# Testing
ENABLE_TESTING()
IF(WIN32)
ADD_DEFINITIONS("-D_CRT_SECURE_NO_WARNINGS -D_SCL_SECURE_NO_WARNINGS /wd4251 /wd4275 /wd4101 /wd4355")
ADD_DEFINITIONS("/wd4251 /wd4275 /wd4101 /wd4355")
ENDIF(WIN32)
ADD_SUBDIRECTORY(src)
......@@ -195,3 +78,5 @@ ADD_SUBDIRECTORY(include)
ADD_SUBDIRECTORY(tools)
ADD_SUBDIRECTORY(doc)
ADD_SUBDIRECTORY(unitTesting)
SETUP_PROJECT_FINALIZE()
#############################################################################
#
# $Id: FindPTHREAD.cmake,v 1.5 2007/03/21 13:59:33 asaunier Exp $
#
# Copyright (C) 1998-2006 Inria. All rights reserved.
#
# This software was developed at:
# IRISA/INRIA Rennes
# Projet Lagadic
# Campus Universitaire de Beaulieu
# 35042 Rennes Cedex
# http://www.irisa.fr/lagadic
#
# This file is part of the ViSP toolkit.
#
# This file may be distributed under the terms of the Q Public License
# as defined by Trolltech AS of Norway and appearing in the file
# LICENSE included in the packaging of this file.
#
# Licensees holding valid ViSP Professional Edition licenses may
# use this file in accordance with the ViSP Commercial License
# Agreement provided with the Software.
#
# This file is provided AS IS with NO WARRANTY OF ANY KIND, INCLUDING THE
# WARRANTY OF DESIGN, MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE.
#
# Contact visp@irisa.fr if any conditions of this licensing are
# not clear to you.
#
# Description:
# Try to find pthread library.
# Once run this will define:
#
# PTHREAD_FOUND
# PTHREAD_INCLUDE_DIR
# PTHREAD_LIBRARIES
#
# Authors:
# Fabien Spindler
#
#############################################################################
#IF(NOT UNIX AND NOT WIN32)
# SET(PTHREAD_FOUND FALSE)
#ELSE(NOT UNIX AND NOT WIN32)
FIND_PATH(PTHREAD_INCLUDE_DIR pthread.h
/usr/include
"$ENV{PTHREAD_INCLUDE_PATH}"
"$ENV{PTHREAD_HOME}/include"
)
# pthreadVSE pthreadGCE pthreadGC pthreadVC1 pthreadVC2 are comming from web
FIND_LIBRARY(PTHREAD_LIBRARY
NAMES pthread pthreadGC2 pthreadVSE pthreadGCE pthreadGC pthreadVC1 pthreadVC2
PATHS
/usr/lib
/usr/local/lib
/lib
"$ENV{PTHREAD_LIBRARY_PATH}"
"$ENV{PTHREAD_HOME}/lib"
)
#MESSAGE(STATUS "DBG PTHREAD_LIBRARY=${PTHREAD_LIBRARY}")
## --------------------------------
IF(PTHREAD_LIBRARY)
SET(PTHREAD_LIBRARIES ${PTHREAD_LIBRARY})
ELSE(PTHREAD_LIBRARY)
#MESSAGE(SEND_ERROR "pthread library not found.")
ENDIF(PTHREAD_LIBRARY)
IF(NOT PTHREAD_INCLUDE_DIR)
#MESSAGE(SEND_ERROR "pthread include dir not found.")
ENDIF(NOT PTHREAD_INCLUDE_DIR)
IF(PTHREAD_LIBRARIES AND PTHREAD_INCLUDE_DIR)
SET(PTHREAD_FOUND TRUE)
ELSE(PTHREAD_LIBRARIES AND PTHREAD_INCLUDE_DIR)
SET(PTHREAD_FOUND FALSE)
ENDIF(PTHREAD_LIBRARIES AND PTHREAD_INCLUDE_DIR)
#MARK_AS_ADVANCED(
# PTHREAD_INCLUDE_DIR
# PTHREAD_LIBRARIES
# )
#MESSAGE(STATUS "PTHREAD_FOUND : ${PTHREAD_FOUND}")
#ENDIF(NOT UNIX AND NOT WIN32)
Subproject commit 597d697c4ee6f9bd4254360d9efaea15e41de340
Subproject commit 1a210729a6d1d2b6a6a77a62c41c21019ee864a0
# Copyright 2010, Olivier Stasse, JRL, CNRS/AIST
#
# 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.
#
# 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/>.
####################################
### Main Library
####################################
SET(LIBRARY_NAME ${PROJECT_NAME})
INCLUDE_DIRECTORIES(
${CMAKE_CURRENT_SOURCE_DIR}/../include
${CMAKE_CURRENT_BINARY_DIR}/../include
)
# Verbosity level
IF (NOT (\"${CMAKE_VERBOSITY_LEVEL}\" STREQUAL \"\"))
ADD_DEFINITIONS(-DVP_DEBUG_MODE=${CMAKE_VERBOSITY_LEVEL} -DVP_DEBUG)
ENDIF (NOT (\"${CMAKE_VERBOSITY_LEVEL}\" STREQUAL \"\"))
......@@ -37,18 +46,10 @@ ADD_LIBRARY(${LIBRARY_NAME}
signal/signal-caster.cpp
)
SET_TARGET_PROPERTIES(${LIBRARY_NAME}
PROPERTIES
SOVERSION ${PROJECT_VERSION}
INSTALL_RPATH ${CMAKE_INSTALL_PREFIX}/lib)
SET_TARGET_PROPERTIES(${LIBRARY_NAME}
PROPERTIES
LINK_FLAGS "${${PROJECT_NAME}_src_LDFLAGS}"
)
SET_TARGET_PROPERTIES(${LIBRARY_NAME} PROPERTIES SOVERSION ${PROJECT_VERSION})
IF (UNIX)
TARGET_LINK_LIBRARIES(${LIBRARY_NAME} dl pthread)
TARGET_LINK_LIBRARIES(${LIBRARY_NAME} dl pthread)
ENDIF (UNIX)
TARGET_LINK_LIBRARIES(${LIBRARY_NAME} ${Boost_LIBRARIES})
......@@ -67,24 +68,20 @@ SET(plugins_list
traces/tracer-real-time
)
SET(tracer-real-time_dependancy tracer)
SET(tracer-real-time_dependency tracer)
FOREACH(plugin_file ${plugins_list})
GET_FILENAME_COMPONENT(plugin ${plugin_file} NAME)
ADD_LIBRARY(${plugin}
SHARED
"${plugin_file}.cpp")
TARGET_LINK_LIBRARIES(${plugin}
${PROJECT_NAME} ${${plugin}_dependancy}
${Boost_LIBRARIES})
SET_TARGET_PROPERTIES(${plugin}
PROPERTIES
COMPILE_FLAGS "${${PROJECT_NAME}_CXXFLAGS}"
PREFIX ""
LIBRARY_OUTPUT_DIRECTORY "${${PROJECT_NAME}_BINARY_DIR}/lib/plugin")
INSTALL(TARGETS ${plugin}
DESTINATION lib/plugin)
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})
ENDFOREACH(plugin_file)
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment