Skip to content
Snippets Groups Projects
Commit 51f24bdb authored by Markus Blatt's avatar Markus Blatt
Browse files

[Merge][CMake] Merged revisions : 6598

Revision  r6598
.----------------------
By default cmake prefers to use shared libraries resulting in a mix of shared 
and static (dune-common) linkage. For supercomputer we need pure statically 
linked binaries.

This patch maked Cmake prefer static linkage on request (i.e. setting 
DUNE_USE_ONLY_STATIC_LIB to true).

Unfortunately, this breaks the Lapack test on ubuntu and Debian (at least 
wheezy) as there are multiple definitions in libblas.a and liblapack.a.


.----------------------


[[Imported from SVN: r7146]]
parents 041b2f9e 6c64df05
Branches
Tags
No related merge requests found
......@@ -16,6 +16,23 @@ set(DUNE_COMMON_VERSION_MAJOR "${DUNE_VERSION_MAJOR}")
set(DUNE_COMMON_VERSION_MINOR "${DUNE_VERSION_MINOR}")
set(DUNE_COMMON_VERSION_REVISION "${DUNE_VERSION_REVISION}")
message("DUNE_USE_ONLY_STATIC_LIB ${DUNE_USE_ONLY_STATIC_LIB}")
if(DUNE_USE_ONLY_STATIC_LIBS)
# Use only static libraries.
# We do this by overriding the library suffixes.
set( BLA_STATIC 1)
set( _dune_ORIG_CMAKE_FIND_LIBRARY_SUFFIXES ${CMAKE_FIND_LIBRARY_SUFFIXES})
if (WIN32)
set(CMAKE_FIND_LIBRARY_SUFFIXES .lib ${CMAKE_FIND_LIBRARY_SUFFIXES})
endif (WIN32)
if (APPLE)
set(CMAKE_FIND_LIBRARY_SUFFIXES .lib ${CMAKE_FIND_LIBRARY_SUFFIXES})
else (APPLE)
set(CMAKE_FIND_LIBRARY_SUFFIXES .a )
endif (APPLE)
endif()
include(DuneStreams)
dune_set_minimal_debug_level()
......@@ -62,6 +79,8 @@ add_definitions(-DHAVE_CONFIG_H)
# add subdirectories to execute CMakeLists.txt there
add_subdirectory("dune")
set( CMAKE_FIND_LIBRARY_SUFFIXES ${_dune_ORIG_CMAKE_FIND_LIBRARY_SUFFIXES})
# set up CTest
enable_testing()
include(CTest)
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment