Commit b5a2d654 authored by Nicolas Docquier's avatar Nicolas Docquier
Browse files

Separate build: adapt CMakeLists.txt for monolithic build with Windows (visual compiler)

parent b58e516d
......@@ -28,8 +28,13 @@ init_src()
increment_src( ${PROJECT_SOURCE_DIR} )
increment_void_symbolic( symbolicR )
add_library(Project_symbolic SHARED ${SOURCE_FILES})
if(FLAG_SHARED_LIB)
add_library(Project_symbolic SHARED ${SOURCE_FILES})
else()
add_library(Project_symbolic STATIC ${SOURCE_FILES})
add_definitions( -DPROJECT_SYMBOLIC_STATIC_DEFINE)
add_definitions( -DPROJECT_USERFCT_STATIC_DEFINE)
endif()
# * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * *
# LINK LIBRARIES
......
......@@ -27,7 +27,12 @@ release_debug()
init_src()
increment_src( ${PROJECT_SOURCE_DIR} )
add_library(Project_userfct SHARED ${SOURCE_FILES})
if(FLAG_SHARED_LIB)
add_library(Project_userfct SHARED ${SOURCE_FILES})
else()
add_library(Project_userfct STATIC ${SOURCE_FILES})
add_definitions( -DMBSYSC_UTILITIES_STATIC_DEFINE)
endif()
# * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * *
# LINK LIBRARIES
......@@ -52,7 +57,6 @@ endif ( )
include (GenerateExportHeader)
GENERATE_EXPORT_HEADER( Project_userfct )
include_directories(${CMAKE_CURRENT_BINARY_DIR})
install (TARGETS Project_userfct DESTINATION ${CMAKE_INSTALL_PREFIX})
......@@ -210,6 +210,9 @@ else ( )
target_link_libraries ( ${Executable} ${JNI_LIBRARIES} )
endif ( )
add_definitions( -DMBSYSC_MODULE_STATIC_DEFINE)
endif ( )
endif ( )
......
......@@ -35,6 +35,7 @@ if(FLAG_SHARED_LIB)
install (TARGETS MBsysC_loadXML DESTINATION ${CMAKE_INSTALL_PREFIX})
else( )
add_library(MBsysC_loadXML STATIC ${SOURCE_FILES} ${INCLUDE_DIR})
add_definitions( -DPROJECT_USERFCT_STATIC_DEFINE)
endif( )
set(LIB_MBSYSC_LOAD_PATH ${CMAKE_CURRENT_BINARY_DIR} PARENT_SCOPE)
......
......@@ -46,6 +46,11 @@ message(STATUS "Test----->" ${LIBXML2_LIBRARIES})
else( )
add_library(MBsysC_module STATIC ${SOURCE_FILES} ${INCLUDE_DIR})
add_definitions( -DMBSYSC_UTILITIES_STATIC_DEFINE)
add_definitions( -DPROJECT_USERFCT_STATIC_DEFINE)
add_definitions( -DPROJECT_SYMBOLIC_STATIC_DEFINE)
add_definitions( -DMBSYSC_REALTIME_STATIC_DEFINE)
# add_definitions( -DMBSYSC_MODULE_STATIC_DEFINE)
endif( )
set(LIB_MBSYSC_MODULES_PATH ${CMAKE_CURRENT_BINARY_DIR} PARENT_SCOPE)
......
......@@ -68,7 +68,15 @@ 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(${LIB_MBSYSC_REALTIME} SHARED ${SOURCE_FILES} ${INCLUDE_DIR})
if(FLAG_SHARED_LIB)
add_library(${LIB_MBSYSC_REALTIME} SHARED ${SOURCE_FILES} ${INCLUDE_DIR})
else()
add_library(${LIB_MBSYSC_REALTIME} STATIC ${SOURCE_FILES} ${INCLUDE_DIR})
add_definitions( -DPROJECT_USERFCT_STATIC_DEFINE)
add_definitions( -DPROJECT_UTILITIES_STATIC_DEFINE)
endif()
target_link_libraries (${LIB_MBSYSC_REALTIME} ${LIB_MBSYSC_UTILITIES})
......
......@@ -23,6 +23,12 @@ set(INCLUDE_DIR ${INCLUDE_DIR} ${PROJECT_SOURCE_DIR} PARENT_SCOPE)
add_library(MBsysC_struct ${SOURCE_FILES} ${INCLUDE_DIR})
if (NOT FLAG_SEPARATE_BUILD )
if (NOT FLAG_SHARED_LIB)
add_definitions( -DMBSYSC_UTILITIES_STATIC_DEFINE)
endif()
endif()
# include directories
include_directories("./")
include_directories("../mbs_utilities/")
......
......@@ -35,6 +35,7 @@ if(FLAG_SHARED_LIB)
install (TARGETS ${LIB_MBSYSC_UTILITIES} DESTINATION ${CMAKE_INSTALL_PREFIX})
else( )
add_library(${LIB_MBSYSC_UTILITIES} STATIC ${SOURCE_FILES} ${INCLUDE_DIR})
add_definitions( -DMBSYSC_UTILITIES_STATIC_DEFINE)
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