Skip to content
Snippets Groups Projects
Commit db44a507 authored by Florian Schültke's avatar Florian Schültke
Browse files

libraries (schueltke):

 - update cmake for static release
parent fc9b664b
Branches
Tags
No related merge requests found
......@@ -35,7 +35,7 @@ option(BUILD_BLACKBOXTESTS "Use blackbox testing" OFF)
# Option for unit testing
option(BUILD_UNITTEST "Use unit testing" OFF)
# Option to include system libraries in the package archive
option(PACKAGE_SYSTEM_LIBRARIES "Include system libraries in the package archive" ON)
option(PACKAGE_SYSTEM_LIBRARIES "Include system libraries in the package archive" OFF)
# Finally decide whether to build static or shared libraries
option(BUILD_SHARED_LIBS "Build shared libraries" OFF)
......@@ -50,6 +50,20 @@ else()
message(STATUS "[${PROJECT_NAME}] -> Building static libraries")
endif()
if(PACKAGE_SYSTEM_LIBRARIES)
if(BUILD_SHARED_LIBS)
get_filename_component( SYSTEM_LIBS_PATH ${CMAKE_CXX_COMPILER} PATH )
message(STATUS "[${PROJECT_NAME}] -> Packaging System Libraries from: ${SYSTEM_LIBS_PATH}")
message(DEPRECATION "Packaging system libraries is enabled. This will be removed in the future due to the native compiler support!")
else() # Activate static linkage of compiler runtime libs
if(MSVC)
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} /MT")
else(CMAKE_CXX_COMPILER_ID STREQUAL "GNU")
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -static")
endif()
endif()
endif()
# Get Python and pipenv to build the Python packages
set(PYTHON_TARGETS "") # List containing the python targets
......@@ -76,8 +90,8 @@ set(PYBIND11_FINDPYTHON ON) # Let pybind11 find the python interpreter
add_subdirectory(extern/pybind11)
# Set the output directory for all libraries -> Use generator expressions to force multi-generator output to the same location
set(CMAKE_RUNTIME_OUTPUT_DIRECTORY ${CMAKE_CURRENT_SOURCE_DIR}/unicadoRuntimeLibs$<0:>) # .dll for Windows
set(CMAKE_LIBRARY_OUTPUT_DIRECTORY ${CMAKE_CURRENT_SOURCE_DIR}/unicadoRuntimeLibs$<0:>) # .so for Unix
set(CMAKE_RUNTIME_OUTPUT_DIRECTORY ${CMAKE_CURRENT_SOURCE_DIR}/unicadoRuntimeLibs$<0:>) # .dll for Windows and .so for Unix
set(CMAKE_LIBRARY_OUTPUT_DIRECTORY ${CMAKE_CURRENT_SOURCE_DIR}/unicadoRuntimeLibs$<0:>) # .lib for Windows and .so for Unix
# Include the library directories based on dependency order
add_subdirectory(aerodynamics)
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment