Commit 50ccf35f authored by Guillaume Pasero's avatar Guillaume Pasero

Merge branch 'release-6.6' into 1523-gdal-python-bindings

parents 955e267e 16bff817

Too many changes to show.

To preserve performance only 1000 of 1000+ files are displayed.

### Description
Describe what happens and why you think it is a bug
### Steps to reproduce
Describe as precisely as possible how to reproduce the bug. Try to isolate a minimal number of steps. Also describe reproducibility (always, random ...).
### Configuration information
OS, OTB version or tag, information related to build (binaries, superbuild, system libs ...)
/label ~bug
### Target documentation ressources
Can be a combination of Software guide, cookbook, doxygen, blog, applications doc, websites
### Change requested
Describe precisely the changes that are required.
Short summary of the requested feature
/label ~feature
### What changes will be made and why they would make a better Orfeo ToolBox?
#### High level description
#### Risks and benefits
#### Alternatives for implementations
### Who will be developing the proposed changes?
### Summary
Gives a short summary of the changes.
### Rationale
Explain the rationale for the changes (possible link to a Request For Comments or to an issue).
### Implementation Details
#### Classes and files
Give an overview of the implementation: main changes made to classes, files and modules. Do not paste complete diff, as it is available in the merge request already.
#### Applications
Describe any changes made to existing applications, or new applications that have been added.
#### Tests
Describe the testing strategy for new features.
### Documentation
List or link documentation modifications that were made (doxygen, example, Software Guide, application documentation, CookBook).
### Additional notes
List remaining open issues if any, and additional notes.
### Copyright
The copyright owner is *COPYRIGHT OWNER (OR OWNER'S AGENT)* and has signed the ORFEO ToolBox Contributor License Agreement
......@@ -97,25 +97,43 @@ if(SHARK_CONFIG_FILE)
"${SHARK_VERSION_MAJOR}.${SHARK_VERSION_MINOR}.${SHARK_VERSION_PATCH}")
endif()
set(SHARK_USE_OPENMP_matched)
#define SHARK_USE_OPENMP
# Check if Shark was built with OpenMP, CBLAS, DYNLIB, ...
file(STRINGS "${SHARK_INCLUDE_DIR}/shark/Core/Shark.h" SHARK_H_CONTENTS)
string(REGEX MATCH
"#define.SHARK_USE_OPENMP"
SHARK_USE_OPENMP_matched "${SHARK_H_CONTENTS}")
if(SHARK_USE_OPENMP_matched)
if(NOT OTB_USE_OPENMP)
message(WARNING "Shark library is built with OpenMP and you have OTB_USE_OPENMP set to OFF.")
endif()
if(SHARK_H_CONTENTS MATCHES "#define.SHARK_USE_OPENMP")
set(SHARK_USE_OPENMP 1)
else()
set(SHARK_USE_OPENMP 0)
endif()
if(SHARK_H_CONTENTS MATCHES "#define.SHARK_USE_CBLAS")
set(SHARK_USE_CBLAS 1)
else()
set(SHARK_USE_CBLAS 0)
endif()
if(SHARK_H_CONTENTS MATCHES "#define.SHARK_USE_DYNLIB")
set(SHARK_USE_DYNLIB 1)
else()
set(SHARK_USE_DYNLIB 0)
endif()
if(SHARK_USE_CBLAS AND SHARK_USE_DYNLIB)
set(REQUIRED_CBLAS_LIB CBLAS_LIBRARY)
find_library(CBLAS_LIBRARY NAMES cblas)
else()
set(REQUIRED_CBLAS_LIB)
endif()
INCLUDE(${CMAKE_ROOT}/Modules/FindPackageHandleStandardArgs.cmake)
FIND_PACKAGE_HANDLE_STANDARD_ARGS(Shark
REQUIRED_VARS SHARK_LIBRARY SHARK_INCLUDE_DIR
REQUIRED_VARS SHARK_LIBRARY SHARK_INCLUDE_DIR ${REQUIRED_CBLAS_LIB}
VERSION_VAR SHARK_VERSION_STRING)
if(SHARK_FOUND)
set(SHARK_INCLUDE_DIRS ${SHARK_INCLUDE_DIR} ${Boost_INCLUDE_DIR} )
set(SHARK_LIBRARIES ${SHARK_LIBRARY} ${Boost_LIBRARIES} )
if(REQUIRED_CBLAS_LIB)
set(SHARK_LIBRARIES ${SHARK_LIBRARIES} ${CBLAS_LIBRARY})
endif()
endif()
......@@ -277,6 +277,12 @@ macro(otb_module_test)
foreach(dep IN LISTS OTB_MODULE_${otb-module-test}_DEPENDS)
list(APPEND ${otb-module-test}_LIBRARIES "${${dep}_LIBRARIES}")
endforeach()
# make sure the test can link with optional libs
foreach(dep IN LISTS OTB_MODULE_${otb-module}_OPTIONAL_DEPENDS)
if (${dep}_ENABLED)
list(APPEND ${otb-module-test}_LIBRARIES "${${dep}_LIBRARIES}")
endif()
endforeach()
endmacro()
macro(otb_module_warnings_disable)
......
......@@ -20,7 +20,7 @@
#
# Reset Qt I18N source files cache variable.
macro( reset_qt4_i18n_sources )
macro( reset_qt_i18n_sources )
set( OTB_QT_I18N_INCLUDE_PATH "" CACHE INTERNAL "" FORCE )
set( OTB_QT_I18N_HEADER_FILES "" CACHE INTERNAL "" FORCE )
set( OTB_QT_I18N_SOURCE_FILES "" CACHE INTERNAL "" FORCE )
......@@ -33,7 +33,7 @@ endmacro()
#
# Func
function( add_to_qt4_i18n_files RESULT )
function( add_to_qt_i18n_files RESULT )
foreach( F ${ARGN} )
#message( "${F}" )
......@@ -45,13 +45,13 @@ endfunction()
#
#
macro( add_to_qt4_i18n_include_path DIRECTORY )
macro( add_to_qt_i18n_include_path DIRECTORY )
set(OTB_I18N_INCLUDE_PATH ${OTB_I18N_INCLUDE_PATH} ${DIRECTORY} CACHE INTERNAL "")
endmacro()
#
#
macro( add_to_qt4_i18n_headers INCLUDE_DIR )
macro( add_to_qt_i18n_headers INCLUDE_DIR )
get_filename_component( ABS_INCLUDE_DIR ${INCLUDE_DIR} ABSOLUTE )
......@@ -68,20 +68,20 @@ endmacro()
#
# Add source files to Qt I18n translation build.
macro( add_to_qt4_i18n_sources )
add_to_qt4_i18n_files( OTB_QT_I18N_SOURCE_FILES ${ARGN} )
macro( add_to_qt_i18n_sources )
add_to_qt_i18n_files( OTB_QT_I18N_SOURCE_FILES ${ARGN} )
endmacro()
#
# Add source files to Qt I18n translation build.
macro( add_to_qt4_i18n_forms )
add_to_qt4_i18n_files( OTB_QT_I18N_FORM_FILES ${ARGN} )
macro( add_to_qt_i18n_forms )
add_to_qt_i18n_files( OTB_QT_I18N_FORM_FILES ${ARGN} )
endmacro()
#
#
macro( generate_qt4_project FILENAME )
message( STATUS "Generating Qt4 '${FILENAME}' project file for I18N." )
macro( generate_qt_project FILENAME )
message( STATUS "Generating Qt5 '${FILENAME}' project file for I18N." )