Commit e5fb237d authored by anna-seppala's avatar anna-seppala
Browse files

Merge pull request #1 from anna-seppala/euroc-c1

Add jrl-cmakesubmodules and update CMakeLists.txt
parents f46477f1 3aed1ee2
[submodule "cmake"]
path = cmake
url = git://github.com/jrl-umi3218/jrl-cmakemodules.git
......@@ -18,36 +18,21 @@
######################
CMAKE_MINIMUM_REQUIRED(VERSION 2.6)
PROJECT(qgv)
SET(TARGET_VERSION_MAJOR 0 )
SET(TARGET_VERSION_MINOR 1 )
SET(${PROJECT_NAME}_PATCH_LEVEL 0 )
SET(${PROJECT_NAME}_SOVERSION ${TARGET_VERSION_MAJOR})
SET(${PROJECT_NAME}_VERSION
"${TARGET_VERSION_MAJOR}.${TARGET_VERSION_MINOR}.${${PROJECT_NAME}_PATCH_LEVEL}" )
SET(CXX_DISABLE_WERROR TRUE)
INCLUDE(cmake/base.cmake)
INCLUDE(cmake/boost.cmake)
# INCLUDE(CTest)
SET(PROJECT_NAME qgv)
SET(PROJECT_DESCRIPTION "Interactive Qt graphViz display")
SET(PROJECT_URL "https://github.com/nbergont/qgv")
# Extending the Module path with the local module path of desuto
SET(CMAKE_MODULE_PATH ${CMAKE_SOURCE_DIR}/cmake/modules )
SET(CMAKE_MODULE_PATH ${CMAKE_SOURCE_DIR}/cmake_modules/modules )
OPTION(BUILD_DEV "Build development version of qgv" ON)
OPTION(BUILD_DEBUG "Build in debug mode" ON)
OPTION(BINDINGS_QT4 "Build with Qt4" OFF)
OPTION(BINDINGS_QT5 "Build with Qt5" OFF)
SET(BUILD_DEBUG_WANTED ${BUILD_DEBUG})
SET(BUILD_DEV_WANTED ${BUILD_DEV})
SET(BINDINGS_QT4_WANTED ${BINDINGS_QT4})
SET(BINDINGS_QT5_WANTED ${BINDINGS_QT5})
IF(BUILD_DEBUG)
SET(CMAKE_BUILD_TYPE Debug)
ELSE()
SET(CMAKE_BUILD_TYPE Release)
ENDIF()
IF(NOT BINDINGS_QT4 AND NOT BINDINGS_QT5)
MESSAGE("Trying to autodetect Qt version")
FIND_PACKAGE(Qt4 QUIET)
......@@ -97,43 +82,7 @@ IF(NOT KDE)
SET(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -ansi")
ENDIF(NOT WIN32 AND NOT APPLE)
ENDIF(NOT KDE)
IF(BUILD_DEBUG AND NOT MSVC)
SET(CMAKE_SHARED_LINKER_FLAGS "${CMAKE_SHARED_LINKER_FLAGS} -fprofile-arcs -ftest-coverage")
SET(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -fprofile-arcs -ftest-coverage")
ENDIF(BUILD_DEBUG AND NOT MSVC)
ADD_DEFINITIONS(${QT_DEFINITIONS})
# directory to install binaries
SET(bin_DIR ${CMAKE_INSTALL_PREFIX}/bin)
IF(WIN32)
SET(bin_DIR .)
ENDIF(WIN32)
IF(NOT WIN32)
SET(LIB_INSTALL_DIR "${CMAKE_INSTALL_PREFIX}/lib/" CACHE STRING "Where to install the library files to")
ENDIF(NOT WIN32)
SET(EXECUTABLE_OUTPUT_PATH ${CMAKE_BINARY_DIR}/bin)
IF(UNIX)
# SET(designer_DIR "/usr/lib/qt4/plugins/designer")
SET(LIBRARY_OUTPUT_PATH ${CMAKE_BINARY_DIR}/lib)
SET(include_DIR ${CMAKE_INSTALL_PREFIX}/include/${PROJECT_NAME})
SET(find_cmake_DIR ${CMAKE_ROOT}/Modules/)
ELSE(UNIX)
SET(LIB_INSTALL_DIR ${bin_DIR})
SET(LIBRARY_OUTPUT_PATH ${EXECUTABLE_OUTPUT_PATH})
SET(include_DIR ${bin_DIR}/include/${PROJECT_NAME})
SET(find_cmake_DIR ${CMAKE_ROOT}/Modules/)
ENDIF(UNIX)
IF(WIN32)
IF(BUILD_DEBUG)
SET(qt_LIBS ${qt_LIBS}/Debug)
ELSE(BUILD_DEBUG)
SET(qt_LIBS ${qt_LIBS}/Release)
ENDIF(BUILD_DEBUG)
ENDIF()
FIND_PACKAGE(Qt4 REQUIRED)
ADD_DEFINITIONS(${QT_DEFINITIONS})
FIND_PACKAGE(Graphviz REQUIRED)
......@@ -142,131 +91,22 @@ FIND_PACKAGE(Graphviz REQUIRED)
# include source tree
#
######################
SET(libqgv_SOURCE_DIR ${CMAKE_SOURCE_DIR}/QGVCore)
SET(libqgv_BINARY_DIR ${CMAKE_BINARY_DIR}/QGVCore)
ADD_SUBDIRECTORY(QGVCore)
ADD_SUBDIRECTORY(Sample EXCLUDE_FROM_ALL)
######################
#
# printing choosen configuration
#
######################
MESSAGE("######################################################")
MESSAGE("")
MESSAGE("CONFIGURATION")
MESSAGE("")
MESSAGE("CMAKE_SHARED_LINKER_FLAGS: ${CMAKE_SHARED_LINKER_FLAGS}")
MESSAGE("CMAKE_CXX_FLAGS: ${CMAKE_CXX_FLAGS}")
MESSAGE("CMAKE_INSTALL_PREFIX: ${CMAKE_INSTALL_PREFIX}")
MESSAGE("")
MESSAGE("OPTIONS:")
MESSAGE(" Name Wanted Used")
# MESSAGE(" BUILD_PACKAGE: ${BUILD_PACKAGE_WANTED} ${BUILD_PACKAGE}")
MESSAGE(" BUILD_DEBUG: ${BUILD_DEBUG_WANTED} ${BUILD_DEBUG}")
# MESSAGE(" BUILD_TESTING: ${BUILD_TESTING_WANTED} ${BUILD_TESTING}")
MESSAGE(" BUILD_DEV: ${BUILD_DEV} ${BUILD_DEV}")
MESSAGE(" BINDINGS_QT4: ${BINDINGS_QT4_WANTED} ${BINDINGS_QT4}")
MESSAGE(" BINDINGS_QT5: ${BINDINGS_QT5_WANTED} ${BINDINGS_QT5}")
# MESSAGE(" L10N_ALL: ${L10N_ALL_WANTED} ${L10N_ALL}")
# MESSAGE(" L10N_DE: ${L10N_DE_WANTED} ${L10N_DE}")
# MESSAGE(" L10N_EN: ${L10N_EN_WANTED} ${L10N_EN}")
# MESSAGE(" L10N_FR: ${L10N_FR_WANTED} ${L10N_FR}")
MESSAGE("")
MESSAGE("######################################################")
######################
#
# Add uninstall target
#
######################
CONFIGURE_FILE(
"${CMAKE_CURRENT_SOURCE_DIR}/cmake/cmake_uninstall.cmake.in"
"${CMAKE_CURRENT_BINARY_DIR}/cmake/cmake_uninstall.cmake"
IMMEDIATE @ONLY)
ADD_CUSTOM_TARGET(uninstall
"${CMAKE_COMMAND}" -P "${CMAKE_CURRENT_BINARY_DIR}/cmake/cmake_uninstall.cmake")
######################
#
# CPACK
#
######################
SET(CPACK_GENERATOR "NSIS")
SET(CPACK_PACKAGE_NAME "QGV")
SET(CPACK_PACKAGE_VENDOR "")
SET(CPACK_PACKAGE_DESCRIPTION_SUMMARY "Qt interface for Graphviz")
SET(CPACK_PACKAGE_VERSION ${${PROJECT_NAME}_VERSION})
SET(CPACK_PACKAGE_VERSION_MAJOR ${TARGET_MAJOR_VERSION})
SET(CPACK_PACKAGE_VERSION_MINOR ${TARGET_MINOR_VERSION})
SET(CPACK_PACKAGE_VERSION_PATCH ${${PROJECT_NAME}_PATCH_LEVEL})
SET(CPACK_PACKAGE_INSTALL_DIRECTORY "qgv")
# add all components which should be installable via the package
IF(WIN32)
SET(external_DLL
qtlibs
graphvizlibs
)
ENDIF(WIN32)
SET(CPACK_COMPONENTS_ALL
library
${external_DLL}
headerfiles
sample
SET(${PROJECT_NAME}_HEADERS
QGVCore/QGVEdge.h
QGVCore/qgv.h
QGVCore/QGVNode.h
QGVCore/QGVScene.h
QGVCore/QGVSubGraph.h
)
# License file
SET(CPACK_RESOURCE_FILE_LICENSE ${CMAKE_SOURCE_DIR}/LICENSE.txt)
SETUP_PROJECT ()
# Pre selected installation profiles
SET(CPACK_ALL_INSTALL_TYPES Full Minimal)
# groups for components
SET(CPACK_COMPONENT_GROUP_3RDPARTYLIBS_DISPLAY_NAME "3rd Party Libraries")
SET(CPACK_COMPONENT_GROUP_3RDPARTYLIBS_DESCRIPTION "Libraries which are needed, but not belonging to this project. They must not be installed, if they are already installed at path")
# the scheme of the variable names are: CPACK_COMPNONENT_%COMPONENTNAMEINUPPERCASE%_DISPLAY_NAME
# where %COMPONENTNAMEINUPPERCASE% must be replaced by the upper cased name of the component
# see below for example
SET(CPACK_COMPONENT_LIBRARY_DISPLAY_NAME "QGV")
SET(CPACK_COMPONENT_LIBRARY_DESCRIPTION
"The qgv library")
# SET(CPACK_COMPONENT_LIBRARY_GROUP "Base")
SET(CPACK_COMPONENT_LIBRARY_INSTALL_TYPES Full Minimal)
IF(BUILD_DEV)
SET(CPACK_COMPONENT_HEADERFILES_DISPLAY_NAME "Header files")
SET(CPACK_COMPONENT_HEADERFILES_DESCRIPTION
"Header files of qgv library")
SET(CPACK_COMPONENT_HEADERFILES_DEPENDS library)
SET(CPACK_COMPONENT_HEADERFILES_INSTALL_TYPES Full)
ENDIF(BUILD_DEV)
SET(CPACK_COMPONENT_QTLIBS_DISPLAY_NAME "QT")
SET(CPACK_COMPONENT_QTLIBS_DESCRIPTION
"Qt libraries")
SET(CPACK_COMPONENT_QTLIBS_GROUP "3rdPartyLibs")
SET(CPACK_COMPONENT_QTLIBS_INSTALL_TYPES Full)
SET(CPACK_COMPONENT_GRAPHVIZLIBS_DISPLAY_NAME "Graphviz")
SET(CPACK_COMPONENT_GRAPHVIZLIBS_DESCRIPTION
"Graphviz libraries")
SET(CPACK_COMPONENT_GRAPHVIZLIBS_GROUP "3rdPartyLibs")
SET(CPACK_COMPONENT_GRAPHVIZLIBS_INSTALL_TYPES Full)
SET(CPACK_COMPONENT_SAMPLE_DISPLAY_NAME "Sample")
SET(CPACK_COMPONENT_SAMPLE_DESCRIPTION
"Example application")
SET(CPACK_COMPONENT_SAMPLE_DEPENDS library)
SET(CPACK_COMPONENT_SAMPLE_INSTALL_TYPES Full)
ADD_SUBDIRECTORY(QGVCore)
ADD_SUBDIRECTORY(Sample EXCLUDE_FROM_ALL)
# used by NSIS to create startmenu links to the executables
# this entrys are only useful if a bin folder is used, otherwise use the empty EXECUTABLES
# and fill out the NSIS_MENU_LINKS
SET(CPACK_PACKAGE_EXECUTABLES ${CPACK_PACKAGE_EXECUTABLES} "Sample" "Sample")
# Hack for pkg-config
SET (_PKG_CONFIG_INCLUDEDIR "${_PKG_CONFIG_INCLUDEDIR}/QGVCore")
PKG_CONFIG_APPEND_LIBS("qgvcore")
# This must always be last!
INCLUDE(CPack)
SETUP_PROJECT_FINALIZE ()
......@@ -5,7 +5,6 @@ SET(qgvlib_TS
)
SET(qgvlib_UI
)
# all files which may be mocced
......@@ -30,7 +29,6 @@ INCLUDE_DIRECTORIES(
${CMAKE_CURRENT_SOURCE_DIR}
${CMAKE_CURRENT_SOURCE_DIR}/private
${CMAKE_CURRENT_BINARY_DIR}/private
)
# Activate Export macro for building the library itself
# if QGVCORE_LIB is not set or equal 0 (null), import macro is used
......@@ -74,20 +72,15 @@ IF(BINDINGS_QT5)
qt5_use_modules(QVGCore Core Widgets)
ENDIF(BINDINGS_QT5)
SET_TARGET_PROPERTIES(qgvcore PROPERTIES
OUTPUT_NAME "QGVCore"
VERSION ${TARGET_VERSION_MAJOR}.${TARGET_VERSION_MINOR}.${${PROJECT_NAME}_PATCH_LEVEL}
SOVERSION ${TARGET_VERSION_MAJOR})
IF(WIN32)
# this extra install command is needed by the nsis installer
INSTALL(TARGETS qgvcore
RUNTIME DESTINATION ${LIB_INSTALL_DIR}
COMPONENT library
DESTINATION lib
COMPONENT library
)
ELSE(WIN32)
INSTALL(TARGETS qgvcore
ARCHIVE DESTINATION ${LIB_INSTALL_DIR}
LIBRARY DESTINATION ${LIB_INSTALL_DIR}
LIBRARY DESTINATION lib
COMPONENT library
)
ENDIF(WIN32)
......@@ -95,7 +88,7 @@ ENDIF(WIN32)
# The COMPONENT option only defines the internal belonging of the INSTALL'ed thing
# INSTALL(
# FILES ${qgvlib_TRANS}
# DESTINATION ${qm_DIR}
# DESTINATION ${qm_DIR}
# COMPONENT library
# )
......@@ -135,12 +128,3 @@ IF(WIN32)
COMPONENT graphvizlibs
)
ENDIF(WIN32)
IF(BUILD_DEV)
FILE(GLOB header "${CMAKE_CURRENT_SOURCE_DIR}/*.h")
INSTALL(
FILES ${header}
DESTINATION ${include_DIR}
COMPONENT headerfiles
)
ENDIF(BUILD_DEV)
......@@ -9,7 +9,7 @@ unix {
}
win32 {
#Configure Windows GraphViz path here :
GRAPHVIZ_PATH = "D:/Program Files (x86)/Graphviz2.36/"
GRAPHVIZ_PATH = "/usr/"
DEFINES += WIN32_DLL
DEFINES += GVDLL
INCLUDEPATH += $$GRAPHVIZ_PATH/include/graphviz
......
......@@ -65,6 +65,6 @@ ENDIF(BINDINGS_QT5)
# The COMPONENT option only defines the internal belonging of the INSTALL'ed thing
INSTALL(
TARGETS sample
RUNTIME DESTINATION ${bin_DIR}
DESTINATION bin
COMPONENT sample
)
Subproject commit 8e9b46446f92899025173f047b3950fcd21b89f4
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