CMakeLists.txt 1.79 KB
Newer Older
1
cmake_minimum_required(VERSION 2.8)
2
3
4
5
6
7
8
9
project(libplatform-tests)
set(CMAKE_INSTALL_PREFIX "..")
set(CMAKE_SKIP_RPATH true)

if ("$ENV{TAPASCO_HOME}" STREQUAL "")
  message(FATAL_ERROR "Please set env var TAPASCO_HOME to root directory of Tapasco.")
endif ("$ENV{TAPASCO_HOME}" STREQUAL "")

10
include ("$ENV{TAPASCO_HOME}/cmake/Tapasco.cmake")
11

12
include_directories(${TAPASCO_INCDIRS})
Jens Korinth's avatar
Jens Korinth committed
13
link_directories(${TAPASCO_STATICLINKDIRS})
14

15
add_executable(platform-stress-alloc platform_stress_alloc.c ${TAPASCO_PLATFORM_LIB})
Jens Korinth's avatar
Jens Korinth committed
16
17
18
19
20
21
set_target_properties(platform-stress-alloc PROPERTIES LINK_SEARCH_START_STATIC 1 LINK_SEARCH_END_STATIC 1)
target_link_libraries(platform-stress-alloc m platform atomic pthread)

add_executable(platform-stress-ioctl platform_stress_ioctl.c ${TAPASCO_PLATFORM_LIB})
set_target_properties(platform-stress-ioctl PROPERTIES LINK_SEARCH_START_STATIC 1 LINK_SEARCH_END_STATIC 1)
target_link_libraries(platform-stress-ioctl m platform atomic pthread)
22

23
24
25
26
add_executable(platform-alloc platform_alloc.c ${TAPASCO_PLATFORM_LIB})
set_target_properties(platform-alloc PROPERTIES LINK_SEARCH_START_STATIC 1 LINK_SEARCH_END_STATIC 1)
target_link_libraries(platform-alloc m platform atomic pthread)

27
add_executable(platform-slots platform_slots.c ${TAPASCO_PLATFORM_LIB})
28
target_link_libraries(platform-slots m platform atomic pthread)
29
30

add_executable(iplatform iplatform.c)
31
target_link_libraries(iplatform m platform atomic pthread ncurses ${TAPASCO_PLATFORM_LIB})
32

Jens Korinth's avatar
Jens Korinth committed
33
34
set_target_properties(platform-stress-alloc platform-stress-ioctl platform-slots iplatform PROPERTIES COMPILE_FLAGS ${TAPASCO_CFLAGS})
set_target_properties(platform-stress-alloc platform-stress-ioctl platform-slots iplatform PROPERTIES LINKER_FLAGS ${TAPASCO_LDFLAGS})
35
install(TARGETS platform-stress-alloc platform-slots
36
        RUNTIME DESTINATION bin/${TAPASCO_TARGET})