Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
otb
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Container Registry
Model registry
Operate
Environments
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
Antoine Belvire
otb
Commits
179d8f76
Commit
179d8f76
authored
9 years ago
by
Guillaume Pasero
Browse files
Options
Downloads
Patches
Plain Diff
ENH: OpenThreads version parsing
parent
40e2a24e
No related branches found
Branches containing commit
No related tags found
Tags containing commit
No related merge requests found
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
CMake/FindOpenThreads.cmake
+28
-0
28 additions, 0 deletions
CMake/FindOpenThreads.cmake
with
28 additions
and
0 deletions
CMake/FindOpenThreads.cmake
+
28
−
0
View file @
179d8f76
...
...
@@ -10,12 +10,18 @@
# OPENTHREADS_LIBRARIES
# OPENTHREADS_FOUND, if false, do not try to link to OpenThreads
# OPENTHREADS_INCLUDE_DIRS, where to find the headers
# OPENTHREADS_VERSION - version string
# OPENTHREADS_VERSION_MAJOR - version major number
# OPENTHREADS_VERSION_MINOR - version minor number
# OPENTHREADS_VERSION_PATCH - version patch number
# OPENTHREADS_VERSION_NUMBER - version number ((major*100)+minor)*100+patch
#
# $OPENTHREADS_DIR is an environment variable that would
# correspond to the ./configure --prefix=$OPENTHREADS_DIR
# used in building osg.
#
# Created by Eric Wing.
# Modified by Guillaume Pasero.
#=============================================================================
# Copyright 2007-2009 Kitware, Inc.
...
...
@@ -27,6 +33,14 @@
# implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
# See the License for more information.
#=============================================================================
# Copyright (c) Centre National d'Etudes Spatiales. All rights reserved.
# See OTBCopyright.txt for details.
#
#
# This software is distributed WITHOUT ANY WARRANTY; without even
# the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR
# PURPOSE. See the above copyright notices for more information.
#=============================================================================
# (To distribute this file outside of CMake, substitute the full
# License text for the above reference.)
...
...
@@ -71,6 +85,20 @@ find_path(OPENTHREADS_INCLUDE_DIR OpenThreads/Thread
)
mark_as_advanced
(
OPENTHREADS_INCLUDE_DIR
)
if
(
EXISTS
"
${
OPENTHREADS_INCLUDE_DIR
}
/OpenThreads/Version"
)
file
(
READ
"
${
OPENTHREADS_INCLUDE_DIR
}
/OpenThreads/Version"
_openthreads_version_CONTENTS
)
string
(
REGEX REPLACE
".*# *define +OPENTHREADS_MAJOR_VERSION +([0-9]+).*"
"
\\
1"
OPENTHREADS_VERSION_MAJOR
"
${
_openthreads_version_CONTENTS
}
"
)
string
(
REGEX REPLACE
".*# *define +OPENTHREADS_MINOR_VERSION +([0-9]+).*"
"
\\
1"
OPENTHREADS_VERSION_MINOR
"
${
_openthreads_version_CONTENTS
}
"
)
string
(
REGEX REPLACE
".*# *define +OPENTHREADS_PATCH_VERSION +([0-9]+).*"
"
\\
1"
OPENTHREADS_VERSION_PATCH
"
${
_openthreads_version_CONTENTS
}
"
)
set
(
OPENTHREADS_VERSION
"
${
OPENTHREADS_VERSION_MAJOR
}
.
${
OPENTHREADS_VERSION_MINOR
}
.
${
OPENTHREADS_VERSION_PATCH
}
"
)
math
(
EXPR OPENTHREADS_VERSION_NUMBER
"((
${
OPENTHREADS_VERSION_MAJOR
}
)*100+
${
OPENTHREADS_VERSION_MINOR
}
)*100+
${
OPENTHREADS_VERSION_PATCH
}
"
)
else
()
if
(
NOT OPENTHREADS_FIND_QUIETLY
)
message
(
WARNING
"OpenThreads/Version not found !"
)
endif
()
endif
()
find_library
(
OPENTHREADS_LIBRARY
NAMES OpenThreads OpenThreadsWin32
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
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!
Save comment
Cancel
Please
register
or
sign in
to comment