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
55a1f81b
Commit
55a1f81b
authored
10 years ago
by
Christophe Palmann
Browse files
Options
Downloads
Patches
Plain Diff
ENH: gdal config, some more improvements
parent
0d80c670
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
Modules/ThirdParty/GDAL/gdalVersionTest.cxx
+6
-3
6 additions, 3 deletions
Modules/ThirdParty/GDAL/gdalVersionTest.cxx
Modules/ThirdParty/GDAL/otb-module-init.cmake
+6
-2
6 additions, 2 deletions
Modules/ThirdParty/GDAL/otb-module-init.cmake
with
12 additions
and
5 deletions
Modules/ThirdParty/GDAL/gdalVersionTest.cxx
+
6
−
3
View file @
55a1f81b
...
...
@@ -12,10 +12,13 @@ using namespace std;
int
main
(
int
argc
,
char
*
argv
[])
{
int
MAJOR
=
atoi
(
argv
[
2
]);
int
MINOR
=
atoi
(
argv
[
3
]);
string
version
(
GDALVersionInfo
(
"RELEASE_NAME"
));
// Remember gdal version
const
char
*
inputFilename
=
argv
[
1
];
const
char
*
inputFilename
=
argv
[
1
];
ofstream
file
(
inputFilename
,
ios
::
out
|
ios
::
trunc
);
if
(
file
)
{
...
...
@@ -52,9 +55,9 @@ int main(int argc, char * argv[])
}
if
(
(
UIntVect
[
0
]
<
1
)
||
(
UIntVect
[
1
]
<
10
)
)
if
(
(
UIntVect
[
0
]
<
MAJOR
)
||
(
UIntVect
[
1
]
<
MINOR
)
)
{
cout
<<
"WARNING : Version of GDAL must be >=
1.10 (
"
<<
UIntVect
[
0
]
<<
"."
<<
UIntVect
[
1
]
<<
" detected)."
<<
endl
;
cout
<<
"WARNING : Version of GDAL must be >=
"
<<
MAJOR
<<
"."
<<
MINOR
<<
" :
"
<<
UIntVect
[
0
]
<<
"."
<<
UIntVect
[
1
]
<<
" detected)."
<<
endl
;
return
1
;
}
...
...
This diff is collapsed.
Click to expand it.
Modules/ThirdParty/GDAL/otb-module-init.cmake
+
6
−
2
View file @
55a1f81b
...
...
@@ -11,9 +11,12 @@ endif()
message
(
STATUS
"Check if Gdal qualifies for Orfeo ToolBox"
)
set
(
MIN_MAJOR_VERSION 1
)
set
(
MIN_MINOR_VERSION 10
)
#------------------- TESTS ---------------------
# Version of GDAL
try_run
(
RUN_RESULT_VERSION COMPILE_RESULT_VERSION
${
CMAKE_CURRENT_BINARY_DIR
}
${
CMAKE_SOURCE_DIR
}
/Modules/ThirdParty/GDAL/gdalVersionTest.cxx CMAKE_FLAGS
"-DINCLUDE_DIRECTORIES:PATH=
${
GDAL_INCLUDE_DIR
}
"
"-DLINK_LIBRARIES:STRING=
${
GDAL_LIBRARY
}
"
ARGS
${
TEMP
}
/gdalVersion.txt
)
try_run
(
RUN_RESULT_VERSION COMPILE_RESULT_VERSION
${
CMAKE_CURRENT_BINARY_DIR
}
${
CMAKE_SOURCE_DIR
}
/Modules/ThirdParty/GDAL/gdalVersionTest.cxx CMAKE_FLAGS
"-DINCLUDE_DIRECTORIES:PATH=
${
GDAL_INCLUDE_DIR
}
"
"-DLINK_LIBRARIES:STRING=
${
GDAL_LIBRARY
}
"
ARGS
${
TEMP
}
/gdalVersion.txt
${
MIN_MAJOR_VERSION
}
${
MIN_MINOR_VERSION
}
)
# Has OGR
try_compile
(
GDAL_HAS_OGR
${
CMAKE_CURRENT_BINARY_DIR
}
${
CMAKE_SOURCE_DIR
}
/Modules/ThirdParty/GDAL/gdalOGRTest.cxx CMAKE_FLAGS
"-DINCLUDE_DIRECTORIES:PATH=
${
GDAL_INCLUDE_DIR
}
"
"-DLINK_LIBRARIES:STRING=
${
GDAL_LIBRARY
}
"
)
...
...
@@ -37,7 +40,8 @@ if (NOT COMPILE_RESULT_VERSION)
endif
()
if
(
${
RUN_RESULT_VERSION
}
EQUAL 1
)
message
(
WARNING
"Version of GDAL must be >= 1.10"
)
file
(
READ
"
${
TEMP
}
/gdalVersion.txt"
DETECTED_VERSION
)
message
(
WARNING
"Version of GDAL must be >= "
${
MIN_MAJOR_VERSION
}
"."
${
MIN_MINOR_VERSION
}
" : "
${
DETECTED_VERSION
}
" detected."
)
endif
()
if
(
NOT GDAL_HAS_OGR
)
...
...
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