-
Notifications
You must be signed in to change notification settings - Fork 280
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
rewrite exported include dirs when pointing to absolute source / buil…
…d / devel space (#600)
- Loading branch information
1 parent
cb89563
commit b70f5a6
Showing
3 changed files
with
33 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
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,22 @@ | ||
# | ||
# Check if a string starts with a prefix. | ||
# | ||
# :param str: the string | ||
# :type str: string | ||
# :param prefix: the prefix | ||
# :type prefix: string | ||
# :param var: the output variable name | ||
# :type var: bool | ||
# | ||
function(string_starts_with str prefix var) | ||
string(LENGTH "${str}" str_length) | ||
string(LENGTH "${prefix}" prefix_length) | ||
set(value FALSE) | ||
if(NOT ${str_length} LESS ${prefix_length}) | ||
string(SUBSTRING "${str}" 0 ${prefix_length} str_prefix) | ||
if("${str_prefix}" STREQUAL "${prefix}") | ||
set(value TRUE) | ||
endif() | ||
endif() | ||
set(${var} ${value} PARENT_SCOPE) | ||
endfunction() |