Fixed two typos in the update news
[supercollider.git] / testsuite / supernova / CMakeLists.txt
blob0b362f7fa784d66d67d27834a41a4719bf75bf42
1 set(simple_tests
2     buffer_manager_test.cpp
3     callback_interpreter_system.cpp
4     memory-pool_test.cpp
5     osc_dispatcher_test.cpp
6     osc_server_test.cpp
7     server_dsp_thread_queue_test.cpp
8     server_dsp_thread_test.cpp
9     server_node_graph_test.cpp
10     server_scheduler_test.cpp
11     server_synth_factory_test.cpp
12     server_test.cpp
13     simple_pool_test.cpp
14     sized_array_test.cpp
15     sndfile_backend_test.cpp
16     static_pool_test.cpp
17     timetag_test.cpp
20 if(!APPLE)
21     set(simple_tests
22         ${simple_tests}
23         static_allocator_test.cpp
24         tl_allocator_test.cpp
25     )
26 endif()
28 if (CMAKE_SYSTEM_NAME MATCHES "Linux")
29     set(simple_tests ${simple_tests}
30         perf_counter_test.cpp
31     )
32 endif()
34 if(CMAKE_COMPILER_IS_GNUCXX OR CMAKE_COMPILER_IS_INTEL OR CMAKE_COMPILER_IS_CLANG)
35     set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -std=c++0x")
36 else()
37     message(FATAL_ERROR "unknown compiler. supernova testsuite cannot be compiled")
38 endif()
40 find_package(Sndfile REQUIRED)
42 include_directories(${CMAKE_SOURCE_DIR}/include/common
43                     ${CMAKE_SOURCE_DIR}/include/plugin_interface
44                     ${CMAKE_SOURCE_DIR}/include/server
45                     ${CMAKE_SOURCE_DIR}/server/supernova
46                     ${CMAKE_SOURCE_DIR}/external_libraries/boost
47                     ${CMAKE_SOURCE_DIR}/external_libraries/boost_endian
48                     ${CMAKE_SOURCE_DIR}/external_libraries/boost-lockfree
49                     ${CMAKE_SOURCE_DIR}/external_libraries/oscpack
50                     ${CMAKE_SOURCE_DIR}/external_libraries/
51                     ${CMAKE_SOURCE_DIR}/external_libraries/nova-tt
52                     ${CMAKE_SOURCE_DIR}/external_libraries/TLSF-2.4.6/src
53                     ${SNDFILE_INCLUDE_DIR}
54                     )
56 if (WIN32 OR APPLE)
57     find_package(Portaudio)
58     if(NOT PORTAUDIO_FOUND)
59         message(FATAL_ERROR "Portaudio missing")
60     endif()
61     add_definitions(-DPORTAUDIO_BACKEND ${PORTAUDIO_DEFINITIONS})
62     include_directories(${PORTAUDIO_INCLUDE_DIRS})
63 else()
64     find_library(JACK NAMES jack)
65     if (JACK)
66         add_definitions(-DJACK_BACKEND)
67         include_directories(${JACK_INCLUDE_DIRS})
68     endif()
69 endif()
72 add_library(boost_test STATIC boost_test.cpp)
74 # run simple tests
75 foreach(test ${simple_tests})
76   string(REPLACE .cpp "" test_name ${test} )
77   add_executable(${test_name} ${test})
79   if (Boost_FOUND)
80     target_link_libraries(${test_name}  ${Boost_THREAD_LIBRARY} ${Boost_SYSTEM_LIBRARY} ${Boost_TEST_LIBRARY})
81   else()
82     target_link_libraries(${test_name} boost_thread boost_system boost_test)
83   endif()
84   target_link_libraries(${test_name} oscpack tlsf)
85   target_link_libraries(${test_name} ${PTHREADS_LIBRARY})
86   target_link_libraries(${test_name} ${SNDFILE_LIBRARIES})
87   target_link_libraries(${test_name} libsupernova)
89   if(APPLE)
90     target_link_libraries(${test_name} "-framework CoreAudio")
91   endif()
93   add_test(${test_name}_run ${EXECUTABLE_OUTPUT_PATH}/${test_name})
94 endforeach(test)