-
Notifications
You must be signed in to change notification settings - Fork 4
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Structure restructuring repo #28
Merged
Merged
Changes from 12 commits
Commits
Show all changes
15 commits
Select commit
Hold shift + click to select a range
602c419
Basic structure in place. CMake build and tests work. VS builds of AP…
Simon-Stone 841fd1e
Changed name
Simon-Stone 1f20c69
Added workflow for VS and CMake build and test of API and Backend.
Simon-Stone 5306e68
Fiddling with the CI workflow
Simon-Stone 4f7eb3f
CMake workflow operational. Fiddling with the MSBuild workflow.
Simon-Stone 092105e
Still fiddling
Simon-Stone 4898bcd
And still fiddling
Simon-Stone 5982bf4
Make sure projects are built in isolation
Simon-Stone 7d01d3e
Did not work. Try building projects individually.
Simon-Stone cd219cc
Build each project individually to avoid file I/O conflicts.
Simon-Stone df98069
Revised names of the steps to be more explicit about what is happening.
Simon-Stone d1e2158
Update README.md
Simon-Stone 26d4922
Changed the backend folder names to VocalTractLabBackend. Also added …
Simon-Stone a1340c3
Merge branch 'STRUCTURE_Restructuring_repo' of https://github.com/TUD…
Simon-Stone 78dc4c0
Removed obsolete speaker file. Added header files to VS projects.
Simon-Stone File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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,9 +1,66 @@ | ||
# CMakeList.txt : CMake project for VocalTractLabApi, include source and define | ||
# project specific logic here. | ||
# | ||
cmake_minimum_required (VERSION 3.8) | ||
cmake_minimum_required (VERSION 3.13) | ||
set(CMAKE_CXX_STANDARD 17) | ||
|
||
project ("VocalTractLabApi") | ||
set(CMAKE_LIBRARY_OUTPUT_DIRECTORY ${CMAKE_SOURCE_DIR}/lib) | ||
set(CMAKE_ARCHIVE_OUTPUT_DIRECTORY ${CMAKE_SOURCE_DIR}/lib) | ||
set(CMAKE_RUNTIME_OUTPUT_DIRECTORY ${CMAKE_SOURCE_DIR}/lib) | ||
|
||
add_definitions(-D_USE_MATH_DEFINES -D_CRT_SECURE_NO_WARNINGS) | ||
add_library (VocalTractLabApi SHARED VocalTractLabApi.def AnatomyParams.cpp AnatomyParams.h AudioFile.h Constants.h Dsp.cpp Dsp.h F0EstimatorYin.cpp F0EstimatorYin.h GeometricGlottis.cpp GeometricGlottis.h Geometry.cpp Geometry.h GesturalScore.cpp GesturalScore.h Glottis.cpp Glottis.h IirFilter.cpp IirFilter.h ImpulseExcitation.cpp ImpulseExcitation.h LfPulse.cpp LfPulse.h Matrix2x2.cpp Matrix2x2.h PoleZeroPlan.cpp PoleZeroPlan.h Sampa.cpp Sampa.h SegmentSequence.cpp SegmentSequence.h Signal.cpp Signal.h Splines.cpp Splines.h StaticPhone.cpp StaticPhone.h Surface.cpp Surface.h Synthesizer.cpp Synthesizer.h TdsModel.cpp TdsModel.h TimeFunction.cpp TimeFunction.h TlModel.cpp TlModel.h TriangularGlottis.cpp TriangularGlottis.h Tube.cpp Tube.h TubeSequence.h TwoMassModel.cpp TwoMassModel.h VocalTract.cpp VocalTract.h VocalTractLabApi.cpp VocalTractLabApi.h VoiceQualityEstimator.cpp VoiceQualityEstimator.h VowelLf.cpp VowelLf.h XmlHelper.cpp XmlHelper.h XmlNode.cpp XmlNode.h) | ||
|
||
project("VocalTractLabApi") | ||
add_library(VocalTractLabApi SHARED) | ||
set_target_properties(VocalTractLabApi PROPERTIES PUBLIC_HEADER include/VocalTractLabApi/VocalTractLabApi.h) | ||
target_include_directories (VocalTractLabApi PUBLIC ${CMAKE_CURRENT_SOURCE_DIR}/include/VocalTractLabApi) | ||
target_include_directories (VocalTractLabApi PRIVATE ${CMAKE_CURRENT_SOURCE_DIR}/include/Backend) | ||
target_sources(VocalTractLabApi PRIVATE src/VocalTractLabApi.def src/AnatomyParams.cpp src/Dsp.cpp src/F0EstimatorYin.cpp src/GeometricGlottis.cpp src/Geometry.cpp src/GesturalScore.cpp src/Glottis.cpp src/IirFilter.cpp src/ImpulseExcitation.cpp src/LfPulse.cpp src/Matrix2x2.cpp src/PoleZeroPlan.cpp src/Sampa.cpp src/SegmentSequence.cpp src/Signal.cpp src/Splines.cpp src/StaticPhone.cpp src/Surface.cpp src/Synthesizer.cpp src/TdsModel.cpp src/TimeFunction.cpp src/TlModel.cpp src/TriangularGlottis.cpp src/Tube.cpp src/TwoMassModel.cpp src/VocalTract.cpp src/VocalTractLabApi.cpp src/VoiceQualityEstimator.cpp src/VowelLf.cpp src/XmlHelper.cpp src/XmlNode.cpp) | ||
|
||
|
||
project("VocalTractLabBackend") | ||
add_library(VocalTractLabBackend STATIC) | ||
target_include_directories (VocalTractLabBackend PUBLIC ${CMAKE_CURRENT_SOURCE_DIR}/include/Backend) | ||
target_sources(VocalTractLabBackend PUBLIC src/AnatomyParams.cpp src/Dsp.cpp src/F0EstimatorYin.cpp src/GeometricGlottis.cpp src/Geometry.cpp src/GesturalScore.cpp src/Glottis.cpp src/IirFilter.cpp src/ImpulseExcitation.cpp src/LfPulse.cpp src/Matrix2x2.cpp src/PoleZeroPlan.cpp src/Sampa.cpp src/SegmentSequence.cpp src/Signal.cpp src/Splines.cpp src/StaticPhone.cpp src/Surface.cpp src/Synthesizer.cpp src/TdsModel.cpp src/TimeFunction.cpp src/TlModel.cpp src/TriangularGlottis.cpp src/Tube.cpp src/TwoMassModel.cpp src/VocalTract.cpp src/VoiceQualityEstimator.cpp src/VowelLf.cpp src/XmlHelper.cpp src/XmlNode.cpp) | ||
|
||
|
||
include(FetchContent) | ||
FetchContent_Declare( | ||
googletest | ||
URL https://github.com/google/googletest/archive/609281088cfefc76f9d0ce82e1ff6c30cc3591e5.zip | ||
) | ||
# For Windows: Prevent overriding the parent project's compiler/linker settings | ||
set(gtest_force_shared_crt ON CACHE BOOL "" FORCE) | ||
FetchContent_MakeAvailable(googletest) | ||
|
||
enable_testing() | ||
|
||
add_executable( | ||
"VtlApiTests" | ||
"test/VtlApiTests.cpp" | ||
) | ||
|
||
target_include_directories (VtlApiTests PUBLIC ${CMAKE_CURRENT_SOURCE_DIR}/include/VocalTractLabApi) | ||
|
||
target_link_libraries( | ||
VtlApiTests | ||
gtest_main | ||
VocalTractLabApi | ||
) | ||
|
||
add_executable( | ||
"VtlBackendTests" | ||
"test/VtlBackendTests.cpp" | ||
) | ||
|
||
target_include_directories (VtlBackendTests PUBLIC ${CMAKE_CURRENT_SOURCE_DIR}/include) | ||
|
||
target_link_libraries( | ||
VtlBackendTests | ||
gtest_main | ||
VocalTractLabBackend | ||
) | ||
|
||
include(GoogleTest) | ||
gtest_discover_tests(VtlApiTests WORKING_DIRECTORY ${CMAKE_SOURCE_DIR}) | ||
gtest_discover_tests(VtlBackendTests WORKING_DIRECTORY ${CMAKE_SOURCE_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
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Is the a specific reason that makes this change possible?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Splitting up the header files into Backend and VocalTractLabApi folders is best practice to avoid ambiguities. Let's say we were to use some other library at some point that included a header file with a name that already exists in the backend or API. If the header files were at the root level of
include/
, there was no way to unambiguously choose the right one to include. Using the subfolders, you just set theinclude/
directory and then include like so:(This of course brings to attention the fact that we don't have namespaces in our codespace, but that is a topic for another time)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The uppercase
Backend
is conforming to Peter's conventions. As is the nameVocalTractLabApi
.There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
And yes, there was a reason why CMake 3.13 is required now, but I'm gonna have to check which routine made that necessary.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I get that, but why are the source files not split up, its the same situation isn't it?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
That would still be VocalTractLabBackend.dll or *.so, then.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Hm, maybe we should change the name of the Backend folder(s) to
VocalTractLabBackend
? Seems more consistent compared to the API folders. And justBackend
seems very generic.There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yes, VocalTractLabBackend sounds better.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
True, you are right.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Okay, I thought that we could simply wrap the VocalTractLabApi header around the static VocalTractLabBackend lib and build a shared lib from it, but apparently it is not as straight-forward. The recommended way of doing it is to include all the backend sources again explicitly when building the shared API library.