-
Notifications
You must be signed in to change notification settings - Fork 204
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Add AudioFile.h in cmake library interface
- Loading branch information
1 parent
bcb61a4
commit 8f5cd73
Showing
9 changed files
with
35 additions
and
32 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,7 +1,12 @@ | ||
include_directories (${AudioFile_SOURCE_DIR}) | ||
|
||
add_definitions (-DPROJECT_BINARY_DIR="${CMAKE_CURRENT_BINARY_DIR}") | ||
file (COPY test-audio.wav DESTINATION ${CMAKE_CURRENT_BINARY_DIR}) | ||
|
||
add_executable (Examples examples.cpp) | ||
target_link_libraries (Examples AudioFile) | ||
set (AUDIOFILE_EXAMPLE Example) | ||
|
||
file (GLOB AUDIOFILE_EXAMPLES_SOURCES "${CMAKE_CURRENT_SOURCE_DIR}/*.cpp") | ||
source_group (TREE ${CMAKE_CURRENT_SOURCE_DIR} FILES ${AUDIOFILE_EXAMPLES_SOURCES}) | ||
|
||
add_executable (${AUDIOFILE_EXAMPLE} ${AUDIOFILE_EXAMPLES_SOURCES}) | ||
target_link_libraries (${AUDIOFILE_EXAMPLE} PUBLIC AudioFile) | ||
target_compile_definitions (${AUDIOFILE_EXAMPLE} PUBLIC | ||
-D_USE_MATH_DEFINES # needed for M_PI macro | ||
-DPROJECT_BINARY_DIR="${CMAKE_CURRENT_BINARY_DIR}") |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,4 +1,4 @@ | ||
#include "doctest.h" | ||
#include "doctest/doctest.h" | ||
#include <iostream> | ||
#include <vector> | ||
#include <AudioFile.h> | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,15 +1,17 @@ | ||
include_directories (doctest) | ||
include_directories (${AudioFile_SOURCE_DIR}) | ||
|
||
add_definitions(-DPROJECT_BINARY_DIR="${CMAKE_CURRENT_BINARY_DIR}") | ||
|
||
file (COPY test-audio DESTINATION ${CMAKE_CURRENT_BINARY_DIR}) | ||
file (MAKE_DIRECTORY ${CMAKE_CURRENT_BINARY_DIR}/audio-write-tests) | ||
|
||
add_executable (Tests main.cpp GeneralTests.cpp WavLoadingTests.cpp AiffLoadingTests.cpp FileWritingTests.cpp SampleConversionTests.cpp) | ||
target_compile_features (Tests PRIVATE cxx_std_17) | ||
add_test (NAME Tests COMMAND Tests) | ||
set (AUDIOFILE_TESTS Tests) | ||
|
||
file (GLOB AUDIOFILE_TESTS_SOURCES "${CMAKE_CURRENT_SOURCE_DIR}/*.cpp") | ||
source_group (TREE ${CMAKE_CURRENT_SOURCE_DIR} FILES ${AUDIOFILE_TESTS_SOURCES}) | ||
|
||
add_executable (${AUDIOFILE_TESTS} ${AUDIOFILE_TESTS_SOURCES}) | ||
target_include_directories (${AUDIOFILE_TESTS} PUBLIC ${CMAKE_CURRENT_SOURCE_DIR}) | ||
target_link_libraries (${AUDIOFILE_TESTS} PUBLIC AudioFile) | ||
target_compile_features (${AUDIOFILE_TESTS} PRIVATE cxx_std_17) | ||
target_compile_definitions (${AUDIOFILE_TESTS} PUBLIC | ||
-D_USE_MATH_DEFINES # needed for M_PI macro | ||
-DPROJECT_BINARY_DIR="${CMAKE_CURRENT_BINARY_DIR}") | ||
|
||
# add_executable (LoadingTests main.cpp WavLoadingTests.cpp AiffLoadingTests.cpp) | ||
# target_compile_features (LoadingTests PRIVATE cxx_std_17) | ||
# add_test (NAME LoadingTests COMMAND LoadingTests) | ||
add_test (NAME ${AUDIOFILE_TESTS} COMMAND ${AUDIOFILE_TESTS}) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,4 +1,4 @@ | ||
#include "doctest.h" | ||
#include "doctest/doctest.h" | ||
#include <iostream> | ||
#include <vector> | ||
#include <cmath> | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,4 +1,4 @@ | ||
#include "doctest.h" | ||
#include "doctest/doctest.h" | ||
#include <iostream> | ||
#include <vector> | ||
#include <math.h> | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,4 +1,4 @@ | ||
#include "doctest.h" | ||
#include "doctest/doctest.h" | ||
#include <iostream> | ||
#include <vector> | ||
#include <AudioFile.h> | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,4 +1,4 @@ | ||
#include "doctest.h" | ||
#include "doctest/doctest.h" | ||
#include <iostream> | ||
#include <vector> | ||
#include <AudioFile.h> | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,3 +1,3 @@ | ||
#define DOCTEST_CONFIG_IMPLEMENT_WITH_MAIN | ||
#define DOCTEST_CONFIG_COLORS_NONE | ||
#include "doctest.h" | ||
#include "doctest/doctest.h" |