Commit 46405689 authored by Olivier Lantsoght's avatar Olivier Lantsoght
Browse files

Cmake minimum version updated in examples, 5 files are fully changed due to EOL.

parent 2d1efebf
...@@ -13,7 +13,7 @@ ...@@ -13,7 +13,7 @@
# * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * # * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * *
if (UNIX) if (UNIX)
cmake_minimum_required(VERSION 2.8.7) cmake_minimum_required(VERSION 3.4)
else() else()
cmake_minimum_required(VERSION 3.4) cmake_minimum_required(VERSION 3.4)
endif () endif ()
......
...@@ -13,7 +13,7 @@ ...@@ -13,7 +13,7 @@
# * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * # * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * *
if (UNIX) if (UNIX)
cmake_minimum_required(VERSION 2.8.7) cmake_minimum_required(VERSION 3.4)
else() else()
cmake_minimum_required(VERSION 3.4) cmake_minimum_required(VERSION 3.4)
endif () endif ()
......
...@@ -14,7 +14,7 @@ ...@@ -14,7 +14,7 @@
# CMake minimum version # CMake minimum version
if (UNIX) if (UNIX)
cmake_minimum_required(VERSION 2.8.7) cmake_minimum_required(VERSION 3.4)
else() else()
cmake_minimum_required(VERSION 3.4) cmake_minimum_required(VERSION 3.4)
endif () endif ()
......
# #
# Universite catholique de Louvain # Universite catholique de Louvain
# CEREM : Centre for research in mechatronics # CEREM : Centre for research in mechatronics
# http://www.robotran.be # http://www.robotran.be
# Contact : info@robotran.be # Contact : info@robotran.be
# #
# #
# CMake for compiling the symbolic files of a robotran project in C # CMake for compiling the symbolic files of a robotran project in C
# #
# * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * # * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * *
# LIBRARY MAIN CONFIGURATIONS # LIBRARY MAIN CONFIGURATIONS
# * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * # * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * *
if (UNIX) if (UNIX)
cmake_minimum_required(VERSION 2.8.7) cmake_minimum_required(VERSION 3.4)
else() else()
cmake_minimum_required(VERSION 3.4) cmake_minimum_required(VERSION 3.4)
endif () endif ()
project(Project_symbolic) project(Project_symbolic)
# flags # flags
if (UNIX) if (UNIX)
set(CMAKE_C_FLAGS "-fPIC") set(CMAKE_C_FLAGS "-fPIC")
set(CMAKE_EXE_LINKER_FLAGS "-fPIC") set(CMAKE_EXE_LINKER_FLAGS "-fPIC")
endif (UNIX) endif (UNIX)
# * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * # * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * *
# SEPARATE COMPILATION # SEPARATE COMPILATION
# * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * # * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * *
if ( FLAG_SEPARATE_SYMBOLIC ) if ( FLAG_SEPARATE_SYMBOLIC )
set(CMAKE_AUX ${ROBOTRAN_SOURCE_DIR}/cmake_aux) set(CMAKE_AUX ${ROBOTRAN_SOURCE_DIR}/cmake_aux)
set(CMAKE_AUX_BIN ${PROJECT_BINARY_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}/flags/ ${CMAKE_AUX_BIN}/flags/ )
add_subdirectory ( ${CMAKE_AUX}/listing/ ${CMAKE_AUX_BIN}/listing/ ) add_subdirectory ( ${CMAKE_AUX}/listing/ ${CMAKE_AUX_BIN}/listing/ )
endif ( ) endif ( )
# release of debug # release of debug
release_debug() release_debug()
# * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * # * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * *
# SET LIBRARY # SET LIBRARY
# * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * # * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * *
# list source files to compile # list source files to compile
init_src() init_src()
increment_src( ${PROJECT_SOURCE_DIR} ) increment_src( ${PROJECT_SOURCE_DIR} )
increment_void_symbolic( ${PROJECT_SOURCE_DIR} ) increment_void_symbolic( ${PROJECT_SOURCE_DIR} )
# list include directories (to find headers) # list include directories (to find headers)
init_include() init_include()
increment_include( ${ROBOTRAN_SOURCE_DIR}/mbs_common ) increment_include( ${ROBOTRAN_SOURCE_DIR}/mbs_common )
# include these directories # include these directories
include_directories ( ${INCLUDE_DIR} ) include_directories ( ${INCLUDE_DIR} )
include_directories ( ${CMAKE_CURRENT_BINARY_DIR} ) include_directories ( ${CMAKE_CURRENT_BINARY_DIR} )
if( FLAG_SHARED_LIB OR FLAG_SEPARATE_SYMBOLIC ) if( FLAG_SHARED_LIB OR FLAG_SEPARATE_SYMBOLIC )
set(CMAKE_WINDOWS_EXPORT_ALL_SYMBOLS ON) set(CMAKE_WINDOWS_EXPORT_ALL_SYMBOLS ON)
add_library(Project_symbolic SHARED ${SOURCE_FILES}) add_library(Project_symbolic SHARED ${SOURCE_FILES})
# MacOS: Force extension to be .so rather than .dylib # MacOS: Force extension to be .so rather than .dylib
if(APPLE) if(APPLE)
set_target_properties(Project_symbolic PROPERTIES SUFFIX .so) set_target_properties(Project_symbolic PROPERTIES SUFFIX .so)
endif() endif()
# Windows, copy dll next to executable # Windows, copy dll next to executable
if((NOT UNIX) AND (NOT FLAG_SEPARATE_SYMBOLIC)) if((NOT UNIX) AND (NOT FLAG_SEPARATE_SYMBOLIC))
add_custom_command(TARGET Project_symbolic POST_BUILD add_custom_command(TARGET Project_symbolic POST_BUILD
COMMAND ${CMAKE_COMMAND} -E copy COMMAND ${CMAKE_COMMAND} -E copy
${CMAKE_CURRENT_BINARY_DIR}/$<CONFIGURATION>/Project_symbolic.dll ${CMAKE_CURRENT_BINARY_DIR}/$<CONFIGURATION>/Project_symbolic.dll
${CMAKE_CURRENT_BINARY_DIR}/../$<CONFIGURATION>/Project_symbolic.dll ${CMAKE_CURRENT_BINARY_DIR}/../$<CONFIGURATION>/Project_symbolic.dll
) )
endif() endif()
else() else()
add_library(Project_symbolic STATIC ${SOURCE_FILES}) add_library(Project_symbolic STATIC ${SOURCE_FILES})
# some symbolic routines call user functions (ext_forces, accelred, ...) # some symbolic routines call user functions (ext_forces, accelred, ...)
target_link_libraries(Project_symbolic Project_userfct) target_link_libraries(Project_symbolic Project_userfct)
endif() endif()
# * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * # * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * *
# LINK LIBRARIES # LINK LIBRARIES
# * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * # * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * *
# MBSysC libraries # MBSysC libraries
if ( FLAG_SEPARATE_BUILD ) # find MBSysC dynamic libraries if ( FLAG_SEPARATE_BUILD ) # find MBSysC dynamic libraries
find_package( LibRobotranC 1.15.1 REQUIRED ) find_package( LibRobotranC 1.15.1 REQUIRED )
add_definitions(${LIB_MBSYSC_DEFINITIONS}) add_definitions(${LIB_MBSYSC_DEFINITIONS})
target_link_libraries(Project_symbolic ${LIB_MBSYSC_MODULES}) target_link_libraries(Project_symbolic ${LIB_MBSYSC_MODULES})
endif() endif()
# Windows M_PI definitions # Windows M_PI definitions
if (WIN32) if (WIN32)
add_definitions(-D _USE_MATH_DEFINES) add_definitions(-D _USE_MATH_DEFINES)
endif (WIN32) endif (WIN32)
# #
# Universite catholique de Louvain # Universite catholique de Louvain
# CEREM : Centre for research in mechatronics # CEREM : Centre for research in mechatronics
# http://www.robotran.be # http://www.robotran.be
# Contact : info@robotran.be # Contact : info@robotran.be
# #
# #
# CMake for compiling the user files of a robotran project in C # CMake for compiling the user files of a robotran project in C
# #
# * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * # * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * *
# LIBRARY MAIN CONFIGURATIONS # LIBRARY MAIN CONFIGURATIONS
# * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * # * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * *
if (UNIX) if (UNIX)
cmake_minimum_required(VERSION 2.8.7) cmake_minimum_required(VERSION 3.4)
else() else()
cmake_minimum_required(VERSION 3.4) cmake_minimum_required(VERSION 3.4)
endif () endif ()
project(Project_userfct) project(Project_userfct)
# flags # flags
if (UNIX) if (UNIX)
set(CMAKE_C_FLAGS "-fPIC") set(CMAKE_C_FLAGS "-fPIC")
set(CMAKE_EXE_LINKER_FLAGS "-fPIC") set(CMAKE_EXE_LINKER_FLAGS "-fPIC")
endif (UNIX) endif (UNIX)
# Windows M_PI definitions # Windows M_PI definitions
if (WIN32) if (WIN32)
add_definitions(-D _USE_MATH_DEFINES) add_definitions(-D _USE_MATH_DEFINES)
endif (WIN32) endif (WIN32)
# * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * # * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * *
# SEPARATE COMPILATION # SEPARATE COMPILATION
# * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * # * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * *
if ( FLAG_SEPARATE_USER_FCT ) if ( FLAG_SEPARATE_USER_FCT )
# additional CMakeLists.txt # additional CMakeLists.txt
set(CMAKE_AUX ${ROBOTRAN_SOURCE_DIR}/cmake_aux) set(CMAKE_AUX ${ROBOTRAN_SOURCE_DIR}/cmake_aux)
set(CMAKE_AUX_BIN ${PROJECT_BINARY_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}/flags/ ${CMAKE_AUX_BIN}/flags/ )
add_subdirectory ( ${CMAKE_AUX}/listing/ ${CMAKE_AUX_BIN}/listing/ ) add_subdirectory ( ${CMAKE_AUX}/listing/ ${CMAKE_AUX_BIN}/listing/ )
add_subdirectory ( ${CMAKE_AUX}/libraries/ ${CMAKE_AUX_BIN}/libraries/ ) add_subdirectory ( ${CMAKE_AUX}/libraries/ ${CMAKE_AUX_BIN}/libraries/ )
# real-time option # real-time option
option (FLAG_REAL_TIME "Real time" OFF) option (FLAG_REAL_TIME "Real time" OFF)
if(FLAG_REAL_TIME) if(FLAG_REAL_TIME)
add_definitions( -DREAL_TIME ) add_definitions( -DREAL_TIME )
# configure a header file to pass some of the CMake settings to the source code # configure a header file to pass some of the CMake settings to the source code
configure_file ( configure_file (
"${ROBOTRAN_SOURCE_DIR}/conf/cmake_config.h.in" "${ROBOTRAN_SOURCE_DIR}/conf/cmake_config.h.in"
"${PROJECT_BINARY_DIR}/conf/cmake_config.h" "${PROJECT_BINARY_DIR}/conf/cmake_config.h"
) )
include_directories (${PROJECT_BINARY_DIR}/conf) include_directories (${PROJECT_BINARY_DIR}/conf)
# plot-visu options # plot-visu options
option (FLAG_PLOT "Real time" OFF) option (FLAG_PLOT "Real time" OFF)
option (FLAG_VISU "Real time" OFF) option (FLAG_VISU "Real time" OFF)
option (FLAG_JAVA "Real time" OFF) option (FLAG_JAVA "Real time" OFF)
option (FLAG_OPEN_GL "Real time" OFF) option (FLAG_OPEN_GL "Real time" OFF)
if(FLAG_PLOT) if(FLAG_PLOT)
add_definitions( -DSDL ) add_definitions( -DSDL )
endif( ) endif( )
if(FLAG_VISU) if(FLAG_VISU)
add_definitions( -DVISU_3D ) add_definitions( -DVISU_3D )
endif( ) endif( )
if(FLAG_JAVA) if(FLAG_JAVA)
add_definitions( -DJAVA ) add_definitions( -DJAVA )
endif( ) endif( )
if(FLAG_OPEN_GL) if(FLAG_OPEN_GL)
add_definitions( -DOPEN_GL ) add_definitions( -DOPEN_GL )
endif( ) endif( )
endif ( ) endif ( )
endif ( ) endif ( )
# release of debug # release of debug
release_debug() release_debug()
# * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * # * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * *
# SET LIBRARY # SET LIBRARY
# * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * # * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * *
# list source files to compile # list source files to compile
init_src() init_src()
increment_src( ${PROJECT_SOURCE_DIR} ) increment_src( ${PROJECT_SOURCE_DIR} )
increment_void_user( ${PROJECT_SOURCE_DIR} ) increment_void_user( ${PROJECT_SOURCE_DIR} )
# list include directories (to find headers) # list include directories (to find headers)
init_include() init_include()
increment_include( ${ROBOTRAN_SOURCE_DIR}/mbs_common ) increment_include( ${ROBOTRAN_SOURCE_DIR}/mbs_common )
# include these directories # include these directories
include_directories ( ${INCLUDE_DIR} ) include_directories ( ${INCLUDE_DIR} )
include_directories ( ${CMAKE_CURRENT_BINARY_DIR} ) include_directories ( ${CMAKE_CURRENT_BINARY_DIR} )
if( FLAG_SHARED_LIB OR FLAG_SEPARATE_USER_FCT ) if( FLAG_SHARED_LIB OR FLAG_SEPARATE_USER_FCT )
set(CMAKE_WINDOWS_EXPORT_ALL_SYMBOLS ON) set(CMAKE_WINDOWS_EXPORT_ALL_SYMBOLS ON)
add_library(Project_userfct SHARED ${SOURCE_FILES}) add_library(Project_userfct SHARED ${SOURCE_FILES})
target_link_libraries (Project_userfct ${LIB_MBSYSC_REALTIME}) target_link_libraries (Project_userfct ${LIB_MBSYSC_REALTIME})
target_link_libraries (Project_userfct ${LIB_MBSYSC_MODULES}) target_link_libraries (Project_userfct ${LIB_MBSYSC_MODULES})
target_link_libraries (Project_userfct ${LIB_MBSYSC_UTILITIES}) target_link_libraries (Project_userfct ${LIB_MBSYSC_UTILITIES})
# MacOS: Force extension to be .so rather than .dylib # MacOS: Force extension to be .so rather than .dylib
if(APPLE) if(APPLE)
set_target_properties(Project_userfct PROPERTIES SUFFIX ".so") set_target_properties(Project_userfct PROPERTIES SUFFIX ".so")
endif() endif()
# Windows, copy dll next to executable # Windows, copy dll next to executable
if((NOT UNIX) AND (NOT FLAG_SEPARATE_USER_FCT)) if((NOT UNIX) AND (NOT FLAG_SEPARATE_USER_FCT))
add_custom_command(TARGET Project_userfct POST_BUILD add_custom_command(TARGET Project_userfct POST_BUILD
COMMAND ${CMAKE_COMMAND} -E copy COMMAND ${CMAKE_COMMAND} -E copy
${CMAKE_CURRENT_BINARY_DIR}/$<CONFIGURATION>/Project_userfct.dll ${CMAKE_CURRENT_BINARY_DIR}/$<CONFIGURATION>/Project_userfct.dll
${CMAKE_CURRENT_BINARY_DIR}/../$<CONFIGURATION>/Project_userfct.dll ${CMAKE_CURRENT_BINARY_DIR}/../$<CONFIGURATION>/Project_userfct.dll
) )
endif() endif()
else() else()
add_library(Project_userfct STATIC ${SOURCE_FILES}) add_library(Project_userfct STATIC ${SOURCE_FILES})
target_link_libraries (Project_userfct ${LIB_MBSYSC_REALTIME} ${LIB_MBSYSC_UTILITIES}) target_link_libraries (Project_userfct ${LIB_MBSYSC_REALTIME} ${LIB_MBSYSC_UTILITIES})
endif() endif()
# * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * # * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * *
# LINK LIBRARIES # LINK LIBRARIES
# * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * # * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * *
# MBSysC libraries # MBSysC libraries
if ( FLAG_SEPARATE_BUILD ) # find MBSysC dynamic libraries if ( FLAG_SEPARATE_BUILD ) # find MBSysC dynamic libraries
find_package( LibRobotranC 1.15.1 REQUIRED ) find_package( LibRobotranC 1.15.1 REQUIRED )
add_definitions(${LIB_MBSYSC_DEFINITIONS}) add_definitions(${LIB_MBSYSC_DEFINITIONS})
endif() endif()
if (FLAG_PLOT) if (FLAG_PLOT)
sdl_header_lib(userfct) sdl_header_lib(userfct)
endif ( ) endif ( )
...@@ -14,7 +14,7 @@ ...@@ -14,7 +14,7 @@
# CMake minimum version # CMake minimum version
if (UNIX) if (UNIX)
cmake_minimum_required(VERSION 2.8.7) cmake_minimum_required(VERSION 3.4)
else() else()
cmake_minimum_required(VERSION 3.4) cmake_minimum_required(VERSION 3.4)
endif () endif ()
......
...@@ -13,7 +13,7 @@ ...@@ -13,7 +13,7 @@
# * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * # * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * *
if (UNIX) if (UNIX)
cmake_minimum_required(VERSION 2.8.7) cmake_minimum_required(VERSION 3.4)
else() else()
cmake_minimum_required(VERSION 3.4) cmake_minimum_required(VERSION 3.4)
endif () endif ()
......
...@@ -13,7 +13,7 @@ ...@@ -13,7 +13,7 @@
# * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * # * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * *
if (UNIX) if (UNIX)
cmake_minimum_required(VERSION 2.8.7) cmake_minimum_required(VERSION 3.4)
else() else()
cmake_minimum_required(VERSION 3.4) cmake_minimum_required(VERSION 3.4)
endif () endif ()
......
...@@ -14,7 +14,7 @@ ...@@ -14,7 +14,7 @@
# CMake minimum version # CMake minimum version
if (UNIX) if (UNIX)
cmake_minimum_required(VERSION 2.8.7) cmake_minimum_required(VERSION 3.4)
else() else()
cmake_minimum_required(VERSION 3.4) cmake_minimum_required(VERSION 3.4)
endif () endif ()
......
...@@ -13,7 +13,7 @@ ...@@ -13,7 +13,7 @@
# * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * # * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * *
if (UNIX) if (UNIX)
cmake_minimum_required(VERSION 2.8.7) cmake_minimum_required(VERSION 3.4)
else() else()
cmake_minimum_required(VERSION 3.4) cmake_minimum_required(VERSION 3.4)
endif () endif ()
......
...@@ -13,7 +13,7 @@ ...@@ -13,7 +13,7 @@
# * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * # * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * *
if (UNIX) if (UNIX)
cmake_minimum_required(VERSION 2.8.7) cmake_minimum_required(VERSION 3.4)
else() else()
cmake_minimum_required(VERSION 3.4) cmake_minimum_required(VERSION 3.4)
endif () endif ()
......
...@@ -13,7 +13,7 @@ ...@@ -13,7 +13,7 @@
# * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * # * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * *
if (UNIX) if (UNIX)
cmake_minimum_required(VERSION 2.8.7) cmake_minimum_required(VERSION 3.4)
else() else()
cmake_minimum_required(VERSION 3.4) cmake_minimum_required(VERSION 3.4)
endif () endif ()
......