Logo AND Algorithmique Numérique Distribuée

Public GIT Repository
Don't build smpi in a separate library anymore.
[simgrid.git] / teshsuite / smpi / mpich-test / context / CMakeLists.txt
1 cmake_minimum_required(VERSION 2.6)
2
3 if(enable_smpi)
4
5   if(WIN32)
6     set(CMAKE_C_FLAGS "-include ${CMAKE_HOME_DIRECTORY}/include/smpi/smpi_main.h")
7   else()
8     set(CMAKE_C_COMPILER "${CMAKE_BINARY_DIR}/smpi_script/bin/smpicc")
9     set(CMAKE_Fortran_COMPILER "${CMAKE_BINARY_DIR}/smpi_script/bin/smpiff")
10     set(CMAKE_Fortran_LINKER "${CMAKE_BINARY_DIR}/smpi_script/bin/smpicc")
11   endif()
12   
13   set(EXECUTABLE_OUTPUT_PATH "${CMAKE_CURRENT_BINARY_DIR}")
14   set(MPICH_FLAGS "-DHAVE_STDLIB_H=1 -DHAVE_UNISTD_H=1 -DHAVE_STRING_H=1 -DUSE_STDARG=1 -DHAVE_LONG_DOUBLE=1 -DHAVE_PROTOTYPES=1 -DHAVE_SIGNAL_H=1 -DHAVE_SIGACTION=1 -DHAVE_SLEEP=1 -DHAVE_SYSCONF=1")
15
16   include_directories("${CMAKE_HOME_DIRECTORY}/include/smpi")
17   
18   add_executable(attrerr attrerr.c test.c)
19  # add_executable(attrt attrt.c test.c)
20  # add_executable(commnames commnames.c)
21   add_executable(groupcreate groupcreate.c)
22   add_executable(grouptest_mpich grouptest.c)
23   add_executable(icdup icdup.c)
24   add_executable(ictest ictest.c )
25   add_executable(ictest2 ictest2.c)
26   add_executable(ictest3 ictest3.c)
27   
28   if(SMPI_F2C)
29   #add_executable(attrtest_f attrtest.f)
30   #add_executable(commnames_f commnamesf.f)
31   endif()
32
33   target_link_libraries(attrerr simgrid)
34  # target_link_libraries(attrt simgrid)
35  # target_link_libraries(commnames simgrid)
36   target_link_libraries(groupcreate simgrid)
37   target_link_libraries(grouptest_mpich simgrid)
38   target_link_libraries(icdup simgrid)
39   target_link_libraries(ictest simgrid)
40   target_link_libraries(ictest2 simgrid)
41   target_link_libraries(ictest3 simgrid)
42
43   if(SMPI_F2C)
44   #target_link_libraries(attrtest_f simgrid f2c)
45   #target_link_libraries(commnames_f simgrid f2c)
46   endif()
47   
48   set_target_properties(attrerr PROPERTIES COMPILE_FLAGS "${MPICH_FLAGS}")
49  # set_target_properties(attrt PROPERTIES COMPILE_FLAGS "${MPICH_FLAGS}")
50  # set_target_properties(commnames PROPERTIES COMPILE_FLAGS "${MPICH_FLAGS}")
51   set_target_properties(groupcreate PROPERTIES COMPILE_FLAGS "${MPICH_FLAGS}")
52   set_target_properties(grouptest_mpich PROPERTIES COMPILE_FLAGS "${MPICH_FLAGS}")
53   set_target_properties(icdup PROPERTIES COMPILE_FLAGS "${MPICH_FLAGS}")
54   set_target_properties(ictest PROPERTIES COMPILE_FLAGS "${MPICH_FLAGS}")
55   set_target_properties(ictest2 PROPERTIES COMPILE_FLAGS "${MPICH_FLAGS}")
56   set_target_properties(ictest3 PROPERTIES COMPILE_FLAGS "${MPICH_FLAGS}")
57  
58  
59    if(SMPI_F2C)
60   #set_target_properties(commnames_f PROPERTIES COMPILE_FLAGS "${MPICH_FLAGS}" )
61   #set_target_properties(attrtest_f PROPERTIES COMPILE_FLAGS "${MPICH_FLAGS}"  )
62   endif()
63
64 endif()
65
66 set(tesh_files
67   ${tesh_files}
68   PARENT_SCOPE
69   )
70 set(xml_files
71   ${xml_files}
72   PARENT_SCOPE
73   )
74 set(examples_src
75   ${examples_src}
76   ${CMAKE_CURRENT_SOURCE_DIR}/test.c
77   ${CMAKE_CURRENT_SOURCE_DIR}/attrerr.c
78  # ${CMAKE_CURRENT_SOURCE_DIR}/attrt.c
79  # ${CMAKE_CURRENT_SOURCE_DIR}/commnames.c
80   ${CMAKE_CURRENT_SOURCE_DIR}/groupcreate.c
81   ${CMAKE_CURRENT_SOURCE_DIR}/grouptest.c
82   ${CMAKE_CURRENT_SOURCE_DIR}/icdup.c
83   ${CMAKE_CURRENT_SOURCE_DIR}/ictest.c
84   ${CMAKE_CURRENT_SOURCE_DIR}/ictest2.c
85   ${CMAKE_CURRENT_SOURCE_DIR}/ictest3.c
86   ${CMAKE_CURRENT_SOURCE_DIR}/attrtest.f
87   ${CMAKE_CURRENT_SOURCE_DIR}/commnamesf.f
88   ${CMAKE_CURRENT_SOURCE_DIR}/test.h
89   PARENT_SCOPE
90   )
91 set(bin_files
92   ${bin_files}
93   PARENT_SCOPE
94   )
95 set(txt_files
96   ${txt_files}
97   ${CMAKE_CURRENT_SOURCE_DIR}/runtests
98   ${CMAKE_CURRENT_SOURCE_DIR}/attrt.std
99   ${CMAKE_CURRENT_SOURCE_DIR}/attrerr.std
100   ${CMAKE_CURRENT_SOURCE_DIR}/context.std
101   ${CMAKE_CURRENT_SOURCE_DIR}/commnames.std
102   PARENT_SCOPE
103   )