1
0
Fork 0
mirror of https://github.com/juce-framework/JUCE.git synced 2026-01-10 23:44:24 +00:00

CMake: Use juce_add_modules to import modules from install tree

This change means that imported juce modules will be made available both
with and without a namespace prefix, e.g. `juce_core` and
`juce::juce_core` will both be created.

This change allows custom modules to specify dependencies without a
juce:: prefix, which allows the modules to be used with the Projucer, or
under CMake with JUCE in a subdirectory, or under CMake with JUCE
installed to the system.
This commit is contained in:
reuk 2020-05-04 12:29:25 +01:00
parent 6f016aa03b
commit bf51d2c076
No known key found for this signature in database
GPG key ID: 9ADCD339CFC98A11
5 changed files with 69 additions and 34 deletions

View file

@ -491,15 +491,11 @@ both to the target's `SOURCES` and `INTERFACE_SOURCES`, which may result in many
module being built into a single target, which would cause build failures in the best case and
silent ODR violations in the worst case. Scary stuff!
This command has a few optional arguments: `INSTALL_PATH` and `INSTALL_EXPORT` should be provided if
you want the module to be installable through the CMake installation mechanism. `INSTALL_PATH` is a
path, relative to the install prefix, to which the module sources will be copied. `INSTALL_EXPORT`
specifies the CMake export group for the installed module. ALIAS_NAMESPACE will add an alias for the
target(s) with the provided namespace. For example, the following invocation will add a module
target named `my_module`, along with an alias named `company::my_module`.
```
juce_add_module(my_module ALIAS_NAMESPACE company)`
```
This command has a few optional arguments: `INSTALL_PATH` is a path, relative to the install prefix,
to which the module sources will be copied during installation of the module. ALIAS_NAMESPACE will
add an alias for the module target(s) with the provided namespace. For example, the following
invocation will add a module target named `my_module`, along with an alias named
`company::my_module`. ``` juce_add_module(my_module ALIAS_NAMESPACE company)` ```
`juce_add_modules` is a convenience function that can be used to add multiple JUCE modules at once.
This version accepts many module paths, rather than just one. For an example of usage, see the