-
Notifications
You must be signed in to change notification settings - Fork 6
/
CMakeLists.txt
42 lines (30 loc) · 1.02 KB
/
CMakeLists.txt
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
cmake_minimum_required(VERSION 3.0)
project(Jamoma)
####### PREREQUISITES
message(STATUS "Updating Git Submodules")
execute_process(
COMMAND git submodule update --init --recursive
WORKING_DIRECTORY "${PROJECT_SOURCE_DIR}"
)
####### EXAMPLES
add_subdirectory(src/filtered-noise-example)
####### UNIT TESTS
# Macro from http://stackoverflow.com/questions/7787823/cmake-how-to-get-the-name-of-all-subdirectories-of-a-directory
MACRO(SUBDIRLIST result curdir)
FILE(GLOB children RELATIVE ${curdir} ${curdir}/*)
SET(dirlist "")
FOREACH(child ${children})
IF(IS_DIRECTORY ${curdir}/${child})
LIST(APPEND dirlist ${child})
ENDIF()
ENDFOREACH()
SET(${result} ${dirlist})
ENDMACRO()
enable_testing()
SUBDIRLIST(TESTDIRS ${CMAKE_CURRENT_SOURCE_DIR}/test)
foreach(testdir ${TESTDIRS})
MESSAGE("Generating Unit Test: ${testdir}")
add_subdirectory(${CMAKE_CURRENT_SOURCE_DIR}/test/${testdir})
add_test(NAME ${testdir}
COMMAND ${CMAKE_CURRENT_BINARY_DIR}/test/${testdir}/${testdir}.test)
endforeach()