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
bd33e166
Commit
bd33e166
authored
Aug 07, 2012
by
Andrey Kamaev
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Use git hash instead of svn version in cmake status report
parent
1852cb7e
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
32 additions
and
20 deletions
+32
-20
CMakeLists.txt
CMakeLists.txt
+32
-20
No files found.
CMakeLists.txt
View file @
bd33e166
...
@@ -285,25 +285,37 @@ ocv_include_directories(${OPENCV_CONFIG_FILE_INCLUDE_DIR})
...
@@ -285,25 +285,37 @@ ocv_include_directories(${OPENCV_CONFIG_FILE_INCLUDE_DIR})
# ----------------------------------------------------------------------------
# ----------------------------------------------------------------------------
# Autodetect if we are in a SVN repository
# Autodetect if we are in a GIT repository
# ----------------------------------------------------------------------------
# ----------------------------------------------------------------------------
find_host_program
(
SVNVERSION_PATH svnversion
)
mark_as_advanced
(
force SVNVERSION_PATH
)
# don't use FindGit because it requires CMake 2.8.2
if
(
SVNVERSION_PATH
)
set
(
git_names git eg
)
# eg = easy git
message
(
STATUS
"Extracting svn version, please wait..."
)
# Prefer .cmd variants on Windows unless running in a Makefile in the MSYS shell
execute_process
(
COMMAND
${
SVNVERSION_PATH
}
-n
${
OpenCV_SOURCE_DIR
}
OUTPUT_VARIABLE SVNVERSION_RESULT
)
if
(
WIN32
)
if
(
NOT CMAKE_GENERATOR MATCHES
"MSYS"
)
if
(
SVNVERSION_RESULT MATCHES
"exported"
)
set
(
git_names git.cmd git eg.cmd eg
)
# This is NOT a svn repository:
endif
()
set
(
OPENCV_SVNVERSION
""
)
endif
()
message
(
STATUS
"SVNVERSION: exported"
)
else
()
find_host_program
(
GIT_EXECUTABLE NAMES
${
git_names
}
PATH_SUFFIXES Git/cmd Git/bin DOC
"git command line client"
)
set
(
OPENCV_SVNVERSION
" svn:
${
SVNVERSION_RESULT
}
"
)
mark_as_advanced
(
GIT_EXECUTABLE
)
message
(
STATUS
"SVNVERSION:
${
OPENCV_SVNVERSION
}
"
)
endif
()
if
(
GIT_EXECUTABLE
)
execute_process
(
COMMAND
${
GIT_EXECUTABLE
}
rev-parse --short HEAD
WORKING_DIRECTORY
"
${
OpenCV_SOURCE_DIR
}
"
OUTPUT_VARIABLE OPENCV_GIT_HASH_SORT
RESULT_VARIABLE GIT_RESULT
ERROR_QUIET
OUTPUT_STRIP_TRAILING_WHITESPACE
)
if
(
GIT_RESULT EQUAL 0
)
set
(
OPENCV_VCSVERSION
"commit:
${
OPENCV_GIT_HASH_SORT
}
"
)
else
()
set
(
OPENCV_VCSVERSION
"exported"
)
endif
()
else
()
else
()
# We don't have svnversion
:
# We don't have git
:
set
(
OPENCV_SVN
VERSION
""
)
set
(
OPENCV_VCS
VERSION
""
)
endif
()
endif
()
...
@@ -474,8 +486,8 @@ include(cmake/OpenCVGenConfig.cmake REQUIRED)
...
@@ -474,8 +486,8 @@ include(cmake/OpenCVGenConfig.cmake REQUIRED)
# ----------------------------------------------------------------------------
# ----------------------------------------------------------------------------
status
(
""
)
status
(
""
)
status
(
"General configuration for OpenCV
${
OPENCV_VERSION
}
====================================="
)
status
(
"General configuration for OpenCV
${
OPENCV_VERSION
}
====================================="
)
if
(
OPENCV_
SVN
VERSION
)
if
(
OPENCV_
VCS
VERSION
)
status
(
"
Version control:"
${
OPENCV_SVN
VERSION
}
)
status
(
"
Version control:"
${
OPENCV_VCS
VERSION
}
)
endif
()
endif
()
# ========================== build platform ==========================
# ========================== build platform ==========================
...
...
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