Skip to content
GitLab
Projects
Groups
Snippets
Help
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
otb
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
273
Issues
273
List
Boards
Labels
Service Desk
Milestones
Merge Requests
8
Merge Requests
8
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Operations
Operations
Incidents
Environments
Packages & Registries
Packages & Registries
Container Registry
Analytics
Analytics
CI / CD
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Main Repositories
otb
Commits
fb0edb0d
Commit
fb0edb0d
authored
Apr 23, 2015
by
Guillaume Pasero
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
ENH: parse version for muParserX
parent
7ea84478
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
22 additions
and
2 deletions
+22
-2
CMake/FindMuParserX.cmake
CMake/FindMuParserX.cmake
+22
-2
No files found.
CMake/FindMuParserX.cmake
View file @
fb0edb0d
# Find MuParserX
#
# MUPARSERX_FOUND - True if MuParser found.
# MUPARSERX_FOUND - True if MuParser
X
found.
# MUPARSERX_INCLUDE_DIRS - where to find mpParser.h, etc.
# MUPARSERX_LIBRARIES - List of libraries when using MuParser.
# MUPARSERX_LIBRARIES - List of libraries when using MuParserX.
# MUPARSERX_VERSION - version string
# MUPARSERX_VERSION_MAJOR - version major number
# MUPARSERX_VERSION_MINOR - version minor number
# MUPARSERX_VERSION_PATCH - version patch number
# MUPARSERX_VERSION_NUMBER - version number ((major*100)+minor)*100+patch
#
if
(
MUPARSERX_INCLUDE_DIR
)
...
...
@@ -13,6 +18,21 @@ endif()
find_path
(
MUPARSERX_INCLUDE_DIR mpParser.h
PATH_SUFFIXES mpParser
)
if
(
EXISTS
"
${
MUPARSERX_INCLUDE_DIR
}
/mpDefines.h"
)
file
(
READ
"
${
MUPARSERX_INCLUDE_DIR
}
/mpDefines.h"
_mpDefines_h_CONTENTS
)
string
(
REGEX REPLACE
".*# *define MUP_PARSER_VERSION *_T
\\
(
\"
([0-9.]+)( .*)?
\"\\
).*"
"
\\
1"
MUPARSERX_VERSION
"
${
_mpDefines_h_CONTENTS
}
"
)
string
(
REGEX REPLACE
"([0-9]+)
\\
.([0-9]+)
\\
.([0-9]+)"
"
\\
1"
MUPARSERX_VERSION_MAJOR
"
${
MUPARSERX_VERSION
}
"
)
string
(
REGEX REPLACE
"([0-9]+)
\\
.([0-9]+)
\\
.([0-9]+)"
"
\\
2"
MUPARSERX_VERSION_MINOR
"
${
MUPARSERX_VERSION
}
"
)
string
(
REGEX REPLACE
"([0-9]+)
\\
.([0-9]+)
\\
.([0-9]+)"
"
\\
3"
MUPARSERX_VERSION_PATCH
"
${
MUPARSERX_VERSION
}
"
)
math
(
EXPR MUPARSERX_VERSION_NUMBER
"((
${
MUPARSERX_VERSION_MAJOR
}
)*100+
${
MUPARSERX_VERSION_MINOR
}
)*100+
${
MUPARSERX_VERSION_PATCH
}
"
)
else
()
if
(
NOT MuParserX_FIND_QUIETLY
)
message
(
WARNING
"mpDefines.h not found !"
)
endif
()
endif
()
find_library
(
MUPARSERX_LIBRARY
NAMES muparserx
PATH_SUFFIXES muparserx
)
...
...
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