### Make Libs
#>gcc c:\simgrid-trunk\examples\msg\icomms\peer.c -static -Lc:\simgrid-trunk\lib -lsimgrid -Ic:\simgrid-trunk\include -lwsock32
+
+if(enable_java)
+ include(${CMAKE_HOME_DIRECTORY}/buildtools/Cmake/MakeJava.cmake)
+endif()
+
add_library(simgrid SHARED ${simgrid_sources})
-add_library(gras SHARED ${gras_sources})
-set_target_properties(gras PROPERTIES COMPILE_FLAGS "-D_XBT_DLL_EXPORT -DDLL_EXPORT" VERSION ${libgras_version} OUTPUT_NAME "gras")
-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} PREFIX "lib" SUFFIX ".dll" IMPORT_PREFIX "lib" IMPORT_SUFFIX ".dll")
+
# libpthreadGC2.dll
if(ARCH_32_BITS)
$ENV{PATH}
PATH_SUFFIXES bin/ c/bin
)
-else(ARCH_32_BITS)
+else()
find_library(PATH_PTHREAD_LIB
NAMES pthreadGC2-w64.dll
HINTS
$ENV{PATH}
PATH_SUFFIXES bin/ c/bin
)
-endif(ARCH_32_BITS)
+endif()
+
+set(SIMGRID_DEP "-lws2_32 -L${PATH_PTHREAD_LIB} -lm -lpthreadGC2")
-set(GRAS_DEP "ws2_32 ${PATH_PTHREAD_LIB}")
-set(SIMGRID_DEP "ws2_32 ${PATH_PCRE_LIB} ${PATH_PTHREAD_LIB}")
if(ARCH_32_BITS)
- set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -m32 -march=i486")
-else(ARCH_32_BITS)
- set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -m64")
+ set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -m32 -march=i486 -D_I_X86_")
+ set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -m32 -march=i486 -D_I_X86_")
+else()
+ set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -m64 -D_AMD64_")
+ set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -m64 -D_AMD64_")
# message(FATAL_ERROR "Sorry, Simgrid fails with full 64bits for now! Please contact us.")
-endif(ARCH_32_BITS)
+endif()
-target_link_libraries(gras ${GRAS_DEP})
target_link_libraries(simgrid ${SIMGRID_DEP})
find_path(PEXPORTS_PATH NAMES pexports.exe PATHS NO_DEFAULT_PATHS)
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)
-endif(PEXPORTS_PATH)
\ No newline at end of file
+endif()