-
-
Notifications
You must be signed in to change notification settings - Fork 77
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
build: separate shared and static import targets
Export the FAudio::FAudio-shared target when building a shared library and the FAudio::FAudio-static target when building a static library to separate target files so that both can be installed at the same time. Alias FAudio::FAudio to the shared library if it is installed and the static library otherwise in the Config. Signed-off-by: Rafael Kitover <[email protected]>
- Loading branch information
1 parent
b6e699d
commit 0c7ee1c
Showing
2 changed files
with
60 additions
and
33 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 |
---|---|---|
|
@@ -5,6 +5,20 @@ if(NOT "@PLATFORM_WIN32@") | |
find_dependency(SDL2 CONFIG) | ||
endif() | ||
|
||
include("${CMAKE_CURRENT_LIST_DIR}/@[email protected]") | ||
if(EXISTS "${CMAKE_CURRENT_LIST_DIR}/@[email protected]") | ||
include("${CMAKE_CURRENT_LIST_DIR}/@[email protected]") | ||
set(shared_target TRUE) | ||
endif() | ||
|
||
if(EXISTS "${CMAKE_CURRENT_LIST_DIR}/@[email protected]") | ||
include("${CMAKE_CURRENT_LIST_DIR}/@[email protected]") | ||
endif() | ||
|
||
if(shared_target) | ||
add_library(@CMAKE_PROJECT_NAME@::@CMAKE_PROJECT_NAME@ ALIAS @CMAKE_PROJECT_NAME@::@CMAKE_PROJECT_NAME@-shared) | ||
else() | ||
add_library(@CMAKE_PROJECT_NAME@::@CMAKE_PROJECT_NAME@ ALIAS @CMAKE_PROJECT_NAME@::@CMAKE_PROJECT_NAME@-static) | ||
endif() | ||
|
||
check_required_components("@CMAKE_PROJECT_NAME@") | ||
|