Skip to content
Projects
Groups
Snippets
Help
Loading...
Sign in / Register
Toggle navigation
O
opencv
Project
Project
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
Packages
Packages
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
submodule
opencv
Commits
68eab8ea
Commit
68eab8ea
authored
Jan 17, 2016
by
Maksim Shabunin
Browse files
Options
Browse Files
Download
Plain Diff
Merge pull request #5884 from alalek:cmake_vars
parents
64057965
8f37a3a3
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
22 additions
and
3 deletions
+22
-3
CMakeLists.txt
CMakeLists.txt
+6
-0
OpenCVUtils.cmake
cmake/OpenCVUtils.cmake
+16
-3
No files found.
CMakeLists.txt
View file @
68eab8ea
...
...
@@ -98,6 +98,8 @@ endif()
include
(
cmake/OpenCVUtils.cmake
)
ocv_cmake_eval
(
DEBUG_PRE ONCE
)
ocv_clear_vars
(
OpenCVModules_TARGETS
)
# ----------------------------------------------------------------------------
...
...
@@ -1254,3 +1256,7 @@ endif()
# ----------------------------------------------------------------------------
include
(
cmake/OpenCVPackaging.cmake
)
# This should be the last command
ocv_cmake_dump_vars
(
""
TOFILE
"CMakeVars.txt"
)
ocv_cmake_eval
(
DEBUG_POST ONCE
)
cmake/OpenCVUtils.cmake
View file @
68eab8ea
include
(
CMakeParseArguments
)
# Debugging function
function
(
ocv_cmake_dump_vars
)
set
(
VARS
""
)
get_cmake_property
(
_variableNames VARIABLES
)
cmake_parse_arguments
(
DUMP
""
"TOFILE"
""
${
ARGN
}
)
set
(
regex
"
${
DUMP_UNPARSED_ARGUMENTS
}
"
)
get_cmake_property
(
_variableNames VARIABLES
)
set
(
VARS
""
)
string
(
TOLOWER
"
${
regex
}
"
regex_lower
)
foreach
(
_variableName
${
_variableNames
}
)
if
(
_variableName MATCHES
"
${
regex
}
"
)
string
(
TOLOWER
"
${
_variableName
}
"
_variableName_lower
)
if
(
_variableName MATCHES
"
${
regex
}
"
OR _variableName_lower MATCHES
"
${
regex_lower
}
"
)
set
(
VARS
"
${
VARS
}${
_variableName
}
=
${${
_variableName
}}
\n
"
)
endif
()
endforeach
()
...
...
@@ -16,6 +20,15 @@ function(ocv_cmake_dump_vars)
endif
()
endfunction
()
function
(
ocv_cmake_eval var_name
)
if
(
DEFINED
${
var_name
}
)
file
(
WRITE
"
${
CMAKE_BINARY_DIR
}
/CMakeCommand-
${
var_name
}
.cmake"
${${
var_name
}}
)
include
(
"
${
CMAKE_BINARY_DIR
}
/CMakeCommand-
${
var_name
}
.cmake"
)
endif
()
if
(
";
${
ARGN
}
;"
MATCHES
";ONCE;"
)
unset
(
${
var_name
}
CACHE
)
endif
()
endfunction
()
# Search packages for host system instead of packages for target system
# in case of cross compilation thess macro should be defined by toolchain file
...
...
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