Commit e29afa69 authored by Timothee Habra's avatar Timothee Habra
Browse files

put utilities and realtime libraries in cmake macro

parent 503cb36b
......@@ -28,14 +28,14 @@ FIND_LIBRARY(LIB_MBSYSC_LOAD MBsysC_loadXML
)
# MBSYSC_UTILITIES
FIND_LIBRARY(LIB_MBSYSC_UTILITIES MBsysC_utilities
FIND_LIBRARY(LIB_MBSYSC_UTILITIES @LIB_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
FIND_LIBRARY(LIB_MBSYSC_REALTIME @LIB_MBSYSC_REALTIME@
PATHS @LIB_MBSYSC_REALTIME_PATH@
@LIB_MBSYSC_REALTIME_PATH@//Debug
@LIB_MBSYSC_REALTIME_PATH@//Release
......
......@@ -28,7 +28,7 @@ set(INCLUDE_DIR ${INCLUDE_DIR} ${PROJECT_SOURCE_DIR} PARENT_SCOPE)
if(FLAG_SHARED_LIB)
include (GenerateExportHeader)
add_library(MBsysC_loadXML SHARED ${SOURCE_FILES} ${INCLUDE_DIR})
target_link_libraries(MBsysC_loadXML ${LIBXML2_LIBRARIES} MBsysC_utilities)
target_link_libraries(MBsysC_loadXML ${LIBXML2_LIBRARIES} ${LIB_MBSYSC_UTILITIES})
#target_link_libraries(MBsysC_loadXML Project_userfct )
GENERATE_EXPORT_HEADER( MBsysC_loadXML )
include_directories(${CMAKE_CURRENT_BINARY_DIR})
......
......@@ -38,7 +38,7 @@ if(FLAG_SHARED_LIB)
include (GenerateExportHeader)
add_library(MBsysC_module SHARED ${SOURCE_FILES} ${INCLUDE_DIR})
message(STATUS "Test----->" ${LIBXML2_LIBRARIES})
target_link_libraries(MBsysC_module MBsysC_struct MBsysC_numerics MBsysC_utilities MBsysC_realtime ${LIBXML2_LIBRARIES} ${GSL_LIBRARIES})
target_link_libraries(MBsysC_module MBsysC_struct MBsysC_numerics ${LIB_MBSYSC_UTILITIES} ${LIB_MBSYSC_REALTIME} ${LIBXML2_LIBRARIES} ${GSL_LIBRARIES})
GENERATE_EXPORT_HEADER( MBsysC_module )
include_directories(${CMAKE_CURRENT_BINARY_DIR})
......
......@@ -68,23 +68,23 @@ 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})
add_library(${LIB_MBSYSC_REALTIME} SHARED ${SOURCE_FILES} ${INCLUDE_DIR})
target_link_libraries (MBsysC_realtime MBsysC_utilities)
target_link_libraries (${LIB_MBSYSC_REALTIME} ${LIB_MBSYSC_UTILITIES})
include (GenerateExportHeader)
GENERATE_EXPORT_HEADER( MBsysC_realtime )
GENERATE_EXPORT_HEADER( ${LIB_MBSYSC_REALTIME} )
include_directories(${CMAKE_CURRENT_BINARY_DIR})
install (TARGETS MBsysC_realtime DESTINATION ${CMAKE_INSTALL_PREFIX})
install (TARGETS ${LIB_MBSYSC_REALTIME} DESTINATION ${CMAKE_INSTALL_PREFIX})
# SDL external library: linkage
if (FLAG_PLOT)
target_link_libraries (MBsysC_realtime ${SDL2_LIBRARIES} ${SDL2TTF_LIBRARIES})
target_link_libraries (${LIB_MBSYSC_REALTIME} ${SDL2_LIBRARIES} ${SDL2TTF_LIBRARIES})
endif ( )
# Java external library: linkage
if (FLAG_VISU)
target_link_libraries (MBsysC_realtime ${JNI_LIBRARIES})
target_link_libraries (${LIB_MBSYSC_REALTIME} ${JNI_LIBRARIES})
endif ( )
set(LIB_MBSYSC_REALTIME_PATH ${CMAKE_CURRENT_BINARY_DIR} PARENT_SCOPE)
......
......@@ -27,14 +27,14 @@ set(LIB_MBSYSC_UTILITIES ${LIB_MBSYSC_UTILITIES} PARENT_SCOPE)
if(FLAG_SHARED_LIB)
include (GenerateExportHeader)
add_library(MBsysC_utilities SHARED ${SOURCE_FILES} ${INCLUDE_DIR})
add_library(${LIB_MBSYSC_UTILITIES} SHARED ${SOURCE_FILES} ${INCLUDE_DIR})
target_link_libraries(MBsysC_struct)
GENERATE_EXPORT_HEADER( MBsysC_utilities )
GENERATE_EXPORT_HEADER( ${LIB_MBSYSC_UTILITIES} )
include_directories(${CMAKE_CURRENT_BINARY_DIR})
install (TARGETS MBsysC_utilities DESTINATION ${CMAKE_INSTALL_PREFIX})
install (TARGETS ${LIB_MBSYSC_UTILITIES} DESTINATION ${CMAKE_INSTALL_PREFIX})
else( )
add_library(MBsysC_utilities STATIC ${SOURCE_FILES} ${INCLUDE_DIR})
add_library(${LIB_MBSYSC_UTILITIES} STATIC ${SOURCE_FILES} ${INCLUDE_DIR})
endif( )
set(LIB_MBSYSC_UTILITIES_PATH ${CMAKE_CURRENT_BINARY_DIR} PARENT_SCOPE)
......
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