Skip to content
Snippets Groups Projects
Commit 8cad2e5d authored by Guillaume Pasero's avatar Guillaume Pasero
Browse files

BUG: Mantis-1499: add a if-else to support ossimRpcSolver::getRpcModel()

parent 85d25812
No related branches found
No related tags found
No related merge requests found
......@@ -41,7 +41,16 @@ target_link_libraries(OTBOSSIMAdapters
${OTBOssim_LIBRARIES}
${OTBOssimPlugins_LIBRARIES}
${OTBOpenThreads_LIBRARIES}
)
otb_module_target(OTBOSSIMAdapters)
# add the OTB_OSSIM_VERSION definition
get_target_property(_OTBOSSIMAdapters_COMP_DEF OTBOSSIMAdapters COMPILE_DEFINITIONS)
if(_OTBOSSIMAdapters_COMP_DEF)
set_target_properties(OTBOSSIMAdapters
PROPERTIES COMPILE_DEFINITIONS "${_OTBOSSIMAdapters_COMP_DEF};OTB_OSSIM_VERSION=${OTB_OSSIM_VERSION}")
else()
set_target_properties(OTBOSSIMAdapters
PROPERTIES COMPILE_DEFINITIONS "OTB_OSSIM_VERSION=${OTB_OSSIM_VERSION}")
endif()
......@@ -112,7 +112,11 @@ RPCSolverAdapter::Solve(const GCPsContainerType& gcpContainer,
rmsError = rpcSolver->getRmsError();
// Retrieve the output RPC projection
#if OTB_OSSIM_VERSION < 20200
ossimRefPtr<ossimRpcProjection> rpcProjection = dynamic_cast<ossimRpcProjection*>(rpcSolver->createRpcProjection()->getProjection());
#else
ossimRefPtr<ossimRpcModel> rpcProjection = rpcSolver->getRpcModel();
#endif
// Export the sensor model in an ossimKeywordlist
ossimKeywordlist geom_kwl;
......
......@@ -19,3 +19,5 @@
#
find_package ( Ossim REQUIRED )
set(OTB_OSSIM_VERSION ${OSSIM_VERSION_NUMBER} CACHE INTERNAL "Ossim version detected by OTB" FORCE)
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment