-
Notifications
You must be signed in to change notification settings - Fork 71
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #473 from tribal-tec/master
Fix install in common_library() with subfolders
- Loading branch information
Showing
3 changed files
with
12 additions
and
6 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 |
---|---|---|
@@ -1,19 +1,24 @@ | ||
# Copyright (c) 2012 [email protected] | ||
# Copyright (c) 2012-2016 [email protected] | ||
|
||
# Usage: install_files(<prefix> FILES <files> [COMPONENT <name>]) | ||
# Usage: install_files(<prefix> FILES <files> [COMPONENT <name>] [BASE <dir>]) | ||
# Installs files while preserving their relative directory. Files | ||
# with an absolute path are installed directly into prefix. | ||
|
||
include(CMakeParseArguments) | ||
|
||
function(INSTALL_FILES PREFIX) | ||
set(ARG_NAMES COMPONENT) | ||
set(ARG_NAMES COMPONENT BASE) | ||
set(ARGS_NAMES FILES) | ||
cmake_parse_arguments(THIS "" "${ARG_NAMES}" "${ARGS_NAMES}" ${ARGN}) | ||
|
||
foreach(FILE ${THIS_FILES}) | ||
if(IS_ABSOLUTE ${FILE}) | ||
set(DIR) | ||
if(THIS_BASE) | ||
string(REPLACE ${THIS_BASE} "" DIR ${FILE}) | ||
string(REGEX MATCH "(.*)[/\\]" DIR ${DIR}) | ||
else() | ||
set(DIR) | ||
endif() | ||
else() | ||
string(REGEX MATCH "(.*)[/\\]" DIR ${FILE}) | ||
endif() | ||
|