Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
A
abc
Overview
Overview
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
lvzhengyang
abc
Commits
5761c768
Commit
5761c768
authored
Nov 05, 2015
by
Baruch Sterin
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
CMakeLists.txt: refactor a bit
parent
be429079
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
7 additions
and
5 deletions
+7
-5
CMakeLists.txt
+7
-5
No files found.
CMakeLists.txt
View file @
5761c768
...
...
@@ -32,15 +32,14 @@ execute_process(
OUTPUT_VARIABLE MAKE_OUTPUT
)
# extract options from make output
function
(
extract_var SEPARATOR DEST_VARIABLE MAKE_OUTPUT
)
string
(
REGEX MATCH
"
${
SEPARATOR
}
.*
${
SEPARATOR
}
"
TMP
"
${
MAKE_OUTPUT
}
"
)
string
(
REGEX REPLACE
"
${
SEPARATOR
}
(.*)
${
SEPARATOR
}
"
"
\\
1"
TMP
"
${
TMP
}
"
)
separate_arguments
(
TMP
)
set
(
${
DEST_VARIABLE
}
${
TMP
}
PARENT_SCOPE
)
endfunction
()
extract_var
(
SEPARATOR_SRC ABC_SRC
${
MAKE_OUTPUT
}
)
...
...
@@ -48,9 +47,12 @@ extract_var(SEPARATOR_LIBS ABC_LIBS ${MAKE_OUTPUT})
extract_var
(
SEPARATOR_CFLAGS ABC_CFLAGS
${
MAKE_OUTPUT
}
)
extract_var
(
SEPARATOR_CXXFLAGS ABC_CXXFLAGS
${
MAKE_OUTPUT
}
)
function
(
abc_properties target visibility
)
target_include_directories
(
${
target
}
${
visibility
}
${
CMAKE_CURRENT_SOURCE_DIR
}
/src
)
target_compile_options_filtered
(
${
target
}
${
visibility
}
${
ABC_CFLAGS
}
${
ABC_CXXFLAGS
}
-Wno-unused-but-set-variable
)
target_link_libraries
(
${
target
}
${
visibility
}
${
ABC_LIBS
}
)
endfunction
()
add_executable
(
abc
${
ABC_SRC
}
)
abc_properties
(
abc PRIVATE
)
target_include_directories
(
abc PRIVATE
${
CMAKE_CURRENT_SOURCE_DIR
}
/src
)
target_compile_options_filtered
(
abc PRIVATE
${
ABC_CFLAGS
}
-Wno-unused-but-set-variable
)
target_link_libraries
(
abc PRIVATE
${
ABC_LIBS
}
)
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment