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

BUG: avoid calling twice find_package OpenJPEG

parent cde3116d
No related branches found
No related tags found
No related merge requests found
......@@ -3,7 +3,10 @@ project(OTBOpenJPEG)
set(OTBOpenJPEG_SYSTEM_INCLUDE_DIRS ${OPENJPEG_INCLUDE_DIRS})
set(OTBOpenJPEG_LIBRARIES "${OPENJPEG_LIBRARIES}")
set(OTBOpenJPEG_INCLUDE_DIRS ${OTBOpenJPEG_BINARY_DIR}/src)
set(OTBOpenJPEG_EXPORT_CODE_BUILD "find_package(OpenJPEG REQUIRED HINTS ${OpenJPEG_DIR})")
set(OTBOpenJPEG_EXPORT_CODE_BUILD "
if(NOT OpenJPEG_FOUND)
find_package(OpenJPEG REQUIRED HINTS ${OpenJPEG_DIR})
endif()")
set(OTBOpenJPEG_EXPORT_CODE_INSTALL ${OTBOpenJPEG_EXPORT_CODE_BUILD})
if(OpenJPEG_FOUND)
......@@ -12,6 +15,8 @@ project(OTBOpenJPEG)
configure_file( src/otb_openjpeg.h.in src/otb_openjpeg.h )
endif()
message(STATUS "Found OpenJPEG : ${OPENJPEG_LIBRARIES} (version ${OPENJPEG_MAJOR_VERSION}.${OPENJPEG_MINOR_VERSION}.${OPENJPEG_BUILD_VERSION})")
otb_module_impl()
install(FILES ${OTBOpenJPEG_BINARY_DIR}/src/otb_openjpeg.h
......
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