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

[CMake] Install shared libraries.

parent a6c02b2b
No related branches found
No related tags found
No related merge requests found
Showing
with 65 additions and 0 deletions
...@@ -4,6 +4,9 @@ set(LIB_SOURCES ${SOURCES_APPLICATIONSLIB}) ...@@ -4,6 +4,9 @@ set(LIB_SOURCES ${SOURCES_APPLICATIONSLIB})
# Library # Library
add_library(ApplicationsLib ${LIB_SOURCES}) add_library(ApplicationsLib ${LIB_SOURCES})
if(BUILD_SHARED_LIBS)
install(TARGETS ApplicationsLib LIBRARY DESTINATION ${CMAKE_INSTALL_LIBDIR})
endif()
target_link_libraries(ApplicationsLib target_link_libraries(ApplicationsLib
PUBLIC BaseLib GeoLib Processes logog PUBLIC BaseLib GeoLib Processes logog
......
...@@ -35,6 +35,9 @@ add_library(QtBase ...@@ -35,6 +35,9 @@ add_library(QtBase
${SOURCES} ${SOURCES}
${HEADERS} ${HEADERS}
) )
if(BUILD_SHARED_LIBS)
install(TARGETS QtBase LIBRARY DESTINATION ${CMAKE_INSTALL_LIBDIR})
endif()
target_link_libraries(QtBase Qt5::Widgets) target_link_libraries(QtBase Qt5::Widgets)
......
...@@ -129,6 +129,9 @@ add_library(QtDataView ...@@ -129,6 +129,9 @@ add_library(QtDataView
${HEADERS} ${HEADERS}
${UIS} ${UIS}
) )
if(BUILD_SHARED_LIBS)
install(TARGETS QtDataView LIBRARY DESTINATION ${CMAKE_INSTALL_LIBDIR})
endif()
target_link_libraries(QtDataView target_link_libraries(QtDataView
PUBLIC GeoLib MeshGeoToolsLib MeshLib QtBase VtkVis PUBLIC GeoLib MeshGeoToolsLib MeshLib QtBase VtkVis
......
...@@ -38,6 +38,9 @@ add_library(QtDiagramView ...@@ -38,6 +38,9 @@ add_library(QtDiagramView
${HEADERS} ${HEADERS}
${UIS} ${UIS}
) )
if(BUILD_SHARED_LIBS)
install(TARGETS QtDiagramView LIBRARY DESTINATION ${CMAKE_INSTALL_LIBDIR})
endif()
target_link_libraries(QtDiagramView target_link_libraries(QtDiagramView
PRIVATE BaseLib GeoLib QtBase DataHolderLib Qt5::Gui logog PRIVATE BaseLib GeoLib QtBase DataHolderLib Qt5::Gui logog
......
...@@ -30,6 +30,9 @@ add_library(QtStratView ...@@ -30,6 +30,9 @@ add_library(QtStratView
${HEADERS} ${HEADERS}
${UIS} ${UIS}
) )
if(BUILD_SHARED_LIBS)
install(TARGETS QtStratView LIBRARY DESTINATION ${CMAKE_INSTALL_LIBDIR})
endif()
target_link_libraries(QtStratView target_link_libraries(QtStratView
PRIVATE BaseLib GeoLib DataHolderLib QtBase Qt5::Gui PRIVATE BaseLib GeoLib DataHolderLib QtBase Qt5::Gui
......
add_library(NetCdfDialogLib NetCdfConfigureDialog.cpp NetCdfConfigureDialog.h) add_library(NetCdfDialogLib NetCdfConfigureDialog.cpp NetCdfConfigureDialog.h)
if(BUILD_SHARED_LIBS)
install(TARGETS NetCdfConfigureDialog LIBRARY DESTINATION ${CMAKE_INSTALL_LIBDIR})
endif()
target_link_libraries(NetCdfDialogLib PUBLIC Qt5::Widgets PRIVATE MathLib vtknetcdfcpp) target_link_libraries(NetCdfDialogLib PUBLIC Qt5::Widgets PRIVATE MathLib vtknetcdfcpp)
set_property(TARGET NetCdfDialogLib PROPERTY FOLDER "DataExplorer") set_property(TARGET NetCdfDialogLib PROPERTY FOLDER "DataExplorer")
......
...@@ -128,6 +128,9 @@ add_library(VtkVis ...@@ -128,6 +128,9 @@ add_library(VtkVis
${HEADERS} ${HEADERS}
${UIS} ${UIS}
) )
if(BUILD_SHARED_LIBS)
install(TARGETS VtkVis LIBRARY DESTINATION ${CMAKE_INSTALL_LIBDIR})
endif()
if(GEOTIFF_FOUND) if(GEOTIFF_FOUND)
include_directories(${GEOTIFF_INCLUDE_DIRS}) include_directories(${GEOTIFF_INCLUDE_DIRS})
......
...@@ -3,6 +3,9 @@ GET_SOURCE_FILES(SOURCES_DataHolderLib) ...@@ -3,6 +3,9 @@ GET_SOURCE_FILES(SOURCES_DataHolderLib)
# Library # Library
add_library(DataHolderLib ${SOURCES_DataHolderLib}) add_library(DataHolderLib ${SOURCES_DataHolderLib})
if(BUILD_SHARED_LIBS)
install(TARGETS DataHolderLib LIBRARY DESTINATION ${CMAKE_INSTALL_LIBDIR})
endif()
target_link_libraries(DataHolderLib target_link_libraries(DataHolderLib
PUBLIC GeoLib MeshLib PUBLIC GeoLib MeshLib
......
...@@ -20,6 +20,9 @@ include(${PROJECT_SOURCE_DIR}/scripts/cmake/OGSEnabledElements.cmake) ...@@ -20,6 +20,9 @@ include(${PROJECT_SOURCE_DIR}/scripts/cmake/OGSEnabledElements.cmake)
# Create the library # Create the library
add_library(ApplicationsFileIO ${SOURCES}) add_library(ApplicationsFileIO ${SOURCES})
if(BUILD_SHARED_LIBS)
install(TARGETS ApplicationsFileIO LIBRARY DESTINATION ${CMAKE_INSTALL_LIBDIR})
endif()
target_link_libraries(ApplicationsFileIO target_link_libraries(ApplicationsFileIO
PUBLIC BaseLib DataHolderLib GeoLib MathLib logog PUBLIC BaseLib DataHolderLib GeoLib MathLib logog
PRIVATE MeshLib PRIVATE MeshLib
......
...@@ -3,6 +3,9 @@ GET_SOURCE_FILES(SOURCES) ...@@ -3,6 +3,9 @@ GET_SOURCE_FILES(SOURCES)
# Library # Library
add_library(InSituLib ${SOURCES}) add_library(InSituLib ${SOURCES})
if(BUILD_SHARED_LIBS)
install(TARGETS InSituLib LIBRARY DESTINATION ${CMAKE_INSTALL_LIBDIR})
endif()
target_link_libraries(PUBLIC BaseLib PRIVATE MeshLib) target_link_libraries(PUBLIC BaseLib PRIVATE MeshLib)
......
...@@ -11,6 +11,9 @@ list(APPEND SOURCES "${CMAKE_CURRENT_BINARY_DIR}/BuildInfo.cpp" BuildInfo.h) ...@@ -11,6 +11,9 @@ list(APPEND SOURCES "${CMAKE_CURRENT_BINARY_DIR}/BuildInfo.cpp" BuildInfo.h)
# Create the library # Create the library
add_library(BaseLib ${SOURCES}) add_library(BaseLib ${SOURCES})
if(BUILD_SHARED_LIBS)
install(TARGETS BaseLib LIBRARY DESTINATION ${CMAKE_INSTALL_LIBDIR})
endif()
include(GenerateExportHeader) include(GenerateExportHeader)
generate_export_header(BaseLib) generate_export_header(BaseLib)
......
...@@ -12,6 +12,9 @@ endif() ...@@ -12,6 +12,9 @@ endif()
# Create the library # Create the library
add_library(GeoLib ${SOURCES}) add_library(GeoLib ${SOURCES})
if(BUILD_SHARED_LIBS)
install(TARGETS GeoLib LIBRARY DESTINATION ${CMAKE_INSTALL_LIBDIR})
endif()
target_link_libraries(GeoLib PUBLIC BaseLib MathLib logog PRIVATE tet) target_link_libraries(GeoLib PUBLIC BaseLib MathLib logog PRIVATE tet)
......
...@@ -22,6 +22,9 @@ append_source_files(SOURCES PorousMedium/UnsaturatedProperty/RelativePermeabilit ...@@ -22,6 +22,9 @@ append_source_files(SOURCES PorousMedium/UnsaturatedProperty/RelativePermeabilit
append_source_files(SOURCES TwoPhaseModels) append_source_files(SOURCES TwoPhaseModels)
add_library(MaterialLib ${SOURCES}) add_library(MaterialLib ${SOURCES})
if(BUILD_SHARED_LIBS)
install(TARGETS MaterialLib LIBRARY DESTINATION ${CMAKE_INSTALL_LIBDIR})
endif()
include(GenerateExportHeader) include(GenerateExportHeader)
generate_export_header(MaterialLib) generate_export_header(MaterialLib)
......
...@@ -26,6 +26,9 @@ endif() ...@@ -26,6 +26,9 @@ endif()
# Create the library # Create the library
add_library(MathLib ${SOURCES}) add_library(MathLib ${SOURCES})
if(BUILD_SHARED_LIBS)
install(TARGETS MathLib LIBRARY DESTINATION ${CMAKE_INSTALL_LIBDIR})
endif()
include(GenerateExportHeader) include(GenerateExportHeader)
generate_export_header(MathLib) generate_export_header(MathLib)
......
...@@ -3,6 +3,9 @@ GET_SOURCE_FILES(SOURCES) ...@@ -3,6 +3,9 @@ GET_SOURCE_FILES(SOURCES)
# Create the library # Create the library
add_library(MeshGeoToolsLib ${SOURCES}) add_library(MeshGeoToolsLib ${SOURCES})
if(BUILD_SHARED_LIBS)
install(TARGETS MeshGeoToolsLib LIBRARY DESTINATION ${CMAKE_INSTALL_LIBDIR})
endif()
target_link_libraries(MeshGeoToolsLib target_link_libraries(MeshGeoToolsLib
PUBLIC GeoLib MathLib PUBLIC GeoLib MathLib
......
...@@ -22,6 +22,9 @@ endif() ...@@ -22,6 +22,9 @@ endif()
# Create the library # Create the library
add_library(MeshLib ${SOURCES}) add_library(MeshLib ${SOURCES})
if(BUILD_SHARED_LIBS)
install(TARGETS MeshLib LIBRARY DESTINATION ${CMAKE_INSTALL_LIBDIR})
endif()
if(OGS_USE_PCH) if(OGS_USE_PCH)
cotire(MeshLib) cotire(MeshLib)
endif() endif()
......
...@@ -16,6 +16,9 @@ APPEND_SOURCE_FILES(SOURCES Extrapolation) ...@@ -16,6 +16,9 @@ APPEND_SOURCE_FILES(SOURCES Extrapolation)
# Create the library # Create the library
add_library(NumLib ${SOURCES}) add_library(NumLib ${SOURCES})
if(BUILD_SHARED_LIBS)
install(TARGETS NumLib LIBRARY DESTINATION ${CMAKE_INSTALL_LIBDIR})
endif()
include(GenerateExportHeader) include(GenerateExportHeader)
generate_export_header(NumLib) generate_export_header(NumLib)
target_include_directories(NumLib PUBLIC ${CMAKE_CURRENT_BINARY_DIR}) target_include_directories(NumLib PUBLIC ${CMAKE_CURRENT_BINARY_DIR})
......
...@@ -3,6 +3,10 @@ add_library(ProcessLibBoundaryConditionPython ...@@ -3,6 +3,10 @@ add_library(ProcessLibBoundaryConditionPython
PythonBoundaryCondition.h PythonBoundaryCondition.h
PythonBoundaryConditionLocalAssembler.h PythonBoundaryConditionLocalAssembler.h
PythonBoundaryConditionPythonSideInterface.h) PythonBoundaryConditionPythonSideInterface.h)
if(BUILD_SHARED_LIBS)
install(TARGETS ProcessLibBoundaryConditionPython
LIBRARY DESTINATION ${CMAKE_INSTALL_LIBDIR})
endif()
target_compile_definitions(ProcessLibBoundaryConditionPython target_compile_definitions(ProcessLibBoundaryConditionPython
PUBLIC OGS_USE_PYTHON) PUBLIC OGS_USE_PYTHON)
...@@ -15,6 +19,10 @@ target_link_libraries(ProcessLibBoundaryConditionPython ...@@ -15,6 +19,10 @@ target_link_libraries(ProcessLibBoundaryConditionPython
add_library(ProcessLibBoundaryConditionPythonModule add_library(ProcessLibBoundaryConditionPythonModule
PythonBoundaryConditionModule.cpp PythonBoundaryConditionModule.cpp
PythonBoundaryConditionModule.h) PythonBoundaryConditionModule.h)
if(BUILD_SHARED_LIBS)
install(TARGETS ProcessLibBoundaryConditionPythonModule
LIBRARY DESTINATION ${CMAKE_INSTALL_LIBDIR})
endif()
target_link_libraries(ProcessLibBoundaryConditionPythonModule target_link_libraries(ProcessLibBoundaryConditionPythonModule
PUBLIC PUBLIC
......
...@@ -20,6 +20,9 @@ APPEND_SOURCE_FILES(SOURCES SourceTerms) ...@@ -20,6 +20,9 @@ APPEND_SOURCE_FILES(SOURCES SourceTerms)
APPEND_SOURCE_FILES(SOURCES Utils) APPEND_SOURCE_FILES(SOURCES Utils)
add_library(ProcessLib ${SOURCES}) add_library(ProcessLib ${SOURCES})
if(BUILD_SHARED_LIBS)
install(TARGETS ProcessLib LIBRARY DESTINATION ${CMAKE_INSTALL_LIBDIR})
endif()
target_link_libraries(ProcessLib target_link_libraries(ProcessLib
PUBLIC BaseLib MaterialLib MathLib MeshLib NumLib logog MeshGeoToolsLib PUBLIC BaseLib MaterialLib MathLib MeshLib NumLib logog MeshGeoToolsLib
......
APPEND_SOURCE_FILES(SOURCES) APPEND_SOURCE_FILES(SOURCES)
add_library(ComponentTransport ${SOURCES}) add_library(ComponentTransport ${SOURCES})
if(BUILD_SHARED_LIBS)
install(TARGETS ComponentTransport LIBRARY DESTINATION ${CMAKE_INSTALL_LIBDIR})
endif()
target_link_libraries(ComponentTransport target_link_libraries(ComponentTransport
PUBLIC ProcessLib PUBLIC ProcessLib
......
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