Logo AND Algorithmique Numérique Distribuée

Public GIT Repository
Merge branch 's4u_enforce' into 'master'
[simgrid.git] / examples / sthread / CMakeLists.txt
1 set(THREADS_PREFER_PTHREAD_FLAG ON)
2 find_package(Threads REQUIRED)
3
4 # Regular pthread examples: test the interceptor of the pthread interface
5 #########################################################################
6
7 foreach(x
8         mutex-simple)
9
10   if("${CMAKE_SYSTEM}" MATCHES "Linux")
11     add_executable       (pthread-${x} EXCLUDE_FROM_ALL pthread-${x}.c)
12     set_target_properties(pthread-${x} PROPERTIES RUNTIME_OUTPUT_DIRECTORY ${CMAKE_CURRENT_BINARY_DIR})
13     target_link_libraries(pthread-${x} PRIVATE Threads::Threads)
14
15     add_dependencies(tests pthread-${x})
16   endif()
17
18 #  set(tesh_files    ${tesh_files}    ${CMAKE_CURRENT_SOURCE_DIR}/pthread-${x}.tesh)
19   set(examples_src  ${examples_src}  ${CMAKE_CURRENT_SOURCE_DIR}/pthread-${x}.c)
20 endforeach()
21
22 # Regular sthread examples: test the internal interface for debugging purpose
23 #############################################################################
24
25 foreach(x
26         mutex-simple)
27   if("${CMAKE_SYSTEM}" MATCHES "Linux")
28     add_executable       (sthread-${x} EXCLUDE_FROM_ALL sthread-${x}.c)
29     set_target_properties(sthread-${x} PROPERTIES RUNTIME_OUTPUT_DIRECTORY ${CMAKE_CURRENT_BINARY_DIR})
30     target_link_libraries(sthread-${x} sthread)
31     set_property(TARGET sthread-${x} APPEND PROPERTY INCLUDE_DIRECTORIES "${INTERNAL_INCLUDES}")
32     add_dependencies(tests sthread-${x})
33   endif()
34
35 #  set(tesh_files    ${tesh_files}    ${CMAKE_CURRENT_SOURCE_DIR}/sthread-${x}.tesh)
36   set(examples_src  ${examples_src}  ${CMAKE_CURRENT_SOURCE_DIR}/sthread-${x}.c)
37 endforeach()
38
39
40 # Add all extra files to the archive
41 ####################################
42
43 set(tesh_files    ${tesh_files}     PARENT_SCOPE)
44 set(bin_files     ${bin_files}      PARENT_SCOPE)
45 set(examples_src  ${examples_src}   PARENT_SCOPE)
46 set(xml_files     ${xml_files}      PARENT_SCOPE)
47
48