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
55a1f81b
Commit
55a1f81b
authored
Mar 30, 2015
by
Christophe Palmann
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
ENH: gdal config, some more improvements
parent
0d80c670
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
12 additions
and
5 deletions
+12
-5
Modules/ThirdParty/GDAL/gdalVersionTest.cxx
Modules/ThirdParty/GDAL/gdalVersionTest.cxx
+6
-3
Modules/ThirdParty/GDAL/otb-module-init.cmake
Modules/ThirdParty/GDAL/otb-module-init.cmake
+6
-2
No files found.
Modules/ThirdParty/GDAL/gdalVersionTest.cxx
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
;
}
...
...
Modules/ThirdParty/GDAL/otb-module-init.cmake
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
)
...
...
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