-
Notifications
You must be signed in to change notification settings - Fork 15
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
7a85eb5
commit 9655b1a
Showing
5 changed files
with
79 additions
and
8 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 |
---|---|---|
@@ -0,0 +1,39 @@ | ||
# Installs headers for the named target | ||
# Syntax: | ||
# install_headers TARGET <target> DESTINATION <destination> ... | ||
# | ||
# NOEXCLUDE_STDAFX Also install the precompiled header file | ||
# <target> The target whose sources are to be installed | ||
# <destination> The root of the destination folder where files will be copied | ||
# | ||
# Additional options are passed after FILES to the cmake install command | ||
include(CMakeParseArguments) | ||
|
||
function(install_headers) | ||
set(options NOEXCLUDE_STDAFX) | ||
set(oneValueArgs TARGET DESTINATION) | ||
set(multiValueArgs) | ||
|
||
cmake_parse_arguments(opt "${options}" "${oneValueArgs}" "${multiValueArgs}" ${ARGN}) | ||
|
||
if(NOT opt_TARGET) | ||
message(FATAL_ERROR "Cannot install files for a nonexistent target") | ||
endif() | ||
|
||
get_target_property(target_SRCS ${opt_TARGET} SOURCES) | ||
foreach(src IN LISTS target_SRCS) | ||
if(NOT ${opt_NOEXCLUDE_STDAFX} AND ${src} STREQUAL "stdafx.h") | ||
continue() | ||
endif() | ||
|
||
get_filename_component(src_ext ${src} EXT) | ||
if(src_ext STREQUAL ".h") | ||
get_filename_component(src_rel ${src} DIRECTORY) | ||
install( | ||
FILES ${src} | ||
DESTINATION ${opt_DESTINATION}/${src_rel} | ||
${opt_UNPARSED_ARGUMENTS} | ||
) | ||
endif() | ||
endforeach() | ||
endfunction() |
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