Commit 847caf6a authored by Quentin Docquier's avatar Quentin Docquier

update the CmakeList from the example project so that it can also be used in...

update the CmakeList from the example project so that it can also be used in release mode with the separate build flag in windows.
The cmakeList is also changed for the ModellingFeatures example because an extra folder has been added to organize better the tutorialExamples.
the .yml in CI is modified accordingly.
parent 61915c2d
Pipeline #4377 failed with stage
in 9 minutes
......@@ -123,8 +123,8 @@ NewCompilation_separate_realtimeON_OpenGL:
tutorial_1_monolithic:
script:
- mkdir ExampleProjects/TutorialProjects/1_Bodies_and_Joints/workR/build
- cd ExampleProjects/TutorialProjects/1_Bodies_and_Joints/workR/build
- mkdir ExampleProjects/TutorialProjects/modellingFeatures/1_Bodies_and_Joints/workR/build
- cd ExampleProjects/TutorialProjects/modellingFeatures/1_Bodies_and_Joints/workR/build
- cmake ..
- make
- ./exe_Bodies_and_Joints
......@@ -141,8 +141,8 @@ tutorial_1_separate:
- cmake -DFLAG_REAL_TIME=OFF ..
- make
- cd ../..
- mkdir ExampleProjects/TutorialProjects/1_Bodies_and_Joints/workR/build
- cd ExampleProjects/TutorialProjects/1_Bodies_and_Joints/workR/build
- mkdir ExampleProjects/TutorialProjects/modellingFeatures/1_Bodies_and_Joints/workR/build
- cd ExampleProjects/TutorialProjects/modellingFeatures/1_Bodies_and_Joints/workR/build
- cmake -DFLAG_SEPARATE_BUILD=ON ..
- make
- ./exe_Bodies_and_Joints
......@@ -154,8 +154,8 @@ tutorial_1_separate:
tutorial_2_monolithic:
script:
- mkdir ExampleProjects/TutorialProjects/2_Links/workR/build
- cd ExampleProjects/TutorialProjects/2_Links/workR/build
- mkdir ExampleProjects/TutorialProjects/modellingFeatures/2_Links/workR/build
- cd ExampleProjects/TutorialProjects/modellingFeatures/2_Links/workR/build
- cmake ..
- make
- ./exe_Links
......@@ -173,8 +173,8 @@ tutorial_2_separate:
- cmake -DFLAG_REAL_TIME=OFF ..
- make
- cd ../..
- mkdir ExampleProjects/TutorialProjects/2_Links/workR/build
- cd ExampleProjects/TutorialProjects/2_Links/workR/build
- mkdir ExampleProjects/TutorialProjects/modellingFeatures/2_Links/workR/build
- cd ExampleProjects/TutorialProjects/modellingFeatures/2_Links/workR/build
- cmake -DFLAG_SEPARATE_BUILD=ON ..
- make
- ./exe_Links
......@@ -187,8 +187,8 @@ tutorial_2_separate:
tutorial_3_monolithic:
script:
- mkdir ExampleProjects/TutorialProjects/3_Cuts/workR/build
- cd ExampleProjects/TutorialProjects/3_Cuts/workR/build
- mkdir ExampleProjects/TutorialProjects/modellingFeatures/3_Cuts/workR/build
- cd ExampleProjects/TutorialProjects/modellingFeatures/3_Cuts/workR/build
- cmake ..
- make
- ./exe_Cuts
......@@ -206,8 +206,8 @@ tutorial_3_separate:
- cmake -DFLAG_REAL_TIME=OFF ..
- make
- cd ../..
- mkdir ExampleProjects/TutorialProjects/3_Cuts/workR/build
- cd ExampleProjects/TutorialProjects/3_Cuts/workR/build
- mkdir ExampleProjects/TutorialProjects/modellingFeatures/3_Cuts/workR/build
- cd ExampleProjects/TutorialProjects/modellingFeatures/3_Cuts/workR/build
- cmake -DFLAG_SEPARATE_BUILD=ON ..
- make
- ./exe_Cuts
......@@ -220,8 +220,8 @@ tutorial_3_separate:
tutorial_4_monolithic:
script:
- mkdir ExampleProjects/TutorialProjects/4_Driven_variable/workR/build
- cd ExampleProjects/TutorialProjects/4_Driven_variable/workR/build
- mkdir ExampleProjects/TutorialProjects/modellingFeatures/4_Driven_variable/workR/build
- cd ExampleProjects/TutorialProjects/modellingFeatures/4_Driven_variable/workR/build
- cmake ..
- make
- ./exe_Driven_variable
......@@ -237,8 +237,8 @@ tutorial_4_separate:
- cmake -DFLAG_REAL_TIME=OFF ..
- make
- cd ../..
- mkdir ExampleProjects/TutorialProjects/4_Driven_variable/workR/build
- cd ExampleProjects/TutorialProjects/4_Driven_variable/workR/build
- mkdir ExampleProjects/TutorialProjects/modellingFeatures/4_Driven_variable/workR/build
- cd ExampleProjects/TutorialProjects/modellingFeatures/4_Driven_variable/workR/build
- cmake -DFLAG_SEPARATE_BUILD=ON ..
- make
- ./exe_Driven_variable
......@@ -252,8 +252,8 @@ tutorial_4_separate:
tutorial_5_monolithic:
script:
- mkdir ExampleProjects/TutorialProjects/5_Sensors/workR/build
- cd ExampleProjects/TutorialProjects/5_Sensors/workR/build
- mkdir ExampleProjects/TutorialProjects/modellingFeatures/5_Sensors/workR/build
- cd ExampleProjects/TutorialProjects/modellingFeatures/5_Sensors/workR/build
- cmake ..
- make
- ./exe_Sensors
......@@ -272,8 +272,8 @@ tutorial_5_separate:
- cmake -DFLAG_REAL_TIME=OFF ..
- make
- cd ../..
- mkdir ExampleProjects/TutorialProjects/5_Sensors/workR/build
- cd ExampleProjects/TutorialProjects/5_Sensors/workR/build
- mkdir ExampleProjects/TutorialProjects/modellingFeatures/5_Sensors/workR/build
- cd ExampleProjects/TutorialProjects/modellingFeatures/5_Sensors/workR/build
- cmake -DFLAG_SEPARATE_BUILD=ON ..
- make
- ./exe_Sensors
......@@ -287,8 +287,8 @@ tutorial_5_separate:
tutorial_6_monolithic:
script:
- mkdir ExampleProjects/TutorialProjects/6_External_Force/workR/build
- cd ExampleProjects/TutorialProjects/6_External_Force/workR/build
- mkdir ExampleProjects/TutorialProjects/modellingFeatures/6_External_Force/workR/build
- cd ExampleProjects/TutorialProjects/modellingFeatures/6_External_Force/workR/build
- cmake ..
- make
- ./exe_External_Force
......@@ -307,8 +307,8 @@ tutorial_6_separate:
- cmake -DFLAG_REAL_TIME=OFF ..
- make
- cd ../..
- mkdir ExampleProjects/TutorialProjects/6_External_Force/workR/build
- cd ExampleProjects/TutorialProjects/6_External_Force/workR/build
- mkdir ExampleProjects/TutorialProjects/modellingFeatures/6_External_Force/workR/build
- cd ExampleProjects/TutorialProjects/modellingFeatures/6_External_Force/workR/build
- cmake -DFLAG_SEPARATE_BUILD=ON ..
- make
- ./exe_External_Force
......@@ -322,8 +322,8 @@ tutorial_6_separate:
tutorial_7_monolithic:
script:
- mkdir ExampleProjects/TutorialProjects/7_User_constraints/workR/build
- cd ExampleProjects/TutorialProjects/7_User_constraints/workR/build
- mkdir ExampleProjects/TutorialProjects/modellingFeatures/7_User_constraints/workR/build
- cd ExampleProjects/TutorialProjects/modellingFeatures/7_User_constraints/workR/build
- cmake ..
- make
- ./exe_Userconstraints
......@@ -342,8 +342,8 @@ tutorial_7_separate:
- cmake -DFLAG_REAL_TIME=OFF ..
- make
- cd ../..
- mkdir ExampleProjects/TutorialProjects/7_User_constraints/workR/build
- cd ExampleProjects/TutorialProjects/7_User_constraints/workR/build
- mkdir ExampleProjects/TutorialProjects/modellingFeatures/7_User_constraints/workR/build
- cd ExampleProjects/TutorialProjects/modellingFeatures/7_User_constraints/workR/build
- cmake -DFLAG_SEPARATE_BUILD=ON ..
- make
- ./exe_Userconstraints
......@@ -357,8 +357,8 @@ tutorial_7_separate:
tutorial_8_monolithic:
script:
- mkdir ExampleProjects/TutorialProjects/8_User_derivatives/workR/build
- cd ExampleProjects/TutorialProjects/8_User_derivatives/workR/build
- mkdir ExampleProjects/TutorialProjects/modellingFeatures/8_User_derivatives/workR/build
- cd ExampleProjects/TutorialProjects/modellingFeatures/8_User_derivatives/workR/build
- cmake ..
- make
- ./exe_Userderivatives
......@@ -374,8 +374,8 @@ tutorial_8_separate:
- cmake -DFLAG_REAL_TIME=OFF ..
- make
- cd ../..
- mkdir ExampleProjects/TutorialProjects/8_User_derivatives/workR/build
- cd ExampleProjects/TutorialProjects/8_User_derivatives/workR/build
- mkdir ExampleProjects/TutorialProjects/modellingFeatures/8_User_derivatives/workR/build
- cd ExampleProjects/TutorialProjects/modellingFeatures/8_User_derivatives/workR/build
- cmake -DFLAG_SEPARATE_BUILD=ON ..
- make
- ./exe_Userderivatives
......@@ -391,8 +391,8 @@ tutorial_8_separate:
tutorial_9_monolithic:
script:
- mkdir ExampleProjects/TutorialProjects/9_Tips/workR/build
- cd ExampleProjects/TutorialProjects/9_Tips/workR/build
- mkdir ExampleProjects/TutorialProjects/modellingFeatures/9_Tips/workR/build
- cd ExampleProjects/TutorialProjects/modellingFeatures/9_Tips/workR/build
- cmake ..
- make
- ./exe_Tips
......@@ -412,8 +412,8 @@ tutorial_9_separate:
- cmake -DFLAG_REAL_TIME=OFF ..
- make
- cd ../..
- mkdir ExampleProjects/TutorialProjects/9_Tips/workR/build
- cd ExampleProjects/TutorialProjects/9_Tips/workR/build
- mkdir ExampleProjects/TutorialProjects/modellingFeatures/9_Tips/workR/build
- cd ExampleProjects/TutorialProjects/modellingFeatures/9_Tips/workR/build
- cmake -DFLAG_SEPARATE_BUILD=ON ..
- make
- ./exe_Tips
......
......@@ -184,13 +184,21 @@ if ( FLAG_SEPARATE_BUILD ) # find MBSysC dynamic libraries
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)
get_filename_component(VERSION ${LIB_MBSYSC_LOAD_DIR} NAME)
message(STATUS "built in ${VERSION} mode ")
# copy all the dll used for Windows
# these dll files are copied in the Executable directory (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)
# these dll files are copied in the Executable directory (Release)
file(COPY ${LIB_MBSYSC_MODULES_DIR}\\MBsysC_module.dll DESTINATION ${CMAKE_BINARY_DIR}\\Release)
file(COPY ${LIB_MBSYSC_LOAD_DIR}\\MBsysC_loadXML.dll DESTINATION ${CMAKE_BINARY_DIR}\\Release)
file(COPY ${LIB_MBSYSC_UTILITIES_DIR}\\MBsysC_utilities.dll DESTINATION ${CMAKE_BINARY_DIR}\\Release)
file(COPY ${LIB_MBSYSC_REALTIME_DIR}\\MBsysC_realtime.dll DESTINATION ${CMAKE_BINARY_DIR}\\Release)
endif ( )
......
......@@ -185,13 +185,21 @@ if ( FLAG_SEPARATE_BUILD ) # find MBSysC dynamic libraries
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)
get_filename_component(VERSION ${LIB_MBSYSC_LOAD_DIR} NAME)
message(STATUS "built in ${VERSION} mode ")
# copy all the dll used for Windows
# these dll files are copied in the Executable directory (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)
# these dll files are copied in the Executable directory (Release)
file(COPY ${LIB_MBSYSC_MODULES_DIR}\\MBsysC_module.dll DESTINATION ${CMAKE_BINARY_DIR}\\Release)
file(COPY ${LIB_MBSYSC_LOAD_DIR}\\MBsysC_loadXML.dll DESTINATION ${CMAKE_BINARY_DIR}\\Release)
file(COPY ${LIB_MBSYSC_UTILITIES_DIR}\\MBsysC_utilities.dll DESTINATION ${CMAKE_BINARY_DIR}\\Release)
file(COPY ${LIB_MBSYSC_REALTIME_DIR}\\MBsysC_realtime.dll DESTINATION ${CMAKE_BINARY_DIR}\\Release)
endif ( )
......
......@@ -185,13 +185,21 @@ if ( FLAG_SEPARATE_BUILD ) # find MBSysC dynamic libraries
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)
get_filename_component(VERSION ${LIB_MBSYSC_LOAD_DIR} NAME)
message(STATUS "built in ${VERSION} mode ")
# copy all the dll used for Windows
# these dll files are copied in the Executable directory (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)
# these dll files are copied in the Executable directory (Release)
file(COPY ${LIB_MBSYSC_MODULES_DIR}\\MBsysC_module.dll DESTINATION ${CMAKE_BINARY_DIR}\\Release)
file(COPY ${LIB_MBSYSC_LOAD_DIR}\\MBsysC_loadXML.dll DESTINATION ${CMAKE_BINARY_DIR}\\Release)
file(COPY ${LIB_MBSYSC_UTILITIES_DIR}\\MBsysC_utilities.dll DESTINATION ${CMAKE_BINARY_DIR}\\Release)
file(COPY ${LIB_MBSYSC_REALTIME_DIR}\\MBsysC_realtime.dll DESTINATION ${CMAKE_BINARY_DIR}\\Release)
endif ( )
......
### resultsR folder
This folder contains the results of the simulations or other computations.
This folder also contains the reference solution of the simulation.
### resultsR folder
This folder contains the results of the simulations or other computations.
This folder also contains the reference solution of the simulation.
### resultsR folder
This folder contains the results of the simulations or other computations.
This folder also contains the reference solution of the simulation.
### resultsR folder
This folder contains the results of the simulations or other computations.
This folder also contains the reference solution of the simulation.
### resultsR folder
This folder contains the results of the simulations or other computations.
This folder also contains the reference solution of the simulation.
#
# 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
# * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * *
if (UNIX)
cmake_minimum_required(VERSION 2.8.7)
else()
cmake_minimum_required(VERSION 3.4)
endif ()
project(Project_symbolic)
# flags
if (UNIX)
set(CMAKE_C_FLAGS "-fPIC")
set(CMAKE_EXE_LINKER_FLAGS "-fPIC")
endif (UNIX)
# * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * *
# SEPARATE COMPILATION
# * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * *
if ( FLAG_SEPARATE_SYMBOLIC )
set(CMAKE_AUX ${ROBOTRAN_SOURCE_DIR}/cmake_aux)
set(CMAKE_AUX_BIN ${PROJECT_BINARY_DIR}/cmake_aux)
add_subdirectory ( ${CMAKE_AUX}/flags/ ${CMAKE_AUX_BIN}/flags/ )
add_subdirectory ( ${CMAKE_AUX}/listing/ ${CMAKE_AUX_BIN}/listing/ )
endif ( )
# release of debug
release_debug()
# * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * *
# SET LIBRARY
# * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * *
# list source files to compile
init_src()
increment_src( ${PROJECT_SOURCE_DIR} )
increment_void_symbolic( ${PROJECT_SOURCE_DIR} )
# list include directories (to find headers)
init_include()
increment_include( ${ROBOTRAN_SOURCE_DIR}/mbs_common )
# include these directories
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}/$<CONFIGURATION>/Project_symbolic.dll
${CMAKE_CURRENT_BINARY_DIR}/../$<CONFIGURATION>/Project_symbolic.dll
)
endif()
else()
add_library(Project_symbolic STATIC ${SOURCE_FILES})
# some symbolic routines call user functions (ext_forces, accelred, ...)
target_link_libraries(Project_symbolic Project_userfct)
endif()
# * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * *
# LINK LIBRARIES
# * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * *
# MBSysC libraries
if ( FLAG_SEPARATE_BUILD ) # find MBSysC dynamic libraries
find_package( LibRobotranC 1.11.0 REQUIRED )
add_definitions(${LIB_MBSYSC_DEFINITIONS})
target_link_libraries(Project_symbolic ${LIB_MBSYSC_MODULES})
endif()
# Windows M_PI definitions
if (WIN32)
add_definitions(-D _USE_MATH_DEFINES)
endif (WIN32)
#
# 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
# * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * *
if (UNIX)
cmake_minimum_required(VERSION 2.8.7)
else()
cmake_minimum_required(VERSION 3.4)
endif ()
project(Project_userfct)
# flags
if (UNIX)
set(CMAKE_C_FLAGS "-fPIC")
set(CMAKE_EXE_LINKER_FLAGS "-fPIC")
endif (UNIX)
# Windows M_PI definitions
if (WIN32)
add_definitions(-D _USE_MATH_DEFINES)
endif (WIN32)
# * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * *
# SEPARATE COMPILATION
# * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * *
if ( FLAG_SEPARATE_USER_FCT )
# additional CMakeLists.txt
set(CMAKE_AUX ${ROBOTRAN_SOURCE_DIR}/cmake_aux)
set(CMAKE_AUX_BIN ${PROJECT_BINARY_DIR}/cmake_aux)
add_subdirectory ( ${CMAKE_AUX}/flags/ ${CMAKE_AUX_BIN}/flags/ )
add_subdirectory ( ${CMAKE_AUX}/listing/ ${CMAKE_AUX_BIN}/listing/ )
add_subdirectory ( ${CMAKE_AUX}/libraries/ ${CMAKE_AUX_BIN}/libraries/ )
# real-time option
option (FLAG_REAL_TIME "Real time" OFF)
if(FLAG_REAL_TIME)
add_definitions( -DREAL_TIME )
# configure a header file to pass some of the CMake settings to the source code
configure_file (
"${ROBOTRAN_SOURCE_DIR}/conf/cmake_config.h.in"
"${PROJECT_BINARY_DIR}/conf/cmake_config.h"
)