Skip to content
GitLab
Projects
Groups
Snippets
/
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
Menu
Open sidebar
CMake
CMake
Commits
d6d221d4
Commit
d6d221d4
authored
Mar 21, 2012
by
David Cole
Committed by
Kitware Robot
Mar 21, 2012
Browse files
Merge topic 'fix-AllFindModules-version-check'
a5ee6285
Tests: Relax restrictions on version variable contents
parents
5f5ce26c
a5ee6285
Changes
1
Hide whitespace changes
Inline
Side-by-side
Tests/CMakeOnly/AllFindModules/CMakeLists.txt
View file @
d6d221d4
...
...
@@ -48,11 +48,21 @@ endif (NOT QT4_FOUND)
macro
(
check_version_string MODULE_NAME VERSION_VAR
)
if
(
${
MODULE_NAME
}
_FOUND
)
if
(
DEFINED
${
VERSION_VAR
}
)
if
(
NOT
${
VERSION_VAR
}
MATCHES
"^[0-9][0-9
\\
.]*[-A-Za-z_
\\
+]*[0-9
\\
.]*$"
)
message
(
SEND_ERROR
"
${
VERSION_VAR
}
has unexpected content
${${
VERSION_VAR
}}
"
)
message
(
STATUS
"
${
VERSION_VAR
}
='
${${
VERSION_VAR
}}
'"
)
if
(
NOT
${
VERSION_VAR
}
MATCHES
"^[0-9]"
)
message
(
SEND_ERROR
"unexpected:
${
VERSION_VAR
}
does not begin with a decimal digit"
)
endif
()
if
(
"
${${
VERSION_VAR
}}
"
STREQUAL
""
)
message
(
SEND_ERROR
"unexpected:
${
VERSION_VAR
}
is empty"
)
endif
()
if
(
${
VERSION_VAR
}
VERSION_EQUAL 0
)
message
(
SEND_ERROR
"unexpected:
${
VERSION_VAR
}
is VERSION_EQUAL 0"
)
endif
()
if
(
NOT
${
VERSION_VAR
}
VERSION_GREATER 0
)
message
(
SEND_ERROR
"unexpected:
${
VERSION_VAR
}
is NOT VERSION_GREATER 0"
)
endif
()
else
()
message
(
SEND_ERROR
"
${
MODULE_NAME
}
_FOUND is set but
no
version number
is defined
"
)
message
(
SEND_ERROR
"
${
MODULE_NAME
}
_FOUND is set but version number
variable
${
VERSION_VAR
}
is NOT DEFINED
"
)
endif
()
endif
()
endmacro
(
check_version_string
)
...
...
Write
Preview
Supports
Markdown
0%
Try again
or
attach a new 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