-
Notifications
You must be signed in to change notification settings - Fork 2
/
Copy pathCMakeLists.txt
54 lines (42 loc) · 1.56 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
43
44
45
46
47
48
49
50
51
52
53
54
cmake_minimum_required(VERSION 3.5)
if (POLICY CMP0014)
cmake_policy(SET CMP0014 NEW)
endif (POLICY CMP0014)
if (POLICY CMP0048)
cmake_policy(SET CMP0048 NEW)
endif (POLICY CMP0048)
project(MusicBeatDetector)
# Default behavior is to enable tests
option(MUSIC_BEAT_DETECTOR_ENABLE_TESTS "Build tests" ON)
set_property(GLOBAL PROPERTY USE_FOLDERS ON)
if (CMAKE_BUILD_TYPE MATCHES Debug)
add_definitions(-DDEBUG=1)
endif ()
if (CMAKE_BUILD_TYPE MATCHES Release)
add_definitions(-DRELEASE=1)
endif ()
if (MSVC)
set(CMAKE_CXX_FLAGS_RELEASE "${CMAKE_CXX_FLAGS_RELEASE} /MT")
set(CMAKE_CXX_FLAGS_DEBUG "${CMAKE_CXX_FLAGS_DEBUG} /MTd")
endif (MSVC)
function(assign_source_group)
foreach (_source IN ITEMS ${ARGN})
if (IS_ABSOLUTE "${_source}")
file(RELATIVE_PATH _source_rel "${CMAKE_CURRENT_SOURCE_DIR}" "${_source}")
else ()
set(_source_rel "${_source}")
endif ()
get_filename_component(_source_path "${_source_rel}" PATH)
string(REPLACE "/" "\\" _source_path_msvc "${_source_path}")
source_group("${_source_path_msvc}" FILES "${_source}")
endforeach ()
endfunction(assign_source_group)
add_subdirectory(3rdParty)
add_definitions(-DARMA_DONT_USE_WRAPPER)
add_subdirectory(MusicBeatDetector)
if (MUSIC_BEAT_DERECTOR_ENABLE_TESTS)
set_target_properties(gmock PROPERTIES FOLDER 3rdParty)
set_target_properties(gmock_main PROPERTIES FOLDER 3rdParty)
set_target_properties(gtest PROPERTIES FOLDER 3rdParty)
set_target_properties(gtest_main PROPERTIES FOLDER 3rdParty)
endif()