Commit a2ef0ef2 authored by Christian Schulte zu Berge's avatar Christian Schulte zu Berge
Browse files

Merge branch 'issue367' into 'development'

Small refactorings related to issue #367
parents af890ccc 739996fa
......@@ -10,7 +10,7 @@ CMAKE_MINIMUM_REQUIRED(VERSION 2.8.0 FATAL_ERROR)
# Global Build Options
#
OPTION(CAMPVIS_SHARED_LIBS "Build shared libraries?" ON)
OPTION(BUILD_SHARED_LIBS "Build shared libraries?" ON)
#OPTION(CAMPVIS_PRECOMPILED_HEADER "Use pre-compiled headers?" ON)
OPTION(CAMPVIS_DEBUG "Activate debug code?" ON)
OPTION(CAMPVIS_BUILD_APPLICATION "Build CAMPVis Application" ON)
......
......@@ -110,7 +110,7 @@ IF(WIN32)
SET(CMAKE_SHARED_LINKER_FLAGS "${CMAKE_SHARED_LINKER_FLAGS} /LARGEADDRESSAWARE")
SET(CMAKE_EXE_LINKER_FLAGS "${CMAKE_EXE_LINKER_FLAGS} /LARGEADDRESSAWARE")
IF(CAMPVIS_SHARED_LIBS)
IF(BUILD_SHARED_LIBS)
# Linking against Windows DLLs requires explicit instantiation of templates
LIST(APPEND CampvisGlobalDefinitions "-DDLL_TEMPLATE_INST")
LIST(APPEND CampvisGlobalDefinitions "-DCAMPVIS_DYNAMIC_LIBS")
......
......@@ -4,13 +4,6 @@ CMAKE_MINIMUM_REQUIRED(VERSION 2.8.0 FATAL_ERROR)
MESSAGE(STATUS "Configuring CAMPVis Core")
# configuration
IF(CAMPVIS_SHARED_LIBS)
SET(BUILD_SHARED_LIBS TRUE)
IF(MSVC)
ADD_DEFINITIONS("-DCAMPVIS_CORE_BUILD_DLL")
ENDIF()
ENDIF()
# glob sources from core directories
FILE(GLOB CampvisCoreSources RELATIVE ${CMAKE_CURRENT_SOURCE_DIR}
......@@ -58,8 +51,12 @@ ADD_DEFINITIONS(${CampvisGlobalDefinitions})
INCLUDE_DIRECTORIES(${CampvisGlobalIncludeDirs})
TARGET_LINK_LIBRARIES(campvis-core tgt ${CampvisGlobalExternalLibs})
# if campvis-core is built as a shared library, CMake will define the following flag to instruct
# the code to export DLL symbols
SET_TARGET_PROPERTIES(campvis-core PROPERTIES DEFINE_SYMBOL "CAMPVIS_CORE_BUILD_DLL")
IF(CAMPVIS_GROUP_SOURCE_FILES)
DEFINE_SOURCE_GROUPS_FROM_SUBDIR(CampvisCoreSources ${CampvisHome} "")
DEFINE_SOURCE_GROUPS_FROM_SUBDIR(CampvisCoreHeaders ${CampvisHome} "")
ENDIF()
\ No newline at end of file
ENDIF()
......@@ -14,13 +14,6 @@ IF(TGT_WITH_WMI)
LIST(APPEND CampvisGlobalExternalLibs "WbemUuid")
ENDIF(TGT_WITH_WMI)
IF(CAMPVIS_SHARED_LIBS)
SET(BUILD_SHARED_LIBS TRUE)
IF(MSVC)
ADD_DEFINITIONS("-DTGT_BUILD_DLL")
ENDIF()
ENDIF()
# headers
FILE(GLOB TGT_HEADERS *.h event/*.h navigation/*.h)
......@@ -100,6 +93,11 @@ ADD_DEFINITIONS(${CampvisGlobalDefinitions} ${CampvisModulesDefinitions} ${QT_DE
INCLUDE_DIRECTORIES(${CampvisGlobalIncludeDirs} ${CampvisModulesIncludeDirs})
TARGET_LINK_LIBRARIES(tgt ${CampvisGlobalExternalLibs} ${QT_LIBRARIES})
# if TGT is built as a shared library, CMake will define the following flag to instruct the code to
# export DLL symbols
SET_TARGET_PROPERTIES(tgt PROPERTIES DEFINE_SYMBOL "TGT_BUILD_DLL")
################################################################################
# deployment
################################################################################
......
......@@ -17,7 +17,7 @@ LIST(APPEND CampvisModulesSources
LINK_DIRECTORIES(${CampvisGlobalLinkDirectories} ${CampvisModulesLinkDirectories})
ADD_LIBRARY(campvis-modules
ADD_LIBRARY(campvis-modules STATIC
${CampvisModulesSources} ${CampvisModulesHeaders}
)
......
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