Commit 3eb3731b authored by Gilles Caulier's avatar Gilles Caulier 🗼
Browse files

restore openmp detection for libraw which has disapear while porting code from 5.9.0 and 6.0.0

parent 8cf55d34
......@@ -466,6 +466,15 @@ message(STATUS "--------------------------------------------------")
message(STATUS "digiKam RawEngine dependencies checks:")
message(STATUS "")
include(MacroOpenMP)
DETECT_OPENMP()
if(OPENMP_FOUND)
message(STATUS "RawEngine will be compiled with OpenMP support")
else()
message(STATUS "RawEngine will not be compiled with OpenMP support")
endif()
# Flag to use libjasper with LibRaw RedCine codec
if(Jasper_FOUND)
......@@ -506,6 +515,7 @@ set(PTHREADS_FOUND (CMAKE_USE_PTHREADS_INIT OR CMAKE_USE_WIN32_THREADS_INIT))
# Registration of Libraw configuration to a dedicated header
MACRO_BOOL_TO_01(JPEG8_FOUND LIBRAW_USE_DNGLOSSYCODEC)
MACRO_BOOL_TO_01(OPENMP_FOUND LIBRAW_USE_OPENMP)
MACRO_BOOL_TO_01(Jasper_FOUND LIBRAW_USE_REDCINECODEC)
configure_file(${CMAKE_CURRENT_SOURCE_DIR}/libs/rawengine/libraw/libraw_config.h.cmake
......
# A macro wrapper to find OpenMP library
#
# Syntax: DETECT_OPENMP()
#
# Once done this will be adjusted:
#
# OPENMP_FOUND - openMP detection flag
# OpenMP_CXX_FLAGS - flags to add to the CXX compiler for OpenMP support
#
# Copyright (c) 2010-2019, Gilles Caulier, <caulier dot gilles at gmail dot com>
#
# Redistribution and use is allowed according to the terms of the BSD license.
# For details see the accompanying COPYING-CMAKE-SCRIPTS file.
macro(DETECT_OPENMP)
message(STATUS "Looking for OpenMP")
# NOTE: OpenMP under MacOSX do not support multithreading.
if(NOT APPLE)
find_package(OpenMP)
if(OPENMP_FOUND)
# Adjust some compiler flags depending of Operating system, that standard cmake find script do not set.
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} ${OpenMP_CXX_FLAGS}")
if("${OpenMP_CXX_FLAGS}" STREQUAL "-fopenmp")
set(OPENMP_LDFLAGS "-lgomp")
endif()
if("${OpenMP_CXX_FLAGS}" STREQUAL "-xopenmp")
set(OPENMP_LDFLAGS "-xopenmp")
endif()
message(STATUS "OpenMP found with CXX flags: ${OpenMP_CXX_FLAGS}")
else()
message(STATUS "OpenMP not found")
endif()
else()
message(STATUS "OpenMP under OSX do not support multithreading.")
message(STATUS "OpenMP detection is disabled.")
set(OPENMP_FOUND FALSE)
endif()
endmacro()
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