Skip to content
Snippets Groups Projects
Commit 814a6d28 authored by Lars Bilke's avatar Lars Bilke
Browse files

Merge branch 'fix-gui-shared' into 'master'

[CMake] Fixed gui shared build.

See merge request ogs/ogs!3554
parents 47a9c07a 2d2a8a29
No related branches found
No related tags found
No related merge requests found
...@@ -131,7 +131,7 @@ if(GEOTIFF_FOUND) ...@@ -131,7 +131,7 @@ if(GEOTIFF_FOUND)
include_directories(${GEOTIFF_INCLUDE_DIRS}) include_directories(${GEOTIFF_INCLUDE_DIRS})
endif() # GEOTIFF_FOUND endif() # GEOTIFF_FOUND
ogs_add_library(QtDataView ${SOURCES} ${HEADERS} ${UIS}) ogs_add_library(QtDataView STATIC ${SOURCES} ${HEADERS} ${UIS})
target_link_libraries( target_link_libraries(
QtDataView QtDataView
......
...@@ -132,7 +132,7 @@ include_directories( ...@@ -132,7 +132,7 @@ include_directories(
${GUI_SOURCE_DIR_REL}/VtkModules/Qt ${GUI_SOURCE_DIR_REL}/VtkModules/Qt
) )
ogs_add_library(VtkVis ${SOURCES} ${HEADERS} ${UIS}) ogs_add_library(VtkVis STATIC ${SOURCES} ${HEADERS} ${UIS})
if(GEOTIFF_FOUND) if(GEOTIFF_FOUND)
target_compile_definitions(VtkVis PRIVATE GEOTIFF_FOUND) target_compile_definitions(VtkVis PRIVATE GEOTIFF_FOUND)
......
...@@ -83,12 +83,20 @@ endfunction() ...@@ -83,12 +83,20 @@ endfunction()
# Replacement for add_library() for ogs targets # Replacement for add_library() for ogs targets
function(ogs_add_library targetName) function(ogs_add_library targetName)
foreach(file ${ARGN}) set(options STATIC SHARED)
cmake_parse_arguments(ogs_add_library "${options}" "" "" ${ARGN})
foreach(file ${ogs_add_library_UNPARSED_ARGUMENTS})
get_filename_component(file_path ${file} REALPATH) get_filename_component(file_path ${file} REALPATH)
list(APPEND files ${file_path}) list(APPEND files ${file_path})
endforeach() endforeach()
add_library(${targetName} ${files}) if(ogs_add_library_STATIC)
set(TYPE STATIC)
elseif(ogs_add_library_SHARED)
set(TYPE SHARED)
endif()
add_library(${targetName} ${TYPE} ${files})
target_compile_options( target_compile_options(
${targetName} ${targetName}
PRIVATE # OR does not work with cotire PRIVATE # OR does not work with cotire
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment