-
Notifications
You must be signed in to change notification settings - Fork 9
/
Copy pathCMakeLists.txt
42 lines (32 loc) · 1.12 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
# CMAkeLists.txt file for mumpi project
cmake_minimum_required(VERSION 2.8.9)
# Options. Turn on with 'cmake -Dvarname=ON'.
option(test "Build all tests." OFF) # makes boolean 'test' available
project(mumpi)
add_subdirectory("${PROJECT_SOURCE_DIR}/deps/mumlib")
if (CMAKE_VERSION VERSION_LESS "3.1")
if (CMAKE_CXX_COMPILER_ID STREQUAL "GNU")
set (CMAKE_CXX_FLAGS "--std=gnu++11 ${CMAKE_CXX_FLAGS}")
endif ()
else ()
set (CMAKE_CXX_STANDARD 11)
endif ()
set(CMAKE_EXPORT_COMPILE_COMMANDS 1)
# INCLUDES
include_directories(include)
include_directories("${PROJECT_SOURCE_DIR}/deps/mumlib/include")
# SOURCES
#Can manually add the sources using the set command as follows:
#set(SOURCES src/mainapp.cpp src/Student.cpp)
file(GLOB SOURCES "src/*.cpp")
add_executable(mumpi ${SOURCES})
# LINKING
target_link_libraries(mumpi portaudio)
target_link_libraries(mumpi mumlib)
# TESTING
enable_testing()
add_subdirectory("${PROJECT_SOURCE_DIR}/deps/googletest")
file(GLOB TESTS "test/*.cpp")
add_executable(runUnitTests ${TESTS})
target_link_libraries(runUnitTests gtest gtest_main)
add_test(NAME mumpi-test COMMAND runUnitTests)