Logo AND Algorithmique Numérique Distribuée

Public GIT Repository
Add option enable_lib_static for compile libsimgrid.a and libsmpi.a
authornavarrop <navarrop@48e7efb5-ca39-0410-a469-dd3cf9ba447f>
Tue, 16 Nov 2010 10:10:59 +0000 (10:10 +0000)
committernavarrop <navarrop@48e7efb5-ca39-0410-a469-dd3cf9ba447f>
Tue, 16 Nov 2010 10:10:59 +0000 (10:10 +0000)
git-svn-id: svn+ssh://scm.gforge.inria.fr/svn/simgrid/simgrid/trunk@8563 48e7efb5-ca39-0410-a469-dd3cf9ba447f

buildtools/Cmake/Distrib.cmake
buildtools/Cmake/MakeExeLib.cmake
buildtools/Cmake/Option.cmake
buildtools/Cmake/PrintArgs.cmake

index fdafa18..a725b96 100644 (file)
@@ -38,7 +38,16 @@ install(TARGETS simgrid gras
 if(enable_smpi)        
   install(TARGETS smpi
           DESTINATION $ENV{DESTDIR}${prefix}/lib/)
-endif(enable_smpi)     
+endif(enable_smpi)
+
+if(enable_lib_static)
+       install(TARGETS simgrid_static 
+               DESTINATION $ENV{DESTDIR}${prefix}/lib/)
+       if(enable_smpi) 
+               install(TARGETS smpi_static
+                       DESTINATION $ENV{DESTDIR}${prefix}/lib/)
+       endif(enable_smpi)
+endif(enable_lib_static)
 
 # include files
 foreach(file ${install_HEADERS})
index d3e0822..10c9e31 100644 (file)
@@ -5,14 +5,19 @@ if(enable_supernovae)
 else(enable_supernovae)        
        add_library(simgrid SHARED ${simgrid_sources})
        add_library(gras SHARED ${gras_sources})
+       if(enable_lib_static)
+               add_library(simgrid_static STATIC ${simgrid_sources})   
+       endif(enable_lib_static)
        if(enable_smpi)
                add_library(smpi SHARED ${SMPI_SRC})
+               if(enable_lib_static)
+                       add_library(smpi_static STATIC ${SMPI_SRC})     
+               endif(enable_lib_static)
        endif(enable_smpi)
 endif(enable_supernovae)
 
 set_target_properties(simgrid PROPERTIES VERSION ${libsimgrid_version})
 set_target_properties(gras PROPERTIES VERSION ${libgras_version})
-
 if(enable_smpi)
        set_target_properties(smpi PROPERTIES VERSION ${libsmpi_version})
 endif(enable_smpi)
@@ -90,14 +95,22 @@ endif(HAVE_POSIX_GETTIME)
 
 target_link_libraries(simgrid  ${SIMGRID_DEP})
 target_link_libraries(gras     ${GRAS_DEP})
-
 add_dependencies(gras maintainer_files)
-add_dependencies(simgrid maintainer_files)
-                               
+add_dependencies(simgrid maintainer_files)                             
 if(enable_smpi)
        target_link_libraries(smpi      simgrid ${SMPI_DEP})
 endif(enable_smpi)
 
+if(enable_lib_static)
+       target_link_libraries(simgrid_static    ${SIMGRID_DEP})
+       add_dependencies(simgrid_static maintainer_files)
+       set_target_properties(simgrid_static PROPERTIES OUTPUT_NAME simgrid)
+       if(enable_smpi)
+               target_link_libraries(smpi_static       simgrid ${SMPI_DEP})
+               set_target_properties(smpi_static PROPERTIES OUTPUT_NAME smpi)
+       endif(enable_smpi)
+endif(enable_lib_static)
+
 ### Make EXEs
 
 #src/testall
index 807a776..fff78d3 100644 (file)
@@ -39,6 +39,7 @@ option(enable_coverage "Enable coverage." off)
 option(enable_memcheck "Enable memcheck." off)
 option(enable_print_message "Enable print message during config." off)
 option(enable_model-checking "" off)
+option(enable_lib_static "" off)
 
 if(WIN32) #actually not enable with windows
        message("Mode supernovae and maintainer disable with Windows.")
@@ -89,3 +90,4 @@ mark_as_advanced(SED_EXE)
 mark_as_advanced(SVN)
 mark_as_advanced(GIT)
 mark_as_advanced(VALGRIND_PATH)
+mark_as_advanced(PATH_PCRE_H)
\ No newline at end of file
index 0ce6775..8003675 100644 (file)
@@ -170,6 +170,7 @@ message("   Compile Java   :        ${HAVE_JAVA}")
 message("      Compile Lua    :        ${HAVE_LUA}")
 message("      Compile Ruby   :        ${HAVE_RUBY}")
 message("      Compile Smpi   :        ${enable_smpi}")
+message("      Compile Static :        ${enable_lib_static}")
 message("")
 message("      Maintainer mode:        ${enable_maintainer_mode}")
 message("      Supernovae mode:        ${enable_supernovae}")