Commit 8af6b5c9 authored by Nicolas Docquier's avatar Nicolas Docquier
Browse files

Merge branch 'dev' into 'master'

Release_1.9.5

See merge request !125
parents d9889c67 53573922
image: habra/ubuntu-robotran:v0
image: robotran/ubuntu-robotran-opengl:v0
# --------------------------------------------------------------------------
# Testing PendulumSpringC Example project ----------------------------------
# --------------------------------------------------------------------------
compilation_monolithic_realtimeOFF:
script:
......@@ -6,6 +11,8 @@ compilation_monolithic_realtimeOFF:
- cd ExampleProjects/PendulumSpringC/workR/build
- cmake -DFLAG_REAL_TIME=OFF ..
- make
- ./exe_PendulumSpringC
- ./exe_PendulumSpringC_several_run
compilation_monolithic_realtimeON:
script:
......@@ -13,6 +20,17 @@ compilation_monolithic_realtimeON:
- cd ExampleProjects/PendulumSpringC/workR/build
- cmake -DFLAG_REAL_TIME=ON ..
- make
- ./exe_PendulumSpringC
- ./exe_PendulumSpringC_several_run
compilation_monolithic_realtimeON_OpenGL:
script:
- mkdir ExampleProjects/PendulumSpringC/workR/build
- cd ExampleProjects/PendulumSpringC/workR/build
- cmake -DFLAG_REAL_TIME=ON -DFLAG_OPEN_GL=ON -DFLAG_JAVA=OFF ..
- make
- ./exe_PendulumSpringC
- ./exe_PendulumSpringC_several_run
compilation_separate_realtimeOFF:
script:
......@@ -25,6 +43,8 @@ compilation_separate_realtimeOFF:
- cd ExampleProjects/PendulumSpringC/workR/build
- cmake -DFLAG_SEPARATE_BUILD=ON ..
- make
- ./exe_PendulumSpringC
- ./exe_PendulumSpringC_several_run
compilation_separate_realtimeON:
script:
......@@ -37,6 +57,56 @@ compilation_separate_realtimeON:
- cd ExampleProjects/PendulumSpringC/workR/build
- cmake -DFLAG_SEPARATE_BUILD=ON ..
- make
- ./exe_PendulumSpringC
- ./exe_PendulumSpringC_several_run
compilation_separate_realtimeON_OpenGL:
script:
- mkdir MBsysC/build
- cd MBsysC/build
- cmake -DFLAG_REAL_TIME=ON -DFLAG_OPEN_GL=ON -DFLAG_JAVA=OFF ../mbs_common/
- make
- cd ../..
- mkdir ExampleProjects/PendulumSpringC/workR/build
- cd ExampleProjects/PendulumSpringC/workR/build
- cmake -DFLAG_SEPARATE_BUILD=ON ..
- make
- ./exe_PendulumSpringC
- ./exe_PendulumSpringC_several_run
# --------------------------------------------------------------------------
# New compilation: Testing PendulumSpringC Example project -----------------
# --------------------------------------------------------------------------
NewCompilation_separate_realtimeOFF:
script:
- mkdir MBsysC/build
- cd MBsysC/build
- cmake -DFLAG_REAL_TIME=OFF ..
- make
- cd ../..
- mkdir ExampleProjects/PendulumSpringC/workR/build
- cd ExampleProjects/PendulumSpringC/workR/build
- cmake -DFLAG_SEPARATE_BUILD=ON ..
- make
- ./exe_PendulumSpringC
NewCompilation_separate_realtimeON:
script:
- mkdir MBsysC/build
- cd MBsysC/build
- cmake -DFLAG_REAL_TIME=ON ..
- make
- cd ../..
- mkdir ExampleProjects/PendulumSpringC/workR/build
- cd ExampleProjects/PendulumSpringC/workR/build
- cmake -DFLAG_SEPARATE_BUILD=ON ..
- make
- ./exe_PendulumSpringC
# --------------------------------------------------------------------------
# New compilation: Testing all tutorials and compare results ---------------
# --------------------------------------------------------------------------
tutorial_1_monolithic:
script:
......@@ -55,7 +125,7 @@ tutorial_1_separate:
script:
- mkdir MBsysC/build
- cd MBsysC/build
- cmake -DFLAG_REAL_TIME=OFF ../mbs_common/
- cmake -DFLAG_REAL_TIME=OFF ..
- make
- cd ../..
- mkdir ExampleProjects/TutorialProjects/1_Bodies_and_Joints/workR/build
......@@ -87,7 +157,7 @@ tutorial_2_separate:
script:
- mkdir MBsysC/build
- cd MBsysC/build
- cmake -DFLAG_REAL_TIME=OFF ../mbs_common/
- cmake -DFLAG_REAL_TIME=OFF ..
- make
- cd ../..
- mkdir ExampleProjects/TutorialProjects/2_Links/workR/build
......@@ -120,7 +190,7 @@ tutorial_3_separate:
script:
- mkdir MBsysC/build
- cd MBsysC/build
- cmake -DFLAG_REAL_TIME=OFF ../mbs_common/
- cmake -DFLAG_REAL_TIME=OFF ..
- make
- cd ../..
- mkdir ExampleProjects/TutorialProjects/3_Cuts/workR/build
......@@ -154,7 +224,7 @@ tutorial_4_separate:
script:
- mkdir MBsysC/build
- cd MBsysC/build
- cmake -DFLAG_REAL_TIME=OFF ../mbs_common/
- cmake -DFLAG_REAL_TIME=OFF ..
- make
- cd ../..
- mkdir ExampleProjects/TutorialProjects/4_Driven_variable/workR/build
......@@ -182,14 +252,14 @@ tutorial_5_monolithic:
- diff -q dirdyn_qd_ref.res dirdyn_qd.res
- diff -q dirdyn_qdd_ref.res dirdyn_qdd.res
- diff -q dirdyn_Qq_ref.res dirdyn_Qq.res
- diff -q Vertical_Acc_ref.res Vertical_Acc.res
- diff -q Vertical_Acc_ref.res dirdyn_Vertical_Acc.res
- diff -q dirdyn_linkF_ref.res dirdyn_linkF.res
tutorial_5_separate:
script:
- mkdir MBsysC/build
- cd MBsysC/build
- cmake -DFLAG_REAL_TIME=OFF ../mbs_common/
- cmake -DFLAG_REAL_TIME=OFF ..
- make
- cd ../..
- mkdir ExampleProjects/TutorialProjects/5_Sensors/workR/build
......@@ -202,7 +272,7 @@ tutorial_5_separate:
- diff -q dirdyn_qd_ref.res dirdyn_qd.res
- diff -q dirdyn_qdd_ref.res dirdyn_qdd.res
- diff -q dirdyn_Qq_ref.res dirdyn_Qq.res
- diff -q Vertical_Acc_ref.res Vertical_Acc.res
- diff -q Vertical_Acc_ref.res dirdyn_Vertical_Acc.res
- diff -q dirdyn_linkF_ref.res dirdyn_linkF.res
tutorial_6_monolithic:
......@@ -217,14 +287,14 @@ tutorial_6_monolithic:
- diff -q dirdyn_qd_ref.res dirdyn_qd.res
- diff -q dirdyn_qdd_ref.res dirdyn_qdd.res
- diff -q dirdyn_Qq_ref.res dirdyn_Qq.res
- diff -q Vertical_Acc_ref.res Vertical_Acc.res
- diff -q Vertical_Acc_ref.res dirdyn_Vertical_Acc.res
- diff -q dirdyn_linkF_ref.res dirdyn_linkF.res
tutorial_6_separate:
script:
- mkdir MBsysC/build
- cd MBsysC/build
- cmake -DFLAG_REAL_TIME=OFF ../mbs_common/
- cmake -DFLAG_REAL_TIME=OFF ..
- make
- cd ../..
- mkdir ExampleProjects/TutorialProjects/6_External_Force/workR/build
......@@ -237,7 +307,7 @@ tutorial_6_separate:
- diff -q dirdyn_qd_ref.res dirdyn_qd.res
- diff -q dirdyn_qdd_ref.res dirdyn_qdd.res
- diff -q dirdyn_Qq_ref.res dirdyn_Qq.res
- diff -q Vertical_Acc_ref.res Vertical_Acc.res
- diff -q Vertical_Acc_ref.res dirdyn_Vertical_Acc.res
- diff -q dirdyn_linkF_ref.res dirdyn_linkF.res
tutorial_7_monolithic:
......@@ -252,14 +322,14 @@ tutorial_7_monolithic:
- diff -q dirdyn_qd_ref.res dirdyn_qd.res
- diff -q dirdyn_qdd_ref.res dirdyn_qdd.res
- diff -q dirdyn_Qq_ref.res dirdyn_Qq.res
- diff -q Vertical_Acc_ref.res Vertical_Acc.res
- diff -q Vertical_Acc_ref.res dirdyn_Vertical_Acc.res
- diff -q dirdyn_linkF_ref.res dirdyn_linkF.res
tutorial_7_separate:
script:
- mkdir MBsysC/build
- cd MBsysC/build
- cmake -DFLAG_REAL_TIME=OFF ../mbs_common/
- cmake -DFLAG_REAL_TIME=OFF ..
- make
- cd ../..
- mkdir ExampleProjects/TutorialProjects/7_User_constraints/workR/build
......@@ -272,7 +342,7 @@ tutorial_7_separate:
- diff -q dirdyn_qd_ref.res dirdyn_qd.res
- diff -q dirdyn_qdd_ref.res dirdyn_qdd.res
- diff -q dirdyn_Qq_ref.res dirdyn_Qq.res
- diff -q Vertical_Acc_ref.res Vertical_Acc.res
- diff -q Vertical_Acc_ref.res dirdyn_Vertical_Acc.res
- diff -q dirdyn_linkF_ref.res dirdyn_linkF.res
tutorial_8_monolithic:
......@@ -287,7 +357,7 @@ tutorial_8_monolithic:
- diff -q dirdyn_qd_ref.res dirdyn_qd.res
- diff -q dirdyn_qdd_ref.res dirdyn_qdd.res
- diff -q dirdyn_Qq_ref.res dirdyn_Qq.res
- diff -q Vertical_Acc_ref.res Vertical_Acc.res
- diff -q Vertical_Acc_ref.res dirdyn_Vertical_Acc.res
- diff -q dirdyn_linkF_ref.res dirdyn_linkF.res
- diff -q dirdyn_ux_ref.res dirdyn_ux.res
- diff -q dirdyn_uxd_ref.res dirdyn_uxd.res
......@@ -296,7 +366,7 @@ tutorial_8_separate:
script:
- mkdir MBsysC/build
- cd MBsysC/build
- cmake -DFLAG_REAL_TIME=OFF ../mbs_common/
- cmake -DFLAG_REAL_TIME=OFF ..
- make
- cd ../..
- mkdir ExampleProjects/TutorialProjects/8_User_derivatives/workR/build
......@@ -309,7 +379,7 @@ tutorial_8_separate:
- diff -q dirdyn_qd_ref.res dirdyn_qd.res
- diff -q dirdyn_qdd_ref.res dirdyn_qdd.res
- diff -q dirdyn_Qq_ref.res dirdyn_Qq.res
- diff -q Vertical_Acc_ref.res Vertical_Acc.res
- diff -q Vertical_Acc_ref.res dirdyn_Vertical_Acc.res
- diff -q dirdyn_linkF_ref.res dirdyn_linkF.res
- diff -q dirdyn_ux_ref.res dirdyn_ux.res
- diff -q dirdyn_uxd_ref.res dirdyn_uxd.res
......@@ -327,14 +397,14 @@ tutorial_9_monolithic:
- diff -q dirdyn_qdd_ref.res dirdyn_qdd.res
- diff -q dirdyn_Qq_ref.res dirdyn_Qq.res
- diff -q dirdyn_linkF_ref.res dirdyn_linkF.res
- diff -q Fdamper_ref.res Fdamper.res
- diff -q Fspring_ref.res Fspring.res
- diff -q Fdamper_ref.res dirdyn_Fdamper.res
- diff -q Fspring_ref.res dirdyn_Fspring.res
tutorial_9_separate:
script:
- mkdir MBsysC/build
- cd MBsysC/build
- cmake -DFLAG_REAL_TIME=OFF ../mbs_common/
- cmake -DFLAG_REAL_TIME=OFF ..
- make
- cd ../..
- mkdir ExampleProjects/TutorialProjects/9_Tips/workR/build
......@@ -348,5 +418,26 @@ tutorial_9_separate:
- diff -q dirdyn_qdd_ref.res dirdyn_qdd.res
- diff -q dirdyn_Qq_ref.res dirdyn_Qq.res
- diff -q dirdyn_linkF_ref.res dirdyn_linkF.res
- diff -q Fdamper_ref.res Fdamper.res
- diff -q Fspring_ref.res Fspring.res
- diff -q Fdamper_ref.res dirdyn_Fdamper.res
- diff -q Fspring_ref.res dirdyn_Fspring.res
# --------------------------------------------------------------------------
# New compilation: Testing Cython interface --------------------------------
# --------------------------------------------------------------------------
Python_interface_realtimeOFF:
image: robotran/ubuntu-robotran-cython:v0
script:
- mkdir MBsysC/build
- cd MBsysC/build
- cmake -DFLAG_REAL_TIME=OFF -DFLAG_INTERFACE_PYTHON=ON ..
- make
- cd ../..
- mkdir ExampleProjects/PendulumSpringC/workR/build
- cd ExampleProjects/PendulumSpringC/workR/build
- cmake -DFLAG_SEPARATE_BUILD=ON ..
- make
- cd ..
- python main.py
## Changes for next release
* All modules (MBsysC, interfaces, add-ons) are compiled from the same CMakeLists. The optionnal modules are activated with corresponding FLAG (`FLAG_INTERFACE_SIMULINK`, `FLAG_INTERFACE_PYTHON`, `FLAG_IPY_WITH_MBS_LMGC` and `FLAG_ADDON_MBSLMGC`).
* Simulink interface: a (simple) interface between MBsysC is created, involving the following changes
* Definition of new optinal user files:
* user\_equil.c: is required for equilibrium module.
* user\_load.c: enable to execute specific code after loading the project (useful for Simulink since there is no main function to do it in Simulink)
* template files are available in mbs\_workspace\_template and are added automatically if the files are not in the project. **Project update required: Either update userfctR\CMakeLists for backward compatibility (add call to `increment_void_user( ${PROJECT_SOURCE_DIR} )` just after increment_src) or copy/paste the new files from the template.**
* User specific output: the name of the file now have the resfilename as prefix.
* User model generation: the generation of the user_model files for mbs without defined user model is now compatible with Visual studio (structure is no more empty)
* M_PI is accessible on windows for all files that include math.h in the template.
* user\_all\_id.h: the id of cuts are generated.
* Add openGL
* Adapt CMakeLists.txt of workR folder. Replace
```
file(RELATIVE_PATH BUILD_PATH ${PROJECT_SOURCE_DIR} ${PROJECT_BINARY_DIR})
```
by
```
set(BUILD_PATH ${PROJECT_BINARY_DIR})
file(RELATIVE_PATH BUILD_PATH_REL ${PROJECT_SOURCE_DIR} ${PROJECT_BINARY_DIR})
```
## Robotran v1.9.4
* Add a python interface for driving the simulation via a python script (see MBsysC/readme_aux/interface_python.md and MBsysC/mbs_interface/mbs_python)
......
# Copyright: (C)
# Authors: Timothee Habra & Nicolas Van der Noot
# CopyPolicy: Released under the terms of the LGPLv2.1 or later, see LGPL.TXT
#
# Universite catholique de Louvain
# CEREM : Centre for research in mechatronics
# http://www.robotran.be
# Contact : info@robotran.be
#
#
# CMake for compiling the symbolic files of a robotran project in C
#
# * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * *
# LIBRARY MAIN CONFIGURATIONS
# * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * *
cmake_minimum_required(VERSION 2.8.7)
if (UNIX)
cmake_minimum_required(VERSION 2.8.7)
else()
cmake_minimum_required(VERSION 3.4)
endif ()
project(Project_symbolic)
......@@ -49,15 +59,26 @@ include_directories ( ${INCLUDE_DIR} )
include_directories ( ${CMAKE_CURRENT_BINARY_DIR} )
if( FLAG_SHARED_LIB OR FLAG_SEPARATE_SYMBOLIC )
set(CMAKE_WINDOWS_EXPORT_ALL_SYMBOLS ON)
add_library(Project_symbolic SHARED ${SOURCE_FILES})
# MacOS: Force extension to be .so rather than .dylib
if(APPLE)
set_target_properties(Project_symbolic PROPERTIES SUFFIX .so)
endif()
# Windows, copy dll next to executable
if((NOT UNIX) AND (NOT FLAG_SEPARATE_SYMBOLIC))
add_custom_command(TARGET Project_symbolic POST_BUILD
COMMAND ${CMAKE_COMMAND} -E copy
${CMAKE_CURRENT_BINARY_DIR}/Debug/Project_symbolic.dll
${CMAKE_CURRENT_BINARY_DIR}/../Debug/Project_symbolic.dll
)
endif()
else()
add_library(Project_symbolic STATIC ${SOURCE_FILES})
add_definitions( -DPROJECT_USERFCT_STATIC_DEFINE)
# some symbolic routines call user functions (ext_forces, accelred, ...)
target_link_libraries(Project_symbolic Project_userfct)
......@@ -74,13 +95,3 @@ if ( FLAG_SEPARATE_BUILD ) # find MBSysC dynamic libraries
add_definitions(${LIB_MBSYSC_DEFINITIONS})
target_link_libraries(Project_symbolic ${LIB_MBSYSC_MODULES})
endif()
# * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * *
# STUFF FOR WINDOWS (TO BE CLEANED)
# * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * *
include (GenerateExportHeader)
GENERATE_EXPORT_HEADER( Project_symbolic )
install (TARGETS Project_symbolic DESTINATION ${CMAKE_INSTALL_PREFIX})
# Copyright: (C)
# Authors: Timothee Habra & Nicolas Van der Noot
# CopyPolicy: Released under the terms of the LGPLv2.1 or later, see LGPL.TXT
#
# Universite catholique de Louvain
# CEREM : Centre for research in mechatronics
# http://www.robotran.be
# Contact : info@robotran.be
#
#
# CMake for compiling the user files of a robotran project in C
#
# * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * *
# LIBRARY MAIN CONFIGURATIONS
# * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * *
cmake_minimum_required(VERSION 2.8.7)
if (UNIX)
cmake_minimum_required(VERSION 2.8.7)
else()
cmake_minimum_required(VERSION 3.4)
endif ()
project(Project_userfct)
......@@ -46,15 +56,25 @@ if ( FLAG_SEPARATE_USER_FCT )
# plot-visu options
option (FLAG_PLOT "Real time" OFF)
option (FLAG_VISU "Real time" OFF)
option (FLAG_JAVA "Real time" OFF)
option (FLAG_OPEN_GL "Real time" OFF)
if(FLAG_PLOT)
add_definitions( -DSDL )
endif( )
if(FLAG_VISU)
add_definitions( -DVISU_3D )
endif( )
if(FLAG_JAVA)
add_definitions( -DJAVA )
endif( )
if(FLAG_OPEN_GL)
add_definitions( -DOPEN_GL )
endif( )
endif ( )
endif ( )
......@@ -68,6 +88,7 @@ release_debug()
# list source files to compile
init_src()
increment_src( ${PROJECT_SOURCE_DIR} )
increment_void_user( ${PROJECT_SOURCE_DIR} )
# list include directories (to find headers)
init_include()
......@@ -78,6 +99,7 @@ include_directories ( ${INCLUDE_DIR} )
include_directories ( ${CMAKE_CURRENT_BINARY_DIR} )
if( FLAG_SHARED_LIB OR FLAG_SEPARATE_USER_FCT )
set(CMAKE_WINDOWS_EXPORT_ALL_SYMBOLS ON)
add_library(Project_userfct SHARED ${SOURCE_FILES})
target_link_libraries (Project_userfct ${LIB_MBSYSC_REALTIME})
......@@ -88,12 +110,18 @@ if( FLAG_SHARED_LIB OR FLAG_SEPARATE_USER_FCT )
if(APPLE)
set_target_properties(Project_userfct PROPERTIES SUFFIX ".so")
endif()
# Windows, copy dll next to executable
if((NOT UNIX) AND (NOT FLAG_SEPARATE_USER_FCT))
add_custom_command(TARGET Project_userfct POST_BUILD
COMMAND ${CMAKE_COMMAND} -E copy
${CMAKE_CURRENT_BINARY_DIR}/Debug/Project_userfct.dll
${CMAKE_CURRENT_BINARY_DIR}/../Debug/Project_userfct.dll
)
endif()
else()
add_library(Project_userfct STATIC ${SOURCE_FILES})
add_definitions( -DMBSYSC_UTILITIES_STATIC_DEFINE)
add_definitions( -DPROJECT_SYMBOLIC_STATIC_DEFINE)
target_link_libraries (Project_userfct ${LIB_MBSYSC_REALTIME} ${LIB_MBSYSC_UTILITIES})
endif()
......@@ -110,12 +138,3 @@ endif()
if (FLAG_PLOT)
sdl_header_lib(userfct)
endif ( )
# * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * *
# STUFF FOR WINDOWS (TO BE CLEANED)
# * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * *
include (GenerateExportHeader)
GENERATE_EXPORT_HEADER( Project_userfct )
install (TARGETS Project_userfct DESTINATION ${CMAKE_INSTALL_PREFIX})
......@@ -6,7 +6,7 @@
* In order to use C++ features, you just need to change the extension of this file (.c) to .cc (or .cpp).
*/
#ifdef JAVA
#ifdef VISU_3D
#include "user_realtime.h"
#include "mbs_data.h"
......
#
# Authors: Nicolas Docquier, Nicolas Van der Noot, Timothee Habra
# September 2015
# Universite catholique de Louvain
# CEREM : Centre for research in mechatronics
# http://www.robotran.be
# Contact : info@robotran.be
#
#
# CMake for compiling a robotran-LMGC project
#
# * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * *
# PROJECT MAIN CONFIGURATIONS
# * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * *
# CMake minimum version
cmake_minimum_required(VERSION 2.8.7)
if (UNIX)
cmake_minimum_required(VERSION 2.8.7)
else()
cmake_minimum_required(VERSION 3.4)
endif ()
# project name
project (MultiplePendulum)
......@@ -22,12 +29,12 @@ set( CMAKE_CXX_FLAGS_RELEASE "-O3" )
# Variable for storing the path to Robotran common files (should be adapted depending on the location of those source)
if(NOT DEFINED ROBOTRAN_SOURCE_DIR)
set(TRIAL_PATHS_MBSYSC
${PROJECT_SOURCE_DIR}/../../../MBsysC
${PROJECT_SOURCE_DIR}/../mbsysCopy
)
find_path(ROBOTRAN_SOURCE_DIR mbs_common ${TRIAL_PATHS_MBSYSC} DOC "Path to the Robotran-MBsysC common files")
endif ( )
set(TRIAL_PATHS_MBSYSC
${PROJECT_SOURCE_DIR}/../../../MBsysC
${PROJECT_SOURCE_DIR}/../mbsysCopy
)
find_path(ROBOTRAN_SOURCE_DIR mbs_common ${TRIAL_PATHS_MBSYSC} DOC "Path to the Robotran-MBsysC common files")
endif( )
# message to display the project name
message(STATUS "Processing ${PROJECT_NAME}")
......@@ -112,7 +119,8 @@ endif ( )
# * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * *
# name of the build folder (relative to main CMakelists.txt)
file(RELATIVE_PATH BUILD_PATH ${PROJECT_SOURCE_DIR} ${PROJECT_BINARY_DIR})
set(BUILD_PATH ${PROJECT_BINARY_DIR})
file(RELATIVE_PATH BUILD_PATH_REL ${PROJECT_SOURCE_DIR} ${PROJECT_BINARY_DIR})
# configure a header file to pass some of the CMake settings to the source code
configure_file (
......@@ -175,13 +183,19 @@ if ( FLAG_SEPARATE_BUILD ) # find MBSysC dynamic libraries
## ---- WINDOWS DLL FILES ---- ##
# find dll directories (Debug or Release)
get_filename_component(LIB_MBSYSC_MODULES_DIR ${LIB_MBSYSC_MODULES} DIRECTORY)
get_filename_component(LIB_MBSYSC_LOAD_DIR ${LIB_MBSYSC_LOAD} DIRECTORY)
get_filename_component(LIB_MBSYSC_UTILITIES_DIR ${LIB_MBSYSC_UTILITIES} DIRECTORY)
get_filename_component(LIB_MBSYSC_REALTIME_DIR ${LIB_MBSYSC_REALTIME} DIRECTORY)
# copy all the dll used for Windows
# these dll files are copied in the Executable directory (Debug)
file(COPY ${ROBOTRAN_SOURCE_DIR}\\build\\mbs_module\\Debug\\MBsysC_module.dll DESTINATION ${CMAKE_BINARY_DIR}\\Debug)
file(COPY ${ROBOTRAN_SOURCE_DIR}\\build\\mbs_load_xml\\Debug\\MBsysC_loadXML.dll DESTINATION ${CMAKE_BINARY_DIR}\\Debug)
file(COPY ${ROBOTRAN_SOURCE_DIR}\\build\\mbs_utilities\\Debug\\MBsysC_utilities.dll DESTINATION ${CMAKE_BINARY_DIR}\\Debug)
file(COPY ${ROBOTRAN_SOURCE_DIR}\\build\\mbs_realtime\\Debug\\MBsysC_realtime.dll DESTINATION ${CMAKE_BINARY_DIR}\\Debug)
file(COPY ${LIB_MBSYSC_MODULES_DIR}\\MBsysC_module.dll DESTINATION ${CMAKE_BINARY_DIR}\\Debug)
file(COPY ${LIB_MBSYSC_LOAD_DIR}\\MBsysC_loadXML.dll DESTINATION ${CMAKE_BINARY_DIR}\\Debug)
file(COPY ${LIB_MBSYSC_UTILITIES_DIR}\\MBsysC_utilities.dll DESTINATION ${CMAKE_BINARY_DIR}\\Debug)
file(COPY ${LIB_MBSYSC_REALTIME_DIR}\\MBsysC_realtime.dll DESTINATION ${CMAKE_BINARY_DIR}\\Debug)
endif ( )
else ( )
......@@ -191,7 +205,7 @@ else ( )
if (NOT FLAG_SHARED_LIB)
# find MBSysC static libraries
target_link_libraries( ${Executable} MBsysC_struct MBsysC_numerics MBsysC_realtime MBsysC_utilities )
target_link_libraries( ${Executable} MBsysC_numerics MBsysC_realtime MBsysC_utilities )
#user functions library
target_link_libraries ( ${Executable} Project_userfct )
......@@ -206,9 +220,18 @@ else ( )
endif ( )
# Java external library
if (FLAG_VISU)
if (FLAG_JAVA)
target_link_libraries ( ${Executable} ${JNI_LIBRARIES} )
endif ( )
# OpenGL external library
if (FLAG_OPEN_GL)
target_link_libraries ( ${Executable} ${OPEN_GL_LIBS} )
if (UNIX)
target_link_libraries (${LIB_MBSYSC_REALTIME} ${CMAKE_THREAD_LIBS_INIT})
endif ( )
endif ( )
add_definitions( -DMBSYSC_MODULE_STATIC_DEFINE)
......@@ -220,14 +243,22 @@ include_directories(${LIB_MBSYSC_INCLUDE_DIRS})
# symbolic files
if ( FLAG_SEPARATE_SYMBOLIC )
file(COPY ${PROJECT_SOURCE_DIR}/../symbolicR/build/libProject_symbolic.so DESTINATION ${CMAKE_CURRENT_BINARY_DIR}/symbolicR)
if( UNIX )
file(COPY ${PROJECT_SOURCE_DIR}/../symbolicR/build/libProject_symbolic.so DESTINATION ${CMAKE_CURRENT_BINARY_DIR}/symbolicR)
else() # Windows (to be tested)
file(COPY ${PROJECT_SOURCE_DIR}/../symbolicR/build/Debug/libProject_symbolic.dll DESTINATION ${CMAKE_CURRENT_BINARY_DIR}/Debug)
endif()
else ( )
add_subdirectory( ${PROJECT_SOURCE_DIR}/../symbolicR ${CMAKE_CURRENT_BINARY_DIR}/symbolicR)
endif ( )
# user fonction files
if ( FLAG_SEPARATE_USER_FCT )
file(COPY ${PROJECT_SOURCE_DIR}/../userfctR/build/libProject_userfct.so DESTINATION ${CMAKE_CURRENT_BINARY_DIR}/userfctR)
if( UNIX )
file(COPY ${PROJECT_SOURCE_DIR}/../userfctR/build/libProject_userfct.so DESTINATION ${CMAKE_CURRENT_BINARY_DIR}/userfctR)
else() # Windows (to be tested)
file(COPY ${PROJECT_SOURCE_DIR}/../userfctR/build/Debug/libProject_userfct.dll DESTINATION ${CMAKE_CURRENT_BINARY_DIR}/Debug)
endif()
else ( )
add_subdirectory( ${PROJECT_SOURCE_DIR}/../userfctR ${CMAKE_CURRENT_BINARY_DIR}/userfctR)
endif ( )
......@@ -241,9 +272,3 @@ endif ( )
if (UNIX)
target_link_libraries ( ${Executable} m )
endif ( )
# * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * *
# LMGC90 INTERACTION
# * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * *
#add_subdirectory( ${ROBOTRAN_SOURCE_DIR}/mbs_common/mbs_add_on/mbs_lmgc ${CMAKE_CURRENT_BINARY_DIR}/mbs_common/mbs_add_on/mbs_lmgc )