]> SALOME platform Git repositories - tools/medcoupling.git/commitdiff
Salome HOME
Added option MEDCOUPLING_BUILD_STATIC to build static libs. abn/staticlib
authorabn <adrien.bruneton@cea.fr>
Mon, 11 Apr 2016 08:01:10 +0000 (10:01 +0200)
committerabn <adrien.bruneton@cea.fr>
Mon, 11 Apr 2016 08:01:10 +0000 (10:01 +0200)
CMakeLists.txt
src/INTERP_KERNEL/CMakeLists.txt
src/INTERP_KERNELTest/CMakeLists.txt
src/MEDCoupling/CMakeLists.txt
src/MEDLoader/CMakeLists.txt
src/MEDPartitioner/CMakeLists.txt
src/MEDPartitioner/Test/CMakeLists.txt
src/ParaMEDLoader/CMakeLists.txt
src/ParaMEDMEM/CMakeLists.txt
src/ParaMEDMEMTest/CMakeLists.txt
src/RENUMBER/CMakeLists.txt

index b366b9307bb57fde98205a4d796d7be579233646..00068d1a45544470e384cc7a060a1410f072cf55 100644 (file)
@@ -17,7 +17,7 @@
 # See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
 #
 
-CMAKE_MINIMUM_REQUIRED(VERSION 2.8.2 FATAL_ERROR)
+CMAKE_MINIMUM_REQUIRED(VERSION 2.8.12 FATAL_ERROR)
 #INCLUDE(CMakeDependentOption)
 PROJECT(MEDCoupling C CXX)
 
@@ -55,6 +55,7 @@ OPTION(MEDCOUPLING_WITH_FILE_EXAMPLES "Install examples of files containing mesh
 OPTION(MEDCOUPLING_USE_MPI "(Use MPI containers) - For MED this triggers the build of ParaMEDMEM." OFF)
 OPTION(MEDCOUPLING_BUILD_TESTS "Build MED tests." ON)
 OPTION(MEDCOUPLING_BUILD_DOC "Build MED doc." ON)
+OPTION(MEDCOUPLING_BUILD_STATIC "Build MEDCoupling library in static mode." OFF)
 CMAKE_DEPENDENT_OPTION(MEDCOUPLING_PARTITIONER_METIS "Enable metis graph library in MEDPartitioner." ON "MEDCOUPLING_ENABLE_PARTITIONER" OFF)
 CMAKE_DEPENDENT_OPTION(MEDCOUPLING_PARTITIONER_SCOTCH "Enable scotch graph library in MEDPartitioner." ON "MEDCOUPLING_ENABLE_PARTITIONER;NOT MEDCOUPLING_USE_MPI" OFF)
 CMAKE_DEPENDENT_OPTION(MEDCOUPLING_PARTITIONER_PARMETIS "Enable parmetis graph library in MEDPartitioner." ON "MEDCOUPLING_ENABLE_PARTITIONER;MEDCOUPLING_USE_MPI" OFF)
@@ -62,6 +63,13 @@ IF(WIN32)
   CMAKE_DEPENDENT_OPTION(MEDCOUPLING_MEDLOADER_USE_XDR "Enable use of XDR for SauvReader." ON "NOT MEDCOUPLING_MICROMED" OFF)
 ENDIF(WIN32)
 
+IF(MEDCOUPLING_BUILD_STATIC)
+    SET(BUILD_SHARED_LIBS 0)
+    SET(CMAKE_POSITION_INDEPENDENT_CODE 1) # -fPIC option
+ELSE()
+    SET(BUILD_SHARED_LIBS 1)
+ENDIF()
+
 #
 # Set list of prerequisites
 # =========================
index 29755fb0709b63a5cf6eb9c9a148037b8a29e7e5..a3ce570f360af15b0c4961c74b5fd64f4421f9a3 100644 (file)
@@ -74,7 +74,7 @@ IF(NOT WIN32)
   SET(PLATFORM_MMAP "-D_POSIX_MAPPED_FILES")
 ENDIF(NOT WIN32)
 
-ADD_LIBRARY(interpkernel SHARED ${interpkernel_SOURCES})
+ADD_LIBRARY(interpkernel ${interpkernel_SOURCES})
 SET_TARGET_PROPERTIES(interpkernel PROPERTIES COMPILE_FLAGS "${PLATFORM_MMAP}")
 TARGET_LINK_LIBRARIES(interpkernel ${PLATFORM_LIBS})
 INSTALL(TARGETS interpkernel EXPORT ${PROJECT_NAME}TargetGroup DESTINATION ${MEDCOUPLING_INSTALL_LIBS})
index a8acafd7c1ec47affa9c9d7343d96feeb42a8bf2..40d2922a3c8da87a16d0e2f5b5196e0989482ba9 100644 (file)
@@ -85,8 +85,8 @@ IF(NOT MEDCOUPLING_MICROMED)
   INSTALL(TARGETS PerfTest DESTINATION ${MEDCOUPLING_INSTALL_BINS})
 ENDIF(NOT MEDCOUPLING_MICROMED)
 
-ADD_LIBRARY(InterpKernelTestUtils SHARED ${InterpKernelTestUtils_SOURCES})
-ADD_LIBRARY(InterpKernelTest SHARED ${InterpKernelTest_SOURCES})
+ADD_LIBRARY(InterpKernelTestUtils ${InterpKernelTestUtils_SOURCES})
+ADD_LIBRARY(InterpKernelTest ${InterpKernelTest_SOURCES})
 
 SET(InterpKernelTest_LIBS medcoupling interpkernel ${CPPUNIT_LIBRARIES})
 IF(NOT MEDCOUPLING_MICROMED)
index 61aae93d75cbb12fba244ea124fa4ad2d36dc13e..6a49d3a074d761d96d4b8c2a6e788feea22f0fc4 100644 (file)
@@ -66,11 +66,11 @@ SET(medcouplingremapper_SOURCES
   MEDCouplingRemapper.cxx
   )
 
-ADD_LIBRARY(medcoupling SHARED ${medcoupling_SOURCES})
+ADD_LIBRARY(medcoupling ${medcoupling_SOURCES})
 TARGET_LINK_LIBRARIES(medcoupling interpkernel)
 INSTALL(TARGETS medcoupling EXPORT ${PROJECT_NAME}TargetGroup DESTINATION ${MEDCOUPLING_INSTALL_LIBS})
 
-ADD_LIBRARY(medcouplingremapper SHARED ${medcouplingremapper_SOURCES})
+ADD_LIBRARY(medcouplingremapper ${medcouplingremapper_SOURCES})
 TARGET_LINK_LIBRARIES(medcouplingremapper medcoupling)
 INSTALL(TARGETS medcouplingremapper EXPORT ${PROJECT_NAME}TargetGroup DESTINATION ${MEDCOUPLING_INSTALL_LIBS})
 
index e62575173c4dd48c36c9debe71477336d0fdcaa9..6d0ed57c660c19c23fb785c75b8514caa8365428 100644 (file)
@@ -73,7 +73,7 @@ SET(medloader_SOURCES
   SauvWriter.cxx
   )
 
-ADD_LIBRARY(medloader SHARED ${medloader_SOURCES})
+ADD_LIBRARY(medloader ${medloader_SOURCES})
 SET_TARGET_PROPERTIES(medloader PROPERTIES COMPILE_FLAGS "")
 TARGET_LINK_LIBRARIES(medloader medcoupling ${MEDFILE_C_LIBRARIES} ${HDF5_LIBRARIES} ${MEDLOADER_XDR_LIBRARIES})
 INSTALL(TARGETS medloader EXPORT ${PROJECT_NAME}TargetGroup DESTINATION ${MEDCOUPLING_INSTALL_LIBS})
index f7c7f874f119d21bb7ba1c220294c6779c1a0e4b..981fc949a665b79b15db1f88c9cdcf87bc0c366c 100644 (file)
@@ -136,7 +136,7 @@ ENDIF(${MEDCOUPLING_USE_MPI})
 
 ADD_DEFINITIONS(${medpartitionercpp_DEFINITIONS})
 
-ADD_LIBRARY(medpartitionercpp SHARED ${medpartitionercpp_SOURCES})
+ADD_LIBRARY(medpartitionercpp ${medpartitionercpp_SOURCES})
 TARGET_LINK_LIBRARIES(medpartitionercpp ${medpartitionercpp_LDFLAGS} ${PLATFORM_LIBS} ${PTHREAD_LIBS})
 INSTALL(TARGETS medpartitionercpp DESTINATION ${MEDCOUPLING_INSTALL_LIBS})
 
index 778abe997a86d929530321e2d32f25dfc532446e..37151c4827c9e693a7834219a5485b93878cf278 100644 (file)
@@ -41,7 +41,7 @@ IF(MEDCOUPLING_USE_MPI)
   ENDIF(MEDCOUPLING_PARTITIONER_PARMETIS)
 ENDIF(MEDCOUPLING_USE_MPI)
 
-ADD_LIBRARY(MEDPARTITIONERTest SHARED ${MEDPARTITIONERTest_SOURCES})
+ADD_LIBRARY(MEDPARTITIONERTest ${MEDPARTITIONERTest_SOURCES})
 TARGET_LINK_LIBRARIES(MEDPARTITIONERTest ${MEDPARTITIONERTest_LDFLAGS})
 INSTALL(TARGETS MEDPARTITIONERTest DESTINATION ${MEDCOUPLING_INSTALL_LIBS})
 
index 9a3ca9264baa65d316645bce0a74c16d6d30103d..46753e9a96a61ba2c707c23be5c1d126b12bf626 100644 (file)
@@ -41,7 +41,7 @@ SET(paramedloader_SOURCES
   ParaMEDFileMesh.cxx
   )
 
-ADD_LIBRARY(paramedloader SHARED ${paramedloader_SOURCES})
+ADD_LIBRARY(paramedloader ${paramedloader_SOURCES})
 TARGET_LINK_LIBRARIES(paramedloader paramedmem medloader ${PLATFORM_LIBS})
 INSTALL(TARGETS paramedloader EXPORT ${PROJECT_NAME}TargetGroup DESTINATION ${MEDCOUPLING_INSTALL_LIBS})
 
index 519e367761f2dce34801e6e6a82c4e92d71093e8..dfa8c13a195810d07a059c349ac7ec7d4c4c0547 100644 (file)
@@ -61,7 +61,7 @@ SET(paramedmem_SOURCES
   ExplicitMapping.cxx
   )
 
-ADD_LIBRARY(paramedmem SHARED ${paramedmem_SOURCES})
+ADD_LIBRARY(paramedmem ${paramedmem_SOURCES})
 TARGET_LINK_LIBRARIES(paramedmem medcoupling ${MPI_LIBRARIES})
 INSTALL(TARGETS paramedmem EXPORT ${PROJECT_NAME}TargetGroup DESTINATION ${MEDCOUPLING_INSTALL_LIBS})
 
index 789f24c048652879c19aa3284d94f25e8c54b3c3..0376fb2eb79c507d5efdc60f49e9b60114ab1eaf 100644 (file)
@@ -66,7 +66,7 @@ SET(ParaMEDMEMTest_SOURCES
   test_MPI_Access_ISend_IRecv_BottleNeck.cxx
   )
 
-ADD_LIBRARY(ParaMEDMEMTest SHARED ${ParaMEDMEMTest_SOURCES})
+ADD_LIBRARY(ParaMEDMEMTest ${ParaMEDMEMTest_SOURCES})
 SET_TARGET_PROPERTIES(ParaMEDMEMTest PROPERTIES COMPILE_FLAGS "")
 TARGET_LINK_LIBRARIES(ParaMEDMEMTest paramedmem paramedloader medcouplingremapper InterpKernelTestUtils ${CPPUNIT_LIBRARIES})
 INSTALL(TARGETS ParaMEDMEMTest DESTINATION ${MEDCOUPLING_INSTALL_LIBS})
index 47a343470242f151b3e4c8f0532f20ffed93b580..d260bf274d8c76d7726bd2eb9488679bd1dabe7f 100644 (file)
@@ -88,7 +88,7 @@ SET_TARGET_PROPERTIES(renumber PROPERTIES COMPILE_FLAGS "${renumber_DEFINITIONS}
 TARGET_LINK_LIBRARIES(renumber renumbercpp)
 INSTALL(TARGETS renumber DESTINATION ${MEDCOUPLING_INSTALL_BINS})
 
-ADD_LIBRARY(renumbercpp SHARED ${renumbercpp_SOURCES})
+ADD_LIBRARY(renumbercpp ${renumbercpp_SOURCES})
 SET_TARGET_PROPERTIES(renumbercpp PROPERTIES COMPILE_FLAGS "${renumber_DEFINITIONS}")
 TARGET_LINK_LIBRARIES(renumbercpp ${renumbercpp_LDFLAGS})
 INSTALL(TARGETS renumbercpp DESTINATION ${MEDCOUPLING_INSTALL_LIBS})