CMake: Create and install EXPORTED configuration #118
Merged
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.
This PR changes the build system in several ways:
openshot-audio
library target name andlibopenshot-audio
library name are unchanged, internally.)JuceHeader.h
toOpenShotAudio.h
. A copy (or symlink, depending on CMake version and OS capabilities) under the old name is still installed for compatibility, but should be considered legacy. Any references toJuceHeader.h
in downstream code (including libopenshot) should be changed toOpenShotAudio.h
at the earliest convenience.EXPORTED
configuration which defines all relevant parameters for the build output, both in the build tree and in any subsequent install tree. This makes theFindOpenShotAudio.cmake
file in libopenshot's build unnecessary, and represents a more complete and robust method of establishing a dependency relationship with library consumers. All of the information needed to build projects that link with libopenshot-audio are written to the newOpenShotAudio-Config.cmake
andOpenShotAudioTargets.cmake
output files.EXPORTED
asOpenShot::Audio
, and should be referred to that way by consumers:FindASIO.cmake
module, which is also included in theEXPORTED
configuration for use by downstream library consumers.openshot-audio-test-sound
program has been renamed toopenshot-audio-demo
, and is completely rewritten in a more modern code style, making better use of C++11 STL classes and idioms.The function of the tool has also been enhanced to make better use of the JUCE capabilities required by libopenshot: A list of all discovered audio devices present on the system is first generated and displayed, before a test tone plays on the default output. (Actually, 5 test tones, precisely 2 seconds apart.
deviceManager.playTestSound()
in recent JUCE releases triggers only a brief "beep" on each call, rather than playing a continuous tone, so I took the opportunity to demonstratestd::this_thread::sleep_until
and thestd::chrono
timer classes.)The binary's configuration is also included in the
EXPORTED
data, and may be referenced downstream as theOpenShot::openshot-audio-demo
target.