summaryrefslogtreecommitdiff
path: root/CMakeLists.txt
diff options
context:
space:
mode:
authorJohn Glover <j@johnglover.net>2013-01-11 17:44:05 +0100
committerJohn Glover <j@johnglover.net>2013-01-11 17:44:05 +0100
commitad704b5e9c985765e14eb38a0922e702b8bfc25a (patch)
treea1aa9e55e4df46c1f30ec33d301370ae44b7f1af /CMakeLists.txt
parent971a93d0676914837cdef22afa26f020b7be9041 (diff)
downloadsimpl-ad704b5e9c985765e14eb38a0922e702b8bfc25a.tar.gz
simpl-ad704b5e9c985765e14eb38a0922e702b8bfc25a.tar.bz2
simpl-ad704b5e9c985765e14eb38a0922e702b8bfc25a.zip
[tests] Tidy up test C++ tests.
All tests can now be run from a single executable called 'tests' (created in the build directory).
Diffstat (limited to 'CMakeLists.txt')
-rw-r--r--CMakeLists.txt31
1 files changed, 13 insertions, 18 deletions
diff --git a/CMakeLists.txt b/CMakeLists.txt
index 41cfb0a..f8e1877 100644
--- a/CMakeLists.txt
+++ b/CMakeLists.txt
@@ -39,24 +39,19 @@ install(FILES ${include_files} DESTINATION include/simpl)
# Tests
# ----------------------------------------------------------------------------
if(BUILD_TESTS)
- set(test_base_src ${source_files} tests/test_base.cpp)
- set(test_peak_detection_src ${source_files}
- tests/test_peak_detection.cpp)
- set(test_partial_tracking_src ${source_files}
- tests/test_partial_tracking.cpp)
- set(test_synthesis_src ${source_files} tests/test_synthesis.cpp)
-
- LIST(APPEND libs cppunit sndfile)
-
- add_executable(test_base ${test_base_src})
- add_executable(test_peak_detection ${test_peak_detection_src})
- add_executable(test_partial_tracking ${test_partial_tracking_src})
- add_executable(test_synthesis ${test_synthesis_src})
-
- target_link_libraries(test_base ${libs})
- target_link_libraries(test_peak_detection ${libs})
- target_link_libraries(test_partial_tracking ${libs})
- target_link_libraries(test_synthesis ${libs})
+ add_library(simpl_static STATIC ${source_files})
+ list(APPEND libs simpl_static cppunit sndfile)
+
+ include_directories(tests)
+
+ set(test_src tests/tests.cpp
+ tests/test_base.cpp
+ tests/test_peak_detection.cpp
+ tests/test_partial_tracking.cpp
+ tests/test_synthesis.cpp)
+
+ add_executable(tests ${test_src})
+ target_link_libraries(tests ${libs})
else()
message("Not building tests. To change run CMake with -D BUILD_TESTS=yes")
endif()