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
Package registry
Container registry
Model registry
Operate
Environments
Terraform modules
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
Julien Cabieces
otb
Commits
1cd5db54
Commit
1cd5db54
authored
13 years ago
by
Luc Hermitte
Browse files
Options
Downloads
Patches
Plain Diff
COMP: OTB-134/OGR now uses the official GDAL_VERSION_NUM #define
parent
cf68b6bc
No related branches found
No related tags found
No related merge requests found
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
Code/UtilitiesAdapters/OGRAdapters/CMakeLists.txt
+0
-12
0 additions, 12 deletions
Code/UtilitiesAdapters/OGRAdapters/CMakeLists.txt
Code/UtilitiesAdapters/OGRAdapters/otbOGRLayerWrapper.cxx
+5
-5
5 additions, 5 deletions
Code/UtilitiesAdapters/OGRAdapters/otbOGRLayerWrapper.cxx
with
5 additions
and
17 deletions
Code/UtilitiesAdapters/OGRAdapters/CMakeLists.txt
+
0
−
12
View file @
1cd5db54
# Decompose GDAL version
STRING
(
REGEX REPLACE
"([0-9]+)
\\
.([0-9]+)
\\
.([0-9]+)"
"
\\
1"
GDAL_VERSION_MAJOR
"
${
GDAL_VERSION
}
"
)
STRING
(
REGEX REPLACE
"([0-9]+)
\\
.([0-9]+)
\\
.([0-9]+)"
"
\\
2"
GDAL_VERSION_MINOR
"
${
GDAL_VERSION
}
"
)
STRING
(
REGEX REPLACE
"([0-9]+)
\\
.([0-9]+)
\\
.([0-9]+)"
"
\\
3"
GDAL_VERSION_PATCH
"
${
GDAL_VERSION
}
"
)
SET
(
GDAL_VERSION_MAJOR_STRING
"
${
GDAL_VERSION_MAJOR
}
"
CACHE STRING
"Major Version Number of GDAL package found"
)
SET
(
GDAL_VERSION_MINOR_STRING
"
${
GDAL_VERSION_MINOR
}
"
CACHE STRING
"Minor Version Number of GDAL package found"
)
SET
(
GDAL_VERSION_PATCH_STRING
"
${
GDAL_VERSION_PATCH
}
"
CACHE STRING
"Patch Version Number of GDAL package found"
)
MATH
(
EXPR GDAL_NUM_VERSION
"((
${
GDAL_VERSION_MAJOR
}
)*100+
${
GDAL_VERSION_MINOR
}
)*100+
${
GDAL_VERSION_PATCH
}
"
)
MESSAGE
(
STATUS
"GDAL Num version:
${
GDAL_NUM_VERSION
}
"
)
ADD_DEFINITIONS
(
-DGDAL_VERSION=
${
GDAL_NUM_VERSION
}
)
# Sources of non-templated classes.
FILE
(
GLOB OTBOGRAdapters_SRCS
"*.cxx"
)
...
...
This diff is collapsed.
Click to expand it.
Code/UtilitiesAdapters/OGRAdapters/otbOGRLayerWrapper.cxx
+
5
−
5
View file @
1cd5db54
...
...
@@ -113,7 +113,7 @@ void otb::ogr::Layer::SetFeature(Feature feature)
std
::
string
otb
::
ogr
::
Layer
::
GetName
()
const
{
assert
(
m_Layer
&&
"null layer"
);
#if GDAL_VERSION >= 1
0
800
#if GDAL_VERSION
_NUM
>= 1800
return
m_Layer
->
GetName
();
#else
return
GetLayerDefn
().
GetName
();
...
...
@@ -188,7 +188,7 @@ void otb::ogr::Layer::CreateField(
void
otb
::
ogr
::
Layer
::
DeleteField
(
size_t
fieldIndex
)
{
assert
(
m_Layer
&&
"OGRLayer not initialized"
);
#if GDAL_VERSION < 1
0
900
#if GDAL_VERSION
_NUM
< 1900
itkGenericExceptionMacro
(
"OGRLayer::AlterFieldDefn is not supported by OGR v"
<<
GDAL_VERSION
<<
". Upgrade to a version >= 1.9.0, and recompile OTB."
)
#else
...
...
@@ -205,7 +205,7 @@ void otb::ogr::Layer::AlterFieldDefn(
size_t
fieldIndex
,
OGRFieldDefn
&
newFieldDefn
,
int
nFlags
)
{
assert
(
m_Layer
&&
"OGRLayer not initialized"
);
#if GDAL_VERSION < 1
0
900
#if GDAL_VERSION
_NUM
< 1900
itkGenericExceptionMacro
(
"OGRLayer::AlterFieldDefn is not supported by OGR v"
<<
GDAL_VERSION
<<
". Upgrade to a version >= 1.9.0, and recompile OTB."
)
#else
...
...
@@ -221,7 +221,7 @@ void otb::ogr::Layer::AlterFieldDefn(
void
otb
::
ogr
::
Layer
::
ReorderField
(
size_t
oldPos
,
size_t
newPos
)
{
assert
(
m_Layer
&&
"OGRLayer not initialized"
);
#if GDAL_VERSION < 1
0
900
#if GDAL_VERSION
_NUM
< 1900
itkGenericExceptionMacro
(
"OGRLayer::ReorderField is not supported by OGR v"
<<
GDAL_VERSION
<<
". Upgrade to a version >= 1.9.0, and recompile OTB."
)
#else
...
...
@@ -237,7 +237,7 @@ void otb::ogr::Layer::ReorderField(size_t oldPos, size_t newPos)
void
otb
::
ogr
::
Layer
::
ReorderFields
(
int
*
map
)
{
assert
(
m_Layer
&&
"OGRLayer not initialized"
);
#if GDAL_VERSION < 1
0
900
#if GDAL_VERSION
_NUM
< 1900
itkGenericExceptionMacro
(
"OGRLayer::ReorderField is not supported by OGR v"
<<
GDAL_VERSION
<<
". Upgrade to a version >= 1.9.0, and recompile OTB."
)
#else
...
...
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