Skip to content
Projects
Groups
Snippets
Help
Loading...
Sign in / Register
Toggle navigation
O
opencv_contrib
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_contrib
Commits
c16b5c26
Commit
c16b5c26
authored
Mar 15, 2017
by
Alexander Alekhin
Browse files
Options
Browse Files
Download
Plain Diff
Merge pull request #1043 from alalek:fix_sfm_build
parents
05eb9f35
4dce87d2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
30 additions
and
6 deletions
+30
-6
CMakeLists.txt
modules/sfm/CMakeLists.txt
+1
-1
FindGflags.cmake
modules/sfm/cmake/FindGflags.cmake
+29
-5
No files found.
modules/sfm/CMakeLists.txt
View file @
c16b5c26
...
...
@@ -9,7 +9,7 @@ if(NOT Ceres_FOUND) # Looks like Ceres find glog on the own, so separate search
find_package
(
Glog QUIET
)
endif
()
if
((
gflags_FOUND OR GFLAGS_FOUND
)
AND
(
glog_FOUND OR GLOG_FOUND
))
if
((
gflags_FOUND OR GFLAGS_FOUND
OR GFLAGS_INCLUDE_DIRS
)
AND
(
glog_FOUND OR GLOG_FOUND OR GLOG_INCLUDE_DIRS
))
set
(
_fname
"
${
CMAKE_CURRENT_BINARY_DIR
}
/test_sfm_deps.cpp"
)
file
(
WRITE
"
${
_fname
}
"
"#include <glog/logging.h>
\n
#include <gflags/gflags.h>
\n
int main() { (void)(0); return 0; }
\n
"
)
try_compile
(
SFM_DEPS_OK
"
${
CMAKE_BINARY_DIR
}
"
"
${
_fname
}
"
...
...
modules/sfm/cmake/FindGflags.cmake
View file @
c16b5c26
...
...
@@ -129,7 +129,11 @@ endmacro(GFLAGS_REPORT_NOT_FOUND)
macro
(
GFLAGS_CHECK_VARS_DEFINED
)
foreach
(
CHECK_VAR
${
ARGN
}
)
if
(
NOT DEFINED
${
CHECK_VAR
}
)
message
(
FATAL_ERROR
"Ceres Bug:
${
CHECK_VAR
}
is not defined."
)
if
(
NOT Gflags_FIND_REQUIRED
)
gflags_report_not_found
(
"Ceres Bug:
${
CHECK_VAR
}
is not defined."
)
else
()
message
(
FATAL_ERROR
"Ceres Bug:
${
CHECK_VAR
}
is not defined."
)
endif
()
endif
()
endforeach
()
endmacro
(
GFLAGS_CHECK_VARS_DEFINED
)
...
...
@@ -283,7 +287,8 @@ if (NOT DEFINED GFLAGS_PREFER_EXPORTED_GFLAGS_CMAKE_CONFIGURATION
set
(
GFLAGS_PREFER_EXPORTED_GFLAGS_CMAKE_CONFIGURATION TRUE
)
endif
()
if
(
GFLAGS_PREFER_EXPORTED_GFLAGS_CMAKE_CONFIGURATION
)
# Wrap into function because gflags_report_not_found() uses "return" statement
function
(
__find_exported_gflags
)
# Try to find an exported CMake configuration for gflags, as generated by
# gflags versions >= 2.1.
#
...
...
@@ -384,9 +389,19 @@ if (GFLAGS_PREFER_EXPORTED_GFLAGS_CMAKE_CONFIGURATION)
if
(
FOUND_INSTALLED_GFLAGS_CMAKE_CONFIGURATION
)
message
(
STATUS
"Detected gflags version:
${
gflags_VERSION
}
"
)
#set(GFLAGS_FOUND ${gflags_FOUND})
#set(GFLAGS_INCLUDE_DIR ${gflags_INCLUDE_DIR})
#set(GFLAGS_LIBRARY ${gflags_LIBRARIES})
if
(
NOT DEFINED GFLAGS_FOUND AND DEFINED gflags_FOUND
)
set
(
GFLAGS_FOUND
${
gflags_FOUND
}
)
endif
()
if
(
NOT DEFINED GFLAGS_INCLUDE_DIR AND DEFINED gflags_INCLUDE_DIR
)
set
(
GFLAGS_INCLUDE_DIR
${
gflags_INCLUDE_DIR
}
)
endif
()
if
(
NOT DEFINED GFLAGS_LIBRARY AND DEFINED gflags_LIBRARIES
)
set
(
GFLAGS_LIBRARY
${
gflags_LIBRARIES
}
)
endif
()
if
(
NOT DEFINED GFLAGS_INCLUDE_DIR
)
gflags_report_not_found
(
"GFLAGS_INCLUDE_DIR is missing"
)
endif
()
# gflags does not export the namespace in their CMake configuration, so
# use our function to determine what it should be, as it can be either
...
...
@@ -406,6 +421,15 @@ if (GFLAGS_PREFER_EXPORTED_GFLAGS_CMAKE_CONFIGURATION)
message
(
STATUS
"Failed to find an installed/exported CMake configuration "
"for gflags, will perform search for installed gflags components."
)
endif
(
FOUND_INSTALLED_GFLAGS_CMAKE_CONFIGURATION
)
set
(
GFLAGS_FOUND
"
${
GFLAGS_FOUND
}
"
PARENT_SCOPE
)
set
(
GFLAGS_INCLUDE_DIR
"
${
GFLAGS_INCLUDE_DIR
}
"
PARENT_SCOPE
)
set
(
GFLAGS_LIBRARY
"
${
GFLAGS_LIBRARY
}
"
PARENT_SCOPE
)
set
(
GFLAGS_NAMESPACE
"
${
GFLAGS_NAMESPACE
}
"
PARENT_SCOPE
)
endfunction
()
if
(
GFLAGS_PREFER_EXPORTED_GFLAGS_CMAKE_CONFIGURATION
)
__find_exported_gflags
()
endif
(
GFLAGS_PREFER_EXPORTED_GFLAGS_CMAKE_CONFIGURATION
)
if
(
NOT GFLAGS_FOUND
)
...
...
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