Logo AND Algorithmique Numérique Distribuée

Public GIT Repository
Rename libsimgrid.dll for libsimgrid_shared.dll
[simgrid.git] / buildtools / Cmake / MakeLibWin.cmake
1 ### Make Libs\r
2 #>gcc c:\simgrid-trunk\examples\msg\icomms\peer.c -static -Lc:\simgrid-trunk\lib -lsimgrid -Ic:\simgrid-trunk\include -lwsock32 \r
3 add_library(simgrid STATIC ${simgrid_sources})\r
4 add_library(simgrid_shared SHARED ${simgrid_sources})\r
5 add_library(gras STATIC ${gras_sources})\r
6 \r
7 set_target_properties(gras            PROPERTIES COMPILE_FLAGS "-D_XBT_DLL_STATIC -DDLL_STATIC" VERSION ${libgras_version}    OUTPUT_NAME "gras")\r
8 set_target_properties(simgrid         PROPERTIES COMPILE_FLAGS "-D_XBT_DLL_STATIC -DDLL_STATIC" VERSION ${libsimgrid_version} OUTPUT_NAME "simgrid")\r
9 set_target_properties(simgrid_shared  PROPERTIES COMPILE_FLAGS "-D_XBT_DLL_EXPORT -DDLL_EXPORT" VERSION ${libsimgrid_version} OUTPUT_NAME "simgrid_shared")\r
10 \r
11 set(GRAS_DEP "ws2_32 -lpthread")\r
12 set(SIMGRID_DEP "ws2_32 -lpcre -lpthread")\r
13 set(SIMGRID_SHARED_DEP "ws2_32 -lpthread")\r
14 \r
15 if(ARCH_32_BITS)\r
16     set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -m32 -march=i486")\r
17 else(ARCH_32_BITS)\r
18         message(FATAL_ERROR "Sorry, Simgrid fails with full 64bits for now! Please contact us.")\r
19 endif(ARCH_32_BITS)\r
20 \r
21 target_link_libraries(gras      ${GRAS_DEP})\r
22 target_link_libraries(simgrid   ${SIMGRID_DEP})\r
23 target_link_libraries(simgrid_shared ${SIMGRID_SHARED_DEP} ${PATH_PCRE_LIB})\r
24 \r
25 find_path(PEXPORTS_PATH NAMES pexports.exe PATHS NO_DEFAULT_PATHS)\r
26 message(STATUS "pexports: ${PEXPORTS_PATH}")\r
27 if(PEXPORTS_PATH)\r
28 add_custom_command(TARGET simgrid_shared POST_BUILD\r
29 COMMAND ${PEXPORTS_PATH}/pexports.exe ${CMAKE_BINARY_DIR}/lib/libsimgrid_shared.dll > ${CMAKE_BINARY_DIR}/lib/libsimgrid_shared.ref)\r
30 endif(PEXPORTS_PATH)