Commit fca73d0a authored by saubatn's avatar saubatn
Browse files

FIXED CamiTKApplication : missing camitkcore dependencies.

FIXED CamiTKConfig => camitkcore and qtpropertybrowser dependencies name for linking.
UPDATED Simplify all libraries CMakeLists.txt file.

git-svn-id: svn+ssh://scm.forge.imag.fr/var/lib/gforge/chroot/scmrepos/svn/camitk/trunk/camitk@861 ec899d31-69d1-42ba-9299-647d76f65fb3
parent 01dbcdbc
......@@ -2,12 +2,6 @@ project(LML)
cmake_minimum_required(VERSION 2.6)
if (PACKAGING_NSIS)
set(LIB_NAME library_lml)
else()
set(LIB_NAME library-lml)
endif()
# Is this tool is compiled inside or outside CamiTK (as a standalone)?
if (NOT CEP_NAME STREQUAL "modeling")
# if this tool is compiled independantly from CamiTK
......@@ -59,6 +53,9 @@ set( SRCS
camitk_library(STATIC
SOURCES ${SRCS}
NEEDS_LIBXML2
HEADERS_TO_INSTALL ${HEADERS}
CEP_NAME CEP_MODELING
DESCRIPTION "Tools to describes a biomechanical model."
)
#---------
......@@ -66,34 +63,6 @@ camitk_library(STATIC
#---------
add_subdirectory(test)
#--------------
# installation
#--------------
if (PACKAGING_NSIS)
export_headers( ${HEADERS}
COMPONENT library_lml
GROUP libraries
)
else()
export_headers( ${HEADERS}
COMPONENT library-lml
GROUP libraries
)
endif()
cpack_add_component( ${LIB_NAME}
DISPLAY_NAME ${LIB_NAME}
DESCRIPTION "Tools to describes a biomechanical model."
GROUP CEP_MODELING
)
# # lib installation
# install(TARGETS lml
# ARCHIVE DESTINATION lib/${CAMITK_SHORT_VERSION_STRING}
# COMPONENT lml
# )
#-------------------
# api documentation
#-------------------
......
......@@ -379,6 +379,8 @@ camitk_library(SHARED
INCLUDE_DIRECTORIES ${monitoring_INCLUDE_DIR}
LINK_DIRECTORIES ${monitoring_link}
NEEDS_LIBXML2
CEP_NAME CEP_MODELING
DESCRIPTION "Tools to monitor a biomechanical deformation."
)
if (PACKAGING_NSIS)
......@@ -572,18 +574,4 @@ export_headers(
MMLAPI.h
COMPONENT ${LIB_NAME}
GROUP libraries
)
# lib installation
# install(TARGETS monitoring
# RUNTIME DESTINATION bin
# LIBRARY DESTINATION lib
# ARCHIVE DESTINATION lib/${CAMITK_SHORT_VERSION_STRING}
# COMPONENT monitoring
# )
cpack_add_component( ${LIB_NAME}
DISPLAY_NAME ${LIB_NAME}
DESCRIPTION "Tools to monitor a biomechanical deformation."
GROUP CEP_MODELING
)
)
\ No newline at end of file
project(mml)
if(PACKAGING_NSIS)
set(LIB_NAME library_mml)
else()
set(LIB_NAME library-mml)
endif()
# XSD really needed
find_package(XSD REQUIRED)
......@@ -45,24 +39,7 @@ camitk_library(STATIC
LIBNAME mml
SOURCES ${monitoringLib_SRCS}
NEEDS_XSD
)
#--------------
# installation
#--------------
export_headers( ${monitoringLib_H}
COMPONENT ${LIB_NAME}
GROUP libraries
)
# lib installation
# install(TARGETS mml
# ARCHIVE DESTINATION lib/${CAMITK_SHORT_VERSION_STRING}
# COMPONENT mml
# )
cpack_add_component( ${LIB_NAME}
DISPLAY_NAME ${LIB_NAME}
DESCRIPTION "Tools to describes a biomechanical model."
GROUP CEP_MODELING
)
HEADERS_TO_INSTALL ${monitoringLib_H}
CEP_NAME CEP_MODELING
DESCRIPTION "Tools to describes a biomechanical model."
)
\ No newline at end of file
......@@ -69,6 +69,9 @@ camitk_library(STATIC
SOURCES ${SRCS}
INCLUDE_DIRECTORIES ${PhysicalModelProperties_DIR}
NEEDS_LIBXML2
HEADERS_TO_INSTALL ${HEADERS}
CEP_NAME CEP_MODELING
DESCRIPTION "Tools to describes a biomechanical model."
)
#-----------
......@@ -81,29 +84,6 @@ add_subdirectory(test)
#-----------
add_subdirectory(tools)
#--------------
# installation
#--------------
if (PACKAGING_NSIS)
export_headers( ${HEADERS}
COMPONENT ${LIB_NAME}
GROUP libraries
)
else()
export_headers( ${HEADERS}
COMPONENT ${LIB_NAME}
GROUP libraries
)
endif()
cpack_add_component( ${LIB_NAME}
DISPLAY_NAME ${LIB_NAME}
DESCRIPTION "Tools to describes a biomechanical model."
GROUP CEP_MODELING
)
# lib installation
# install(TARGETS pml
# ARCHIVE DESTINATION lib/${CAMITK_SHORT_VERSION_STRING}
......
......@@ -34,39 +34,16 @@ set(CUSTOM_PLOT_SOURCES
add_definitions(-DCOMPILE_QCUSTOMPLOT)
# take all the headers for installation
file(GLOB HEADERS_H "src/*.h")
file(GLOB HEADERS_UPPERCASE "src/Qt*")
# add lib as a camitk tool
camitk_library(SHARED
SOURCES ${CUSTOM_PLOT_SOURCES}
TARGET_LINK_LIBRARIES ${QT_LIBRARIES}
INCLUDE_DIRECTORIES ${QT_INCLUDE_DIR}
)
# take all the headers for installation
file(GLOB HEADERS_H "src/*.h")
file(GLOB HEADERS_UPPERCASE "src/Qt*")
#--------------
# installation
#--------------
export_headers(${CUSTOM_PLOT_HEADERS}
COMPONENT ${LIB_NAME}
GROUP libraries
)
# lib installation
# install(TARGETS qcustomplot
# RUNTIME DESTINATION bin
# LIBRARY DESTINATION lib
# ARCHIVE DESTINATION lib/${CAMITK_SHORT_VERSION_STRING}
# COMPONENT qcustomplot
# )
cpack_add_component( ${LIB_NAME}
DISPLAY_NAME ${LIB_NAME}
DESCRIPTION "Tool to draw dots (plots) in a Qt interface."
GROUP CEP_MODELING
)
\ No newline at end of file
HEADERS_TO_INSTALL ${CUSTOM_PLOT_HEADERS}
CEP_NAME CEP_MODELING
DESCRIPTION "Tool to draw dots (plots) in a Qt interface."
)
\ No newline at end of file
......@@ -127,8 +127,7 @@ set(CAMITK_INCLUDE_DIRECTORIES
# postfix for MSVC debug version
set(CAMITK_DEBUG_POSTFIX "-debug")
# Name of the core library to link against
set(CAMITK_CORE_LIBRARIES ${CAMITK_CORE_TARGET_LIB_NAME})
# basic list of all lib needed for linking with CamiTK core
if(MSVC)
......@@ -167,7 +166,10 @@ if(MSVC)
optimized qtpropertybrowser
)
else()
if(CMAKE_GENERATOR MATCHES "MinGW Makefiles") # Win32 running with MinGW
# Name of the core library to link against
set(CAMITK_CORE_LIBRARIES ${CAMITK_CORE_LIB_NAME})
# if(CMAKE_GENERATOR MATCHES "MinGW Makefiles") # Win32 running with MinGW
# list of all core dependencies
set(CAMITK_LIBRARIES
${QT_LIBRARIES}
......@@ -185,26 +187,26 @@ else()
QVTK
qtpropertybrowser
)
else() #Linux (or MacOS) platform.
# list of all core dependencies
set(CAMITK_LIBRARIES
${QT_LIBRARIES}
vtkCommon
vtkFiltering
vtkGenericFiltering
vtkGraphics
vtkHybrid
vtkImaging
vtkIO
vtkRendering
vtkVolumeRendering
vtkftgl
vtkWidgets
QVTK
library-qtpropertybrowser
)
endif()
else()
# else() #Linux (or MacOS) platform.
# # list of all core dependencies
# set(CAMITK_LIBRARIES
# ${QT_LIBRARIES}
# vtkCommon
# vtkFiltering
# vtkGenericFiltering
# vtkGraphics
# vtkHybrid
# vtkImaging
# vtkIO
# vtkRendering
# vtkVolumeRendering
# vtkftgl
# vtkWidgets
# QVTK
# qtpropertybrowser
# )
# endif()
# else()
endif()
......
......@@ -273,6 +273,9 @@ macro(camitk_application)
RUNTIME_OUTPUT_DIRECTORY_DEBUG ${CAMITK_BUILD_BIN_DIR}
RUNTIME_OUTPUT_DIRECTORY_RELEASE ${CAMITK_BUILD_BIN_DIR}
)
# Application requires at least camitkcore library
add_dependencies(${APPLICATION_TARGET_NAME} ${CAMITK_CORE_TARGET_LIB_NAME})
# CEP library dependencies
if(${APPLICATION_TARGET_NAME}_NEEDS_CEP_LIBRARIES)
......
......@@ -23,6 +23,10 @@
#! [LINK_DIRECTORIES dir1 dir2...]
#! [LIBNAME libname]
#! [PUBLIC]
#! [HEADERS_TO_INSTALL]
#! [CEP_NAME]
#! [DESCRIPTION]
#!
#! )
#! \endcode
#!
......@@ -38,11 +42,20 @@
#! \param PUBLIC The library is a public library that has to be loaded directly by the operating system.
#! It is generally only needed for SDK library. A public library should not be installed in the
#! lib/${CAMITK_SHORT_VERSION_STRING} but directly in lib/ (on Unix/MacOS) or bin/ (on windows)
#! \param HEADERS_TO_INSTALL list of headers to install, if present this will automatically
#! create an "install-COMPONENT_NAMEcomponent" target, that can be used
#! anywhere else to manage dependencies to this component.
#! The headers are installed ${CAMITK_BUILD_INCLUDE_DIR}/COMPONENT_NAME
#! when the target "install-COMPONENT_NAMEcomponent" is called.
#! \param CEP_NAME specify the CEP_NAME, which is used to categorized the extension for packaging purpose
#! No CEP_NAME provided will result in default categorization (generic extension).
#! \param DESCRIPTION Simple description of the extension. Used for packaging presentation for instance.
macro(camitk_library)
get_directory_name(${CMAKE_CURRENT_SOURCE_DIR} DEFAULT_LIBRARY_NAME)
parse_arguments(${DEFAULT_LIBRARY_NAME_CMAKE}
"SOURCES;TARGET_LINK_LIBRARIES;INCLUDE_DIRECTORIES;LIBNAME;LINK_DIRECTORIES" # possible lists
"SOURCES;TARGET_LINK_LIBRARIES;INCLUDE_DIRECTORIES;LIBNAME;LINK_DIRECTORIES;HEADERS_TO_INSTALL;CEP_NAME;DESCRIPTION" # possible lists
"SHARED;STATIC;NEEDS_LIBXML2;NEEDS_XERCESC;NEEDS_XSD;PUBLIC" # possible options
${ARGN}
)
......@@ -199,12 +212,14 @@ macro(camitk_library)
if(FPIC_FLAG_ACCEPTED AND NOT WIN32)
set_property(TARGET ${LIBRARY_TARGET_NAME} APPEND PROPERTY COMPILE_FLAGS -fPIC)
endif()
#add libraries needed during the link
target_link_libraries(${LIBRARY_TARGET_NAME} ${${DEFAULT_LIBRARY_NAME_CMAKE}_TARGET_LINK_LIBRARIES} ${LIBXML2_LIBRARIES} ${XERCESC_LIBRARY})
# generate an install target for headers in include/{camitk-version}/libraries
if(${DEFAULT_LIBRARY_NAME_CMAKE}_HEADERS_TO_INSTALL)
export_headers(${${DEFAULT_LIBRARY_NAME_CMAKE}_HEADERS_TO_INSTALL} COMPONENT ${LIBRARY_TARGET_NAME} GROUP libraries)
endif()
# lib installation (depending if this one is public or not)
if (${DEFAULT_LIBRARY_NAME_CMAKE}_PUBLIC) # public library
......@@ -235,6 +250,34 @@ macro(camitk_library)
)
endif()
# Categorized the library in the install shield wizard.
if(${DEFAULT_LIBRARY_NAME_CMAKE}_CEP_NAME)
if (${DEFAULT_LIBRARY_NAME_CMAKE}_CEP_NAME MATCHES "SDK")
# The default SDK extensions are categorized as "required" and are not "unselectable" by the user at installation time
cpack_add_component(${LIBRARY_TARGET_NAME}
DISPLAY_NAME ${LIBRARY_TARGET_NAME}
DESCRIPTION ${${DEFAULT_LIBRARY_NAME_CMAKE}_DESCRIPTION}
REQUIRED
GROUP SDK
)
else()
# Extension is selectable for installation in the wizard of the installer
cpack_add_component(${LIBRARY_TARGET_NAME}
DISPLAY_NAME ${LIBRARY_TARGET_NAME}
DESCRIPTION ${${DEFAULT_LIBRARY_NAME_CMAKE}_DESCRIPTION}
GROUP ${${DEFAULT_LIBRARY_NAME_CMAKE}_CEP_NAME}
)
endif()
else()
# Extension if not categorized for packaging presentation
cpack_add_component(${LIBRARY_TARGET_NAME}
DISPLAY_NAME ${LIBRARY_TARGET_NAME}
DESCRIPTION ${${DEFAULT_LIBRARY_NAME_CMAKE}_DESCRIPTION}
)
endif()
endmacro()
# Old macro to configure a tool
......
......@@ -36,7 +36,7 @@ set(CAMITKCORE_LIBRARY_PROPERTIES ${CAMITKCORE_LIBRARY_PROPERTIES}
# camitkcore only depends on qtpropertybrowser, which is a public library
# add the library path as an additionnal to look for.
link_directories(${CAMITK_BUILD_BIN_DIR})
link_directories(${CAMITK_BUILD_BIN_DIR} ${CAMITK_PUBLIC_LIB_DIR})
# CAMITK_CORE_LIB_NAME needs to be SHARED and loaded only ONCE otherwise the extensions
# can have their own copy of CAMITK_CORE_LIB_NAME, which will generates loads of problems
......
......@@ -36,26 +36,7 @@ endif()
camitk_library(STATIC
SOURCES ${XSD_H} ${XSD_SRCS}
NEEDS_XSD
)
#--------------
# installation
#--------------
export_headers(${XSD_H}
COMPONENT ${LIB_NAME}
GROUP libraries
)
# lib installation
# install(TARGETS coreschema
# ARCHIVE DESTINATION lib/${CAMITK_SHORT_VERSION_STRING}
# COMPONENT coreschema
# )
cpack_add_component( ${LIB_NAME}
DISPLAY_NAME ${LIB_NAME}
DESCRIPTION "Allows data-binding in XML of core basic classes. Required by the application wizard for instance."
REQUIRED
GROUP SDK
)
\ No newline at end of file
HEADERS_TO_INSTALL ${XSD_H}
CEP_NAME SDK
DESCRIPTION "Allows data-binding in XML of core basic classes. Required by the application wizard for instance."
)
\ No newline at end of file
......@@ -135,28 +135,15 @@ set(SRCS ${extension_MOC}
add_definitions(-DCOMPILE_QTPROPERTYBROWSER)
# take all the headers for installation
file(GLOB HEADERS_H "src/*.h")
file(GLOB HEADERS_UPPERCASE "src/Qt*")
camitk_library(SHARED
SOURCES ${SRCS}
TARGET_LINK_LIBRARIES ${QT_LIBRARIES}
PUBLIC #install directly in lib (or bin for Windows).
)
# take all the headers for installation
file(GLOB HEADERS_H "src/*.h")
file(GLOB HEADERS_UPPERCASE "src/Qt*")
#--------------
# installation
#--------------
export_headers( ${HEADERS_H} ${HEADERS_UPPERCASE}
COMPONENT ${LIB_NAME}
GROUP libraries
)
cpack_add_component( ${LIB_NAME}
DISPLAY_NAME ${LIB_NAME}
DESCRIPTION "Allows displaying and editing Qt Meta Object properties. Used to display component properties. This library is required."
REQUIRED
GROUP SDK
)
HEADERS_TO_INSTALL ${HEADERS_H} ${HEADERS_UPPERCASE}
CEP_NAME SDK
DESCRIPTION "Allows displaying and editing Qt Meta Object properties. Used to display component properties. This library is required."
)
\ No newline at end of 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