Commit 899b988c authored by Timothee Habra's avatar Timothee Habra
Browse files

replace FindLibRobotranC.cmake by LibRobotranCConfig.cmake config file package...

replace FindLibRobotranC.cmake by LibRobotranCConfig.cmake config file package more appropriate for cmake project
parent f2ae5447
#
# author: Timothee Habra
# Sept 7 2015
#
# This file finds the libraries
# related to Robotran MBSysC
#
# ROBOTRAN_C_FOUND : 1 if all required files found (0 otherwise)
# SDL2_INCLUDE_PATH : include paths (for the header files) -> for compilation
# SDL2_LIBRARIES : libraries -> for linkage
#
IF (UNIX)
IF (APPLE)
## ---- MAC OS ---- ##
## ---------------- ##
ELSE (APPLE)
## ---- LINUX ---- ##
# possible paths for: 'libMBsysC_module.so'
set(TRIAL_PATHS_LIB_MBSYSC_MODULES
"${ROBOTRAN_SOURCE_DIR}/build/mbs_module"
)
# possible paths for: 'libMBsysC_loadXML.so'
set(TRIAL_PATHS_LIB_MBSYSC_LOAD
"${ROBOTRAN_SOURCE_DIR}/build/mbs_load_xml"
)
# possible paths for: 'libMBsysC_numerics.so'
set(TRIAL_PATHS_LIB_MBSYSC_UTILITIES
"${ROBOTRAN_SOURCE_DIR}/build/mbs_utilities"
)
find_library(LIB_MBSYSC_MODULES libMBsysC_module.so ${TRIAL_PATHS_LIB_MBSYSC_MODULES})
find_library(LIB_MBSYSC_LOAD libMBsysC_loadXML.so ${TRIAL_PATHS_LIB_MBSYSC_LOAD})
find_library(LIB_MBSYSC_UTILITIES libMBsysC_utilities.so ${TRIAL_PATHS_LIB_MBSYSC_UTILITIES})
#set(SDL2_LIBRARIES ${SDL2_LIBRARIES_SDL2})
## --------------- ##
ENDIF (APPLE)
ELSE (UNIX)
## ---- WINDOWS ---- ##
# possible paths for: 'MBsysC_module.lib'
SET(TRIAL_PATHS_LIB_MBSYSC_MODULES
"${ROBOTRAN_SOURCE_DIR}\\build\\mbs_module\\Debug"
)
# possible paths for: 'MBsysC_loadXML.lib'
SET(TRIAL_PATHS_LIB_MBSYSC_LOAD
"${ROBOTRAN_SOURCE_DIR}\\build\\mbs_load_xml\\Debug"
)
# possible paths for: 'MBsysC_utilities.lib'
SET(TRIAL_PATHS_LIB_MBSYSC_UTILITIES
"${ROBOTRAN_SOURCE_DIR}\\build\\mbs_utilities\\Debug"
)
# possible paths for: 'MBsysC_realtime.lib'
SET(TRIAL_PATHS_LIB_MBSYSC_REALTIME
"${ROBOTRAN_SOURCE_DIR}\\build\\mbs_realtime\\Debug"
)
FIND_LIBRARY(LIB_MBSYSC_MODULES MBsysC_module.lib ${TRIAL_PATHS_LIB_MBSYSC_MODULES})
FIND_LIBRARY(LIB_MBSYSC_LOAD MBsysC_loadXML.lib ${TRIAL_PATHS_LIB_MBSYSC_LOAD})
FIND_LIBRARY(LIB_MBSYSC_UTILITIES MBsysC_utilities.lib ${TRIAL_PATHS_LIB_MBSYSC_UTILITIES})
FIND_LIBRARY(LIB_MBSYSC_REALTIME MBsysC_realtime.lib ${TRIAL_PATHS_LIB_MBSYSC_REALTIME})
message(STATUS "hello from findLibRobotran cmake ->----- ${LIB_MBSYSC_REALTIME} ")
ENDIF (UNIX)
# flag put to 1 if all required files are found
if (LIB_MBSYSC_MODULES AND LIB_MBSYSC_LOAD AND LIB_MBSYSC_UTILITIES)
set(ROBOTRAN_C_FOUND 1)
else ( )
set(ROBOTRAN_C_FOUND 0)
endif ( )
# outputs
mark_as_advanced(
ROBOTRAN_C_FOUND
#SDL2_INCLUDE_PATH
#SDL2_LIBRARIES
)
......@@ -64,3 +64,10 @@ if(hasParent)
set( JNI_LIBRARIES ${JNI_LIBRARIES} PARENT_SCOPE )
set( J3D_PATH ${J3D_PATH} PARENT_SCOPE )
endif()
# * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * *
# CMake Package Configuration
# * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * *
configure_file(LibRobotranCConfig.cmake.in "${PROJECT_BINARY_DIR}/LibRobotranCConfig.cmake" @ONLY)
# - Config file for the Robotran MBSysC package
# It defines the following variables
# Robotran libraries to link against
# * LIB_MBSYSC_MODULES
# * LIB_MBSYSC_LOAD
# * LIB_MBSYSC_UTILITIES
# * LIB_MBSYSC_REALTIME
# ROBOTRAN_INCLUDE_DIRS - TBD
# ROBOTRAN_EXECUTABLE - TBD
#############
# LIBRARIES
#############
# MBSYSC_MODULES
FIND_LIBRARY(LIB_MBSYSC_MODULES MBsysC_module
PATHS @LIB_MBSYSC_MODULES_PATH@
@LIB_MBSYSC_MODULES_PATH@//Debug
@LIB_MBSYSC_MODULES_PATH@//Release
)
# MBSYSC_LOAD
FIND_LIBRARY(LIB_MBSYSC_LOAD MBsysC_loadXML
PATHS @LIB_MBSYSC_LOAD_PATH@
@LIB_MBSYSC_LOAD_PATH@//Debug
@LIB_MBSYSC_LOAD_PATH@//Release
)
# MBSYSC_UTILITIES
FIND_LIBRARY(LIB_MBSYSC_UTILITIES MBsysC_utilities
PATHS @LIB_MBSYSC_UTILITIES_PATH@
@LIB_MBSYSC_UTILITIES_PATH@//Debug
@LIB_MBSYSC_UTILITIES_PATH@//Release
)
# MBSYSC_REALTIME
FIND_LIBRARY(LIB_MBSYSC_REALTIME MBsysC_realtime
PATHS @LIB_MBSYSC_REALTIME_PATH@
@LIB_MBSYSC_REALTIME_PATH@//Debug
@LIB_MBSYSC_REALTIME_PATH@//Release
)
#############
# USEFUL
#############
# Path to Robotran common files
SET(ROBOTRAN_SOURCE_DIR @ROBOTRAN_SOURCE_DIR@)
......@@ -37,6 +37,8 @@ else( )
add_library(MBsysC_loadXML STATIC ${SOURCE_FILES} ${INCLUDE_DIR})
endif( )
set(LIB_MBSYSC_LOAD_PATH ${CMAKE_CURRENT_BINARY_DIR} PARENT_SCOPE)
# include directories
include_directories("./")
include_directories("../mbs_utilities")
......
......@@ -48,6 +48,8 @@ else( )
add_library(MBsysC_module STATIC ${SOURCE_FILES} ${INCLUDE_DIR})
endif( )
set(LIB_MBSYSC_MODULES_PATH ${CMAKE_CURRENT_BINARY_DIR} PARENT_SCOPE)
# include directories
include_directories("./")
include_directories(../mbs_struct)
......
......@@ -85,6 +85,8 @@ if (FLAG_VISU)
target_link_libraries (MBsysC_realtime ${JNI_LIBRARIES})
endif ( )
set(LIB_MBSYSC_REALTIME_PATH ${CMAKE_CURRENT_BINARY_DIR} PARENT_SCOPE)
# include directories
include_directories("./")
include_directories("./sdl" "./sdl/auto_plot")
......
......@@ -34,6 +34,8 @@ else( )
add_library(MBsysC_utilities STATIC ${SOURCE_FILES} ${INCLUDE_DIR})
endif( )
set(LIB_MBSYSC_UTILITIES_PATH ${CMAKE_CURRENT_BINARY_DIR} PARENT_SCOPE)
# include directories
include_directories("./")
include_directories("./auto_output")
......
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