Logo AND Algorithmique Numérique Distribuée

Public GIT Repository
several changes in the way cmake handles windows
authorAugustin Degomme <degomme@idpann.imag.fr>
Tue, 5 Feb 2013 17:19:27 +0000 (18:19 +0100)
committerAugustin Degomme <degomme@idpann.imag.fr>
Mon, 11 Feb 2013 15:19:33 +0000 (16:19 +0100)
buildtools/Cmake/MakeLibWin.cmake

index cc30280..ae9dd23 100644 (file)
@@ -2,7 +2,7 @@
 #>gcc c:\simgrid-trunk\examples\msg\icomms\peer.c -static -Lc:\simgrid-trunk\lib -lsimgrid -Ic:\simgrid-trunk\include -lwsock32
 add_library(simgrid SHARED ${simgrid_sources})
 
-set_target_properties(simgrid  PROPERTIES COMPILE_FLAGS "-D_XBT_DLL_EXPORT -DDLL_EXPORT" VERSION ${libsimgrid_version} OUTPUT_NAME "simgrid")
+set_target_properties(simgrid  PROPERTIES COMPILE_FLAGS "-D_XBT_DLL_EXPORT -DDLL_EXPORT" LINK_FLAGS "-shared" VERSION ${libsimgrid_version} OUTPUT_NAME "simgrid" IMPORT_PREFIX "lib" IMPORT_SUFFIX ".dll")
 
 
 # libpthreadGC2.dll
@@ -22,8 +22,9 @@ else()
     )
 endif()
 
-set(SIMGRID_DEP "ws2_32 -pthread -lpcre")
-set(SMPI_DEP "${LIBRARY_OUTPUT_PATH}/libsimgrid.dll")
+set(SIMGRID_DEP "-lws2_32 -L${PATH_PCRE_LIB} -L${PATH_PTHREAD_LIB} -lm -lpcre -lpthreadGC2")
+
+#set(SMPI_DEP "${LIBRARY_OUTPUT_PATH}/libsimgrid.dll")
 
 if(ARCH_32_BITS)
   set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -m32 -march=i486")
@@ -32,19 +33,18 @@ else()
   #        message(FATAL_ERROR "Sorry, Simgrid fails with full 64bits for now! Please contact us.")
 endif()
 
-target_link_libraries(simgrid  ${SIMGRID_DEP} -lkernel32)
+target_link_libraries(simgrid  ${SIMGRID_DEP})
 
 find_path(PEXPORTS_PATH NAMES pexports.exe PATHS NO_DEFAULT_PATHS)
 message(STATUS "pexports: ${PEXPORTS_PATH}")
 if(PEXPORTS_PATH)
   add_custom_command(TARGET simgrid POST_BUILD
-    COMMAND ${PEXPORTS_PATH}/pexports.exe ${CMAKE_BINARY_DIR}/lib/libsimgrid.dll > ${CMAKE_BINARY_DIR}/lib/libsimgrid.def)
+    COMMAND ${PEXPORTS_PATH}/pexports.exe ${CMAKE_BINARY_DIR}/lib/simgrid.dll > ${CMAKE_BINARY_DIR}/lib/simgrid.def)
 endif()
 
 if(enable_smpi)
   add_library(smpi SHARED ${SMPI_SRC})
-  set_target_properties(smpi PROPERTIES VERSION ${libsmpi_version} OUTPUT_NAME "smpi")
-
-  set(SMPI_LDEP "")
-  target_link_libraries(smpi   simgrid ${SMPI_LDEP})
+  set_target_properties(smpi PROPERTIES COMPILE_FLAGS "-D_XBT_DLL_EXPORT -DDLL_EXPORT" LINK_FLAGS "-shared" VERSION ${libsmpi_version} OUTPUT_NAME "smpi" IMPORT_PREFIX "lib" IMPORT_SUFFIX ".dll")
+  add_dependencies(smpi simgrid)
+  target_link_libraries(smpi simgrid)
 endif()
\ No newline at end of file