Commit 503cb36b authored by Timothee Habra's avatar Timothee Habra
Browse files

clean cmake

parent 90c94495
......@@ -36,13 +36,11 @@ add_library(Project_userfct SHARED ${SOURCE_FILES})
# MBSysC libraries
if ( FLAG_SEPARATE_BUILD ) # find MBSysC dynamic libraries
find_package( LibRobotranC REQUIRED )
target_link_libraries( Project_userfct ${LIB_MBSYSC_REALTIME} ${LIB_MBSYSC_UTILITIES} )
add_definitions(${LIB_MBSYSC_DEFINITIONS})
else ( )
#TODO define MBsysC_realtime MBsysC_utilities in mbs_common cmake to avoid this line dublicated (above and below)
target_link_libraries (Project_userfct MBsysC_realtime MBsysC_utilities)
add_definitions(${LIB_MBSYSC_DEFINITIONS})
endif()
target_link_libraries (Project_userfct ${LIB_MBSYSC_REALTIME} ${LIB_MBSYSC_UTILITIES})
if (FLAG_PLOT)
sdl_header_lib(userfct)
endif ( )
......
......@@ -83,8 +83,12 @@ SET(LIB_MBSYSC_INCLUDE_DIRS "${ROBOTRAN_SOURCE_DIR}/mbs_common/mbs_struct"
"${ROBOTRAN_SOURCE_DIR}/mbs_common/mbs_realtime/sdl/auto_plot"
)
configure_file(LibRobotranCConfig.cmake.in "${PROJECT_BINARY_DIR}/LibRobotranCConfig.cmake" @ONLY)
if(hasParent) #compiled by standalone project
SET(LIB_MBSYSC_INCLUDE_DIRS ${LIB_MBSYSC_INCLUDE_DIRS} PARENT_SCOPE )
else() # compile as a library (in separate build)
configure_file(LibRobotranCConfig.cmake.in "${PROJECT_BINARY_DIR}/LibRobotranCConfig.cmake" @ONLY)
SET(LIB_MBSYSC_REALTIME ${LIB_MBSYSC_REALTIME} PARENT_SCOPE)
SET(LIB_MBSYSC_UTILITIES ${LIB_MBSYSC_UTILITIES} PARENT_SCOPE)
endif()
......@@ -66,6 +66,8 @@ endif ()
init_include()
set(INCLUDE_DIR ${INCLUDE_DIR} ${PROJECT_SOURCE_DIR}/realtime PARENT_SCOPE)
set(LIB_MBSYSC_REALTIME MBsysC_realtime)
set(LIB_MBSYSC_REALTIME ${LIB_MBSYSC_REALTIME} PARENT_SCOPE)
add_library(MBsysC_realtime SHARED ${SOURCE_FILES} ${INCLUDE_DIR})
target_link_libraries (MBsysC_realtime MBsysC_utilities)
......
......@@ -22,6 +22,9 @@ init_include()
set(INCLUDE_DIR ${INCLUDE_DIR} ${PROJECT_SOURCE_DIR} PARENT_SCOPE)
set(INCLUDE_DIR ${INCLUDE_DIR} ${PROJECT_SOURCE_DIR}/auto_output PARENT_SCOPE)
set(LIB_MBSYSC_UTILITIES MBsysC_utilities)
set(LIB_MBSYSC_UTILITIES ${LIB_MBSYSC_UTILITIES} PARENT_SCOPE)
if(FLAG_SHARED_LIB)
include (GenerateExportHeader)
add_library(MBsysC_utilities SHARED ${SOURCE_FILES} ${INCLUDE_DIR})
......
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