Commit 886ad8be authored by promayon's avatar promayon
Browse files

FIXED mml library now called mmlschema (consistant naming over CamiTK)

FIXED more CMakeList cleaning up and prep for full camitk-ization of MML


git-svn-id: svn+ssh://scm.forge.imag.fr/var/lib/gforge/chroot/scmrepos/svn/camitk/trunk/camitk@2051 ec899d31-69d1-42ba-9299-647d76f65fb3
parent 6cacb703
# Old Legacy support for Sofa, not supported
# "find" SOFA (you need to have a SOFA_DIR environment variable
# "find" SOFA (you need to have a SOFA_BUILD_DIR environment variable
# or to define it manually during configuration process)
set(SOFA_DIR $ENV{SOFA_DIR} CACHE PATH "Where to find SOFA (for SOFA svn, this is the build directory)")
if(EXISTS ${SOFA_DIR})
set(SOFA_BUILD_DIR $ENV{SOFA_BUILD_DIR} CACHE PATH "Where to find SOFA (for SOFA svn, this is the build directory)")
if(EXISTS ${SOFA_BUILD_DIR})
# Compile SOFA .scn import filter? (ON or OFF)
option(SOFA_SUPPORT "Compile SOFA Simulator?" ON)
endif(EXISTS ${SOFA_DIR})
endif(EXISTS ${SOFA_BUILD_DIR})
# sofa settings
# previous versions of Sofa
......@@ -19,18 +19,18 @@ if(SOFA_SUPPORT)
# unsupported previous versions
# use at your own risk, no guarantee what so ever!
add_definitions(-DSOFA_SUPPORT)
add_definitions(-DSOFA_PATH="${SOFA_DIR}")
add_definitions(-DSOFA_PATH="${SOFA_BUILD_DIR}")
option(MML_SOFA_SVN "Set to ON (default) if SOFA svn build dir is available in ${SOFA_DIR}" ON)
option(MML_SOFA_1_0_RC1 "Set to ON if SOFA 1.0 RC1 is available in ${SOFA_DIR}" OFF)
option(MML_SOFA_1_0_BETA4 "Set to if SOFA 1.0 beta 4 is available in ${SOFA_DIR}" OFF)
option(MML_SOFA_SVN "Set to ON (default) if SOFA svn build dir is available in ${SOFA_BUILD_DIR}" ON)
option(MML_SOFA_1_0_RC1 "Set to ON if SOFA 1.0 RC1 is available in ${SOFA_BUILD_DIR}" OFF)
option(MML_SOFA_1_0_BETA4 "Set to if SOFA 1.0 beta 4 is available in ${SOFA_BUILD_DIR}" OFF)
# compilation flag
if (MML_SOFA_SVN)
# include and everything else needed => path to source tree needed
# automatically get the value of CMAKE_SOURCE_DIR in the build directory toplevel Makefile
# 1. Get the correct line from the CMakeCache file
file(STRINGS ${SOFA_DIR}/CMakeCache.txt SOFA_SOURCE_DIR_LINE REGEX "^Sofa_SOURCE_DIR:STATIC=(.*)$")
file(STRINGS ${SOFA_BUILD_DIR}/CMakeCache.txt SOFA_SOURCE_DIR_LINE REGEX "^Sofa_SOURCE_DIR:STATIC=(.*)$")
# 2. Use a regex to extract the path from the line
string(REGEX REPLACE "^Sofa_SOURCE_DIR:STATIC=(.*)$" "\\1" SOFA_SOURCE_DIR "${SOFA_SOURCE_DIR_LINE}")
message("Detected sofa source directory is ${SOFA_SOURCE_DIR}")
......@@ -126,15 +126,15 @@ if(SOFA_SUPPORT)
#SofaMiscTopologyDev
SofaMiscEngine
)
set(SOFA_LIB_DIR ${SOFA_DIR}/lib)
set(SOFA_LIB_DIR ${SOFA_BUILD_DIR}/lib)
endif()
if (MML_SOFA_1_0_RC1)
# old sofa RC1 from the tarballs
if(WIN32)
set(SOFA_LIB_DIR ${SOFA_DIR}/lib/win32/ReleaseVC9 ${SOFA_DIR}/lib/win32 ${SOFA_DIR}/lib ${SOFA_DIR}/bin )
set(SOFA_LIB_DIR ${SOFA_BUILD_DIR}/lib/win32/ReleaseVC9 ${SOFA_BUILD_DIR}/lib/win32 ${SOFA_BUILD_DIR}/lib ${SOFA_BUILD_DIR}/bin )
else()
set(SOFA_LIB_DIR ${SOFA_DIR}/lib/linux ${SOFA_DIR}/lib)
set(SOFA_LIB_DIR ${SOFA_BUILD_DIR}/lib/linux ${SOFA_BUILD_DIR}/lib)
endif()
# set dependencies
......@@ -197,8 +197,8 @@ if(SOFA_SUPPORT)
if (MML_SOFA_1_0_BETA4 OR MML_SOFA_1_0_RC1)
# includes
set(SOFA_INCLUDE_DIR ${SOFA_DIR}/include ${SOFA_DIR}/modules ${SOFA_DIR}/framework
${SOFA_DIR}/extlibs/miniBoost ${SOFA_DIR}/include/modules
${SOFA_DIR}/include/framework ${SOFA_DIR}/include/extlibs/miniBoost )
set(SOFA_INCLUDE_DIR ${SOFA_BUILD_DIR}/include ${SOFA_BUILD_DIR}/modules ${SOFA_BUILD_DIR}/framework
${SOFA_BUILD_DIR}/extlibs/miniBoost ${SOFA_BUILD_DIR}/include/modules
${SOFA_BUILD_DIR}/include/framework ${SOFA_BUILD_DIR}/include/extlibs/miniBoost )
endif()
endif()
......@@ -6,15 +6,15 @@
# This file defines the following variables:
# - SOFA_SUPPORTED_VERSION the name of the currently supported Sofa stable version
# this is equal to the git tag
# - SOFA_DIR To be set by the user to the Sofa build directory
# - SOFA_BUILD_DIR To be set by the user to the Sofa build directory
# This is mandatory to have the Sofa support
#
# If Sofa support is enabled by the user by setting the build directory,
# the following variables are defined:
# - SOFA_SUPPORT Set to ON
# - SOFA_SOURCE_DIR The top-level directory of the Sofa source.
# Automatically extracted/hacked from the CMakeCache.txt in the
# build directory
# - SOFA_SOURCE_DIR The top-level directory of the Sofa source.
# Automatically extracted/hacked from the CMakeCache.txt in the
# build directory (${SOFA_BUILD_DIR})
# - SOFA_LIBS List of Sofa libraries to link against needed at link time
# - SOFA_LIB_DIR Directory where to find the compiled Sofa libraries
# - SOFA_INCLUDE_DIR Sofa include directories needed a compile time
......@@ -22,7 +22,7 @@
# If Sofa support is enabled by the user by setting the build directory,
# the following flags are defined:
# -DSOFA_SUPPORT
# -DSOFA_PATH="${SOFA_DIR}"
# -DSOFA_PATH="${SOFA_BUILD_DIR}"
# -DSOFA_STABLE
# list of possibly supported sofa STABLE version
......@@ -34,10 +34,10 @@ set(SOFA_STABLE_V15_03 "sofa-v15.03")
# To support a new version, add a new SOFA_STABLE_V... above and modify this
set(SOFA_SUPPORTED_VERSION ${SOFA_STABLE_V15_03})
# "find" SOFA (you need to have a SOFA_DIR environment variable
# "find" SOFA (you need to have a SOFA_BUILD_DIR environment variable
# or to define it manually during configuration process)
set(SOFA_DIR $ENV{SOFA_DIR} CACHE PATH "Where to find SOFA (stable) ${SOFA_SUPPORTED_VERSION} build directory")
if(EXISTS ${SOFA_DIR})
set(SOFA_BUILD_DIR $ENV{SOFA_BUILD_DIR} CACHE PATH "Where to find SOFA (stable) ${SOFA_SUPPORTED_VERSION} build directory")
if(EXISTS ${SOFA_BUILD_DIR})
# Compile SOFA .scn import filter? (ON or OFF)
option(SOFA_SUPPORT "Compile SOFA MML Simulator?" ON)
endif()
......@@ -45,7 +45,8 @@ endif()
# sofa settings
if(SOFA_SUPPORT)
add_definitions(-DSOFA_SUPPORT)
add_definitions(-DSOFA_PATH="${SOFA_DIR}")
add_definitions(-DSOFA_PATH="${SOFA_BUILD_DIR}")
add_definitions(-DSOFA_STABLE)
# supported stable version 15.03
if (SOFA_SUPPORTED_VERSION STREQUAL "${SOFA_STABLE_V15_03}")
......@@ -53,9 +54,9 @@ if(SOFA_SUPPORT)
# TODO one day when Sofa includes an install phase and FindSofa.cmake, everything should be easier:
# # use Find SOFA script
# set(SOFA_DIR ${SOFA_SOURCE_DIR})
# include(${SOFA_DIR}/cmake/Modules/FindSOFA.cmake)
# list(APPEND CMAKE_MODULE_PATH "${SOFA_DIR}/cmake/Modules")
# set(SOFA_BUILD_DIR ${SOFA_SOURCE_DIR})
# include(${SOFA_BUILD_DIR}/cmake/Modules/FindSOFA.cmake)
# list(APPEND CMAKE_MODULE_PATH "${SOFA_BUILD_DIR}/cmake/Modules")
# find_package(SOFA)
# # Check the FindSofa.cmake and "translate" all their variables here
# set(SOFA_INCLUDE_DIR ${SOFA_INCLUDE_DIRS})
......@@ -72,13 +73,11 @@ if(SOFA_SUPPORT)
# to automatically get the value the source directory (in the CMAKE_SOURCE_DIR variable)
# So here it is in two steps
# 1. Get the correct line from the CMakeCache file
file(STRINGS ${SOFA_DIR}/CMakeCache.txt SOFA_SOURCE_DIR_LINE REGEX "^Sofa_SOURCE_DIR:STATIC=(.*)$")
file(STRINGS ${SOFA_BUILD_DIR}/CMakeCache.txt SOFA_SOURCE_DIR_LINE REGEX "^Sofa_SOURCE_DIR:STATIC=(.*)$")
# 2. Use a regex to extract the path from the line
string(REGEX REPLACE "^Sofa_SOURCE_DIR:STATIC=(.*)$" "\\1" SOFA_SOURCE_DIR "${SOFA_SOURCE_DIR_LINE}")
message("Detected Sofa ${MML_SOFA_STABLE} source directory is ${SOFA_SOURCE_DIR}")
add_definitions(-DSOFA_STABLE)
# fill the list of needed libraries
set(SOFA_LIBS
# SOFA_LIB_NAME
......@@ -159,7 +158,7 @@ if(SOFA_SUPPORT)
)
# Library path
set(SOFA_LIB_DIR ${SOFA_DIR}/lib)
set(SOFA_LIB_DIR ${SOFA_BUILD_DIR}/lib)
# fill in the required include path
# use sofa source directory for sofa stable version
......
camitk_extension(ACTION_EXTENSION
NEEDS_LIBXML2
NEEDS_XSD
NEEDS_CEP_LIBRARIES pml mml monitoringgui monitoring lml
NEEDS_CEP_LIBRARIES pml mmlschema monitoringgui monitoring lml
NEEDS_COMPONENT_EXTENSION physicalmodel mmlcomponent vtkmesh physicalmodel msh
CEP_NAME CEP_MODELING
DESCRIPTION "Action MML features algorithms applicable on MML components."
......
......@@ -27,8 +27,8 @@
#include <MonitoringManagerFactory.h>
#include <SimulatorFactory.h>
#include <mml/MonitorIn.hxx>
#include <lml/Translation.h>
#include <MonitorIn.hxx>
#include <Translation.h>
#include <MultiComponent.h>
#include "GenerateModel.h"
......
......@@ -7,7 +7,7 @@ camitk_extension( COMPONENT_EXTENSION
DEFINES COMPILE_MMLCOMPONENT_API
NEEDS_LIBXML2
NEEDS_XSD
NEEDS_CEP_LIBRARIES pml lml mml monitoringgui monitoring
NEEDS_CEP_LIBRARIES pml lml mmlschema monitoringgui monitoring
NEEDS_COMPONENT_EXTENSION vtkmesh physicalmodel
HEADERS_TO_INSTALL MMLComponentExtension.h
MMLComponent.h
......
......@@ -8,28 +8,13 @@ endif()
# see cmake --help-policy CMP0022 for more information
cmake_minimum_required(VERSION 2.6)
set(MML_INCLUDE_DIRECTORIES
${CAMITK_INCLUDE_DIRECTORIES}
${CAMITK_INCLUDE_DIR}/libraries
${CAMITK_INCLUDE_DIR}/libraries/monitoring
${CAMITK_INCLUDE_DIR}/libraries/mml
${CAMITK_INCLUDE_DIR}/libraries/pml
${CAMITK_INCLUDE_DIR}/libraries/lml
${LIBXML2_INCLUDE_DIR}
${XERCESC_INCLUDE_DIR}
${XSD_INCLUDE_DIR}
)
set(MML_LIBRARIES
${LIBXML2_LIBRARIES}
${XERCESC_LIBRARIES}
)
# for generating GUI
option(MML_GENERATE_GUI "Generates MML GUI for CamiTK action" ON)
set(MML_GUI_INCLUDE_DIR ${QT_INCLUDE_DIR})
set(MML_GUI_LIBRARIES ${QT_LIBRARIES})
set(MMLSCHEMA_INCLUDE_DIR ${CAMITK_INCLUDE_DIR}/libraries/mmlschema)
# define names of the output libraries globally
set(PML_LIBRARY_NAME library${TARGET_NAME_SEPARATOR}pml)
set(LML_LIBRARY_NAME library${TARGET_NAME_SEPARATOR}lml)
......
# generation benchmark binary is optionnal
# The mml applications are not defined as camitk applications
# (they do not use the camitk_application macro)
# => includes, libraries and link path have to be defined manually
# and used in the subdirectories CMakeLists.txt
# respectively with:
# include_directories(${MML_INCLUDE_DIRECTORIES})
# set(applicationname_LIBRARIES ${MML_LIBRARIES} ...)
# link_directories(${MML_LINK_DIRECTORIES})
set(MML_INCLUDE_DIRECTORIES
${CAMITK_INCLUDE_DIRECTORIES}
${CAMITK_INCLUDE_DIR}/libraries
${MMLSCHEMA_INCLUDE_DIR}
${CAMITK_INCLUDE_DIR}/libraries/monitoring
${CAMITK_INCLUDE_DIR}/libraries/pml
${CAMITK_INCLUDE_DIR}/libraries/lml
${LIBXML2_INCLUDE_DIR}
${XERCESC_INCLUDE_DIR}
${XSD_INCLUDE_DIR}
${SOFA_INCLUDE_DIR}
)
set(MML_LIBRARIES
${LIBXML2_LIBRARIES}
${XERCESC_LIBRARIES}
monitoring
)
set(MML_LINK_DIRECTORIES
${CAMITK_LINK_DIRECTORIES}
${SOFA_LIB_DIR}
)
if(MML_GENERATE_GUI)
find_package(Qt4 REQUIRED)
add_definitions(-DMML_GENERATE_GUI)
......
project(benchmark)
if(MML_GENERATE_GUI)
find_package(Qt4 REQUIRED)
include(${QT_USE_FILE})
set(benchmark_LIBRARIES ${QT_LIBRARIES})
endif()
set(benchmark_LIBRARIES
${MML_LIBRARIES}
${MONITORING_LIBRARY_NAME}
${benchmark_LIBRARIES}
)
set(HEADERS
)
......@@ -16,13 +21,13 @@ set(SRCS
include_directories(${MML_INCLUDE_DIRECTORIES})
link_directories(${CAMITK_LINK_DIRECTORIES} ${SOFA_LIB_DIR})
link_directories(${MML_LINK_DIRECTORIES})
add_executable(benchmark ${SRCS})
message(STATUS " : benchmark_LIBRARIES = ${benchmark_LIBRARIES}")
target_link_libraries(benchmark ${benchmark_LIBRARIES} ${QT_LIBRARIES})
target_link_libraries(benchmark ${benchmark_LIBRARIES})
add_custom_target(benchmakBin ALL)
......
......@@ -26,9 +26,9 @@
#include <memory> // std::auto_ptr
#include <iostream>
#include "MonitorIn.hxx"
#include "MonitoringManager.h"
#include "MonitoringManagerFactory.h"
#include <MonitorIn.hxx>
#include <MonitoringManager.h>
#include <MonitoringManagerFactory.h>
#ifdef MML_GENERATE_GUI
#include <QApplication>
......
project(gui)
find_package(Qt4 REQUIRED)
include(${QT_USE_FILE})
if(MML_GENERATE_GUI)
find_package(Qt4 REQUIRED)
include(${QT_USE_FILE})
set(gui_LIBRARIES ${QT_LIBRARIES})
endif()
set(gui_MOC_SRCS
MonitoringGuiManager.h
......@@ -45,20 +48,23 @@ camitk_library( STATIC
NEEDS_XSD
LIBNAME monitoringgui
SOURCES ${gui_SRCS}
NEEDS_CEP_LIBRARIES monitoring pml lml mml
NEEDS_CEP_LIBRARIES monitoring pml lml mmlschema
INCLUDE_DIRECTORIES ${MML_INCLUDE_DIRECTORIES}
)
set(MONITORING_GUI_LIBRARY_NAME ${LIBRARY_TARGET_NAME})
add_dependencies(${MONITORING_GUI_LIBRARY_NAME} ${MONITORING_LIBRARY_NAME})
set(gui_LIBRARIES
${QT_LIBRARIES}
${gui_LIBRARIES}
${MML_LIBRARIES}
${MONITORING_LIBRARY_NAME}
)
add_executable(benchmarkgui ${gui_SRCS})
link_directories(${MML_LINK_DIRECTORIES})
target_link_libraries(benchmarkgui ${gui_LIBRARIES})
#--------------
......
......@@ -22,7 +22,7 @@ set(SRCS
include_directories(${MML_INCLUDE_DIRECTORIES})
link_directories(${paramExplorer_link})
link_directories(${MML_LINK_DIRECTORIES})
add_executable(paramExplorer ${SRCS})
......
......@@ -28,9 +28,9 @@
#include <fstream>
#include <map>
#include "MonitorIn.hxx"
#include "MonitoringManager.h"
#include "MonitoringManagerFactory.h"
#include <MonitorIn.hxx>
#include <MonitoringManager.h>
#include <MonitoringManagerFactory.h>
#include "MultiComponent.h"
......
......@@ -22,7 +22,7 @@ set(SRCS
include_directories(${MML_INCLUDE_DIRECTORIES})
link_directories(${CAMITK_LINK_DIRECTORIES})
link_directories(${MML_LINK_DIRECTORIES})
add_executable(pml2mmlOut ${SRCS})
......
......@@ -28,7 +28,7 @@
#include <pml/PhysicalModel.h>
#include "MonitorOut.hxx"
#include <MonitorOut.hxx>
#ifdef MML_GENERATE_GUI
#include <QApplication>
......
project(scn2pml)
set(scn2pml_LIBRARIES
${MML_LIBRARIES}
monitoring
)
set(HEADERS
)
set(HEADERS )
set(SRCS
scn2pml.cpp
${HEADERS}
)
include_directories(${MML_INCLUDE_DIRECTORIES} ${SOFA_INCLUDE_DIR})
include_directories(${MML_INCLUDE_DIRECTORIES})
link_directories(${scn2pml_link})
link_directories(${MML_LINK_DIRECTORIES})
add_executable(scn2pml ${SRCS})
target_link_libraries(scn2pml ${scn2pml_LIBRARIES})
target_link_libraries(scn2pml ${MML_LIBRARIES})
add_custom_target(scn2pmlBin ALL)
......
......@@ -149,7 +149,8 @@ set(monitoring_LINK_DIRECTORIES ${SOFA_LIB_DIR})
# Add all the include directories
set(monitoring_INCLUDE_DIR ${MML_GUI_INCLUDE_DIR}
set(monitoring_INCLUDE_DIRECTORIES ${MMLSCHEMA_INCLUDE_DIR}
${MML_GUI_INCLUDE_DIR}
${SOFA_INCLUDE_DIR}
${MML_ANSYS_WORKING_DIR}
${MML_ARTISYNTH_WORKING_DIR}
......@@ -162,9 +163,9 @@ camitk_library( SHARED
NEEDS_QT_MODULES
NEEDS_XERCESC
NEEDS_LIBXML2
NEEDS_CEP_LIBRARIES mml pml lml
NEEDS_CEP_LIBRARIES mmlschema pml lml
NEEDS_XSD
INCLUDE_DIRECTORIES ${monitoring_INCLUDE_DIR}
INCLUDE_DIRECTORIES ${monitoring_INCLUDE_DIRECTORIES}
LINK_DIRECTORIES ${monitoring_LINK_DIRECTORIES}
# Caution: probably need here for Ansys and Artisynth library something like - LINK_DIRECTORIES ${MML_ANSYS_WORKING_DIR}/lib ${MML_ARTISYNTH_WORKING_DIR}/lib
EXTERNAL_LIBRARIES ${monitoring_LIBRARIES}
......
......@@ -30,7 +30,7 @@
#include <vector>
#include "MonitorIn.hxx"
#include <MonitorIn.hxx>
// Stopping criteria includes
#include "StoppingCriterion.h"
......
......@@ -26,7 +26,7 @@
#ifndef STOPPINGCRITERION_STOPPINGCRITERIA_CRITERIAFACTORY_H
#define STOPPINGCRITERION_STOPPINGCRITERIA_CRITERIAFACTORY_H
#include "MonitorIn.hxx"
#include <MonitorIn.hxx>
// Stopping criteria includes
#include "Criterion.h"
......
......@@ -27,7 +27,7 @@
#ifndef STOPPINGCRITERION_STOPPINGCRITERIA_CRITERIA_FORCE_H
#define STOPPINGCRITERION_STOPPINGCRITERIA_CRITERIA_FORCE_H
#include "MonitorIn.hxx"
#include <MonitorIn.hxx>
// Stopping criteria includes
#include "Criterion.h"
......
......@@ -33,8 +33,8 @@
// Monitor includes
#include "MonitoringManager.h"
#include "MonitorIn.hxx"
#include "MonitorOut.hxx"
#include <MonitorIn.hxx>
#include <MonitorOut.hxx>
// Criterion includes
#include "StoppingCriterion.h"
......
Markdown is supported
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