Logo AND Algorithmique Numérique Distribuée

Public GIT Repository
Add a simgrid_java target to rebuild the jar file; look at the right location of...
[simgrid.git] / buildtools / Cmake / MakeExeLib.cmake
index 2c6745b..eb95771 100644 (file)
@@ -1,4 +1,12 @@
 ### Make Libs
+if(WIN32)
+  foreach(file ${simgrid_sources})
+    set_source_files_properties(${file} PROPERTIES COMPILE_FLAGS "/D DLL_EXPORT")
+  endforeach(file ${simgrid_sources})
+  foreach(file ${gras_sources})
+    set_source_files_properties(${file} PROPERTIES COMPILE_FLAGS "/D DLL_EXPORT")
+  endforeach(file ${gras_sources})
+endif(WIN32)
 
 if(enable_supernovae AND NOT WIN32)
        include(${PROJECT_DIRECTORY}/buildtools/Cmake/Supernovae.cmake)
@@ -17,19 +25,26 @@ if(enable_smpi)
        set_target_properties(smpi PROPERTIES VERSION ${libsmpi_version})
 endif(enable_smpi)
 
-
-set(GRAS_DEP "-lm -lpthread")
-set(SIMGRID_DEP "-lm")
-set(SMPI_DEP "")
-
 if(WIN32)
        set(GRAS_DEP "wsock32")
        set(SIMGRID_DEP "wsock32")
+else(WIN32)
+    set(GRAS_DEP "-lm -lpthread")
+    set(SIMGRID_DEP "-lm")
+    set(SMPI_DEP "")
 endif(WIN32)
 
 if(HAVE_RUBY)
        set(SIMGRID_DEP "${SIMGRID_DEP} -l${RUBY_LIBRARY_NAME} -module")
-       exec_program("${CMAKE_COMMAND} -E create_symlink ${CMAKE_BINARY_DIR}/lib/libsimgrid.so ${PROJECT_DIRECTORY}/src/bindings/ruby/libsimgrid.so" "${PROJECT_DIRECTORY}"  OUTPUT_VARIABLE LIEN_OK)
+       exec_program("${CMAKE_COMMAND} -E create_symlink ${CMAKE_BINARY_DIR}/lib/libsimgrid.so ${PROJECT_DIRECTORY}/src/bindings/ruby/libsimgrid.so" 
+                   "${PROJECT_DIRECTORY}"  
+                   OUTPUT_VARIABLE IGNORED)
+       
+       # Make sure this extra link will get cleaned
+        get_directory_property(extra_clean_files ADDITIONAL_MAKE_CLEAN_FILES)
+        set_directory_properties(
+           PROPERTIES
+           ADDITIONAL_MAKE_CLEAN_FILES "${extra_clean_files};${PROJECT_DIRECTORY}/src/bindings/ruby/libsimgrid.so")
 endif(HAVE_RUBY)
 
 if(CMAKE_SYSTEM_NAME MATCHES "Darwin")
@@ -49,7 +64,15 @@ endif(pthread)
 
 if(HAVE_LUA)
        SET(SIMGRID_DEP "${SIMGRID_DEP} -ldl -l${liblua}")
-       exec_program("${CMAKE_COMMAND} -E create_symlink ${CMAKE_BINARY_DIR}/lib/libsimgrid.so ${PROJECT_DIRECTORY}/examples/lua/simgrid.so" "${PROJECT_DIRECTORY}"  OUTPUT_VARIABLE LIEN_OK)
+       exec_program("${CMAKE_COMMAND} -E create_symlink ${CMAKE_BINARY_DIR}/lib/libsimgrid.so ${PROJECT_DIRECTORY}/examples/lua/simgrid.so" 
+                     "${PROJECT_DIRECTORY}"
+                     OUTPUT_VARIABLE IGNORED)
+                    
+       # Make sure this extra link will get cleaned
+        get_directory_property(extra_clean_files ADDITIONAL_MAKE_CLEAN_FILES)
+        set_directory_properties(
+           PROPERTIES
+           ADDITIONAL_MAKE_CLEAN_FILES "${extra_clean_files};${PROJECT_DIRECTORY}/examples/lua/simgrid.so")
 endif(HAVE_LUA)
 
 if(HAVE_GTNETS)