Commit 0cb12e2c authored by Guillaume Pasero's avatar Guillaume Pasero

COMP: enhance Shark detection with cblas, dynlib,...

parent c32d3088
......@@ -97,17 +97,25 @@ 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()
INCLUDE(${CMAKE_ROOT}/Modules/FindPackageHandleStandardArgs.cmake)
......
......@@ -20,4 +20,8 @@
find_package ( Shark REQUIRED )
if(SHARK_USE_OPENMP AND NOT OTB_USE_OPENMP)
message(WARNING "Shark library is built with OpenMP and you have OTB_USE_OPENMP set to OFF.")
endif()
mark_as_advanced( Shark_DIR )
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment