-
Notifications
You must be signed in to change notification settings - Fork 6
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Use include target everywhere to get include location
- Loading branch information
Showing
3 changed files
with
29 additions
and
17 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
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 |
---|---|---|
@@ -0,0 +1,25 @@ | ||
# This file is part of Fortuno. | ||
# Licensed under the BSD-2-Clause Plus Patent license. | ||
# SPDX-License-Identifier: BSD-2-Clause-Patent | ||
|
||
# Introduce a fake target associated with the location of the folder containing the include file. | ||
# Query the INTERFACE_INCLUDE_DIRECTORIES of the target to obtain the include folder location. | ||
add_library(fortuno_include_dir INTERFACE) | ||
target_include_directories( | ||
fortuno_include_dir INTERFACE | ||
$<BUILD_INTERFACE:${CMAKE_CURRENT_SOURCE_DIR}> | ||
$<INSTALL_INTERFACE:${CMAKE_INSTALL_INCLUDEDIR}> | ||
) | ||
add_library(Fortuno::fortuno_include_dir ALIAS fortuno_include_dir) | ||
|
||
if (FORTUNO_INSTALL) | ||
install( | ||
FILES fortuno.fypp | ||
DESTINATION "${CMAKE_INSTALL_INCLUDEDIR}" | ||
COMPONENT Fortuno_development | ||
) | ||
install( | ||
TARGETS fortuno_include_dir | ||
EXPORT FortunoTargets | ||
) | ||
endif () |