Members of the KDE Community are recommended to subscribe to the kde-community mailing list at https://mail.kde.org/mailman/listinfo/kde-community to allow them to participate in important discussions and receive other important announcements

Commit 05112455 authored by Boudewijn Rempt's avatar Boudewijn Rempt

Move all find_package calls to the toplevel CMakeLists.txt

This also gets rid of some duplicate dependency searches
parent bafe66e4
......@@ -294,7 +294,10 @@ set(CALLIGRA_PLUGIN_INSTALL_DIR ${LIB_INSTALL_DIR}/krita)
###########################
find_package(ZLIB REQUIRED)
macro_bool_to_01(ZLIB_FOUND HAVE_ZLIB)
find_package(PNG REQUIRED)
if (APPLE)
# this is not added correctly on OSX -- see http://forum.kde.org/viewtopic.php?f=139&t=101867&p=221242#p221242
include_directories(${PNG_INCLUDE_DIR})
......@@ -302,9 +305,6 @@ endif()
add_definitions(-DBOOST_ALL_NO_LIB)
find_package(Boost REQUIRED COMPONENTS system) # for pigment and stage
if (NOT Boost_FOUND)
message(FATAL_ERROR "Did not find Boost. Boost is required for the core libraries, stage, sheets and krita.")
endif ()
if (APPLE)
SET(CMAKE_CXX_FLAGS "-stdlib=libstdc++ -std=c++11")
......@@ -317,14 +317,40 @@ endif ()
############################
###########################
##
## Check for OpenEXR
##
macro_optional_find_package(OpenEXR)
macro_log_feature(OPENEXR_FOUND "OpenEXR" "High dynamic-range (HDR) image file format" "http://www.openexr.com" FALSE "" "Required by the Krita OpenEXR filter")
macro_bool_to_01(OPENEXR_FOUND HAVE_OPENEXR)
set(LINK_OPENEXR_LIB)
if(OPENEXR_FOUND)
include_directories(${OPENEXR_INCLUDE_DIR})
set(LINK_OPENEXR_LIB ${OPENEXR_LIBRARIES})
add_definitions(${OPENEXR_DEFINITIONS})
endif()
macro_optional_find_package(TIFF)
macro_log_feature(TIFF_FOUND "tiff" "TIFF Library and Utilities" "http://www.remotesensing.org/libtiff" FALSE "" "Required by the Krita TIFF filter")
macro_optional_find_package(JPEG)
macro_log_feature(JPEG_FOUND "jpeg" "Free library for JPEG image compression. Note: libjpeg8 is NOT supported." "http://www.libjpeg-turbo.org" FALSE "" "Required by the Krita JPEG filter")
macro_optional_find_package(OpenJPEG)
macro_log_feature(OPENJPEG_FOUND "openjpeg" "Free library for JPEG 2000 image compression" "http://www.openjpeg.org" FALSE "" "Required by the Krita JPEG 2000 filter")
set(LIBRAW_MIN_VERSION "0.16")
macro_optional_find_package(LibRaw ${LIBRAW_MIN_VERSION})
macro_log_feaure(LIBRAW_FOUND "LibRaw" "Library to decode RAW images" "http://www.libraw.org" FALSE "" "Required to build the raw import plugin")
macro_optional_find_package(FFTW3)
macro_log_feature(FFTW3_FOUND "FFTW3" "A fast, free C FFT library" "http://www.fftw.org/" FALSE "" "Required by the Krita for fast convolution operators and some G'Mic features")
macro_bool_to_01(FFTW3_FOUND HAVE_FFTW3)
macro_optional_find_package(OCIO)
macro_log_feature(OCIO_FOUND "OCIO" "The OpenColorIO Library" "http://www.opencolorio.org" FALSE "" "Required by the Krita LUT docker")
macro_bool_to_01(OCIO_FOUND HAVE_OCIO)
##
## Look for OpenGL
##
......@@ -337,6 +363,7 @@ if (USEOPENGL)
if(QT_QTOPENGL_FOUND)
message(STATUS "Found Qt OpenGL support")
set(HAVE_OPENGL 1)
include_directories(${OPENGL_INCLUDE_DIR})
else()
message(STATUS "Did NOT find Qt OpenGL support. Check your Qt configuration")
endif()
......@@ -350,8 +377,7 @@ endif()
## Test for GNU Scientific Library
##
macro_optional_find_package(GSL)
macro_log_feature(GSL_FOUND "GSL" "GNU Scientific Library" "http://www.gnu.org/software/gsl"
FALSE "1.7" "Required by Krita's Transform tool and Sheets' solver plugin")
macro_log_feature(GSL_FOUND "GSL" "GNU Scientific Library" "http://www.gnu.org/software/gsl" FALSE "1.7" "Required by Krita's Transform")
macro_bool_to_01(GSL_FOUND HAVE_GSL)
configure_file(config-gsl.h.cmake ${CMAKE_CURRENT_BINARY_DIR}/config-gsl.h )
......@@ -359,7 +385,7 @@ configure_file(config-gsl.h.cmake ${CMAKE_CURRENT_BINARY_DIR}/config-gsl.h )
## Test for eigen3
##
macro_optional_find_package(Eigen3)
macro_log_feature(EIGEN3_FOUND "Eigen" "C++ template library for linear algebra" "http://eigen.tuxfamily.org" FALSE "3.0" "Required by Calligra Sheets and Krita")
macro_log_feature(EIGEN3_FOUND "Eigen" "C++ template library for linear algebra" "http://eigen.tuxfamily.org" FALSE "3.0" "Required by Krita")
##
## Test for exiv2
......@@ -372,7 +398,7 @@ macro_log_feature(EXIV2_FOUND "Exiv2" "Image metadata library and tools" "http:/
## Test for lcms
##
macro_optional_find_package(LCMS2)
macro_log_feature(LCMS2_FOUND "LittleCMS" "Color management engine" "http://www.littlecms.com" FALSE "2.4" "Will be used for color management and is necesary for Krita")
macro_log_feature(LCMS2_FOUND "LittleCMS" "Color management engine" "http://www.littlecms.com" FALSE "2.4" "Will be used for color management and is necessary for Krita")
if(LCMS2_FOUND)
if(NOT ${LCMS2_VERSION} VERSION_LESS 2040 )
set(HAVE_LCMS24 TRUE)
......@@ -451,8 +477,8 @@ if(HAVE_VC)
endif()
if (NOT PACKAGERS_BUILD)
# Optimize the whole Calligra for current architecture
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} ${Vc_DEFINITIONS}")
# Optimize everything for the current architecture
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} ${Vc_DEFINITIONS}")
endif ()
endif()
set(CMAKE_MODULE_PATH ${OLD_CMAKE_MODULE_PATH} )
......@@ -469,17 +495,10 @@ endif()
add_definitions(${QT_DEFINITIONS} ${KDE4_DEFINITIONS} ${QT_QTDBUS_DEFINITIONS})
if(WIN32)
set(KDE4_ICON_DIR ${KDE_INSTALL_FULL_ICONDIR})
message(STATUS "using oxygen application icons from ${KDE4_ICON_DIR}")
set(LIB_INSTALL_DIR ${LIB_INSTALL_DIR}
RUNTIME DESTINATION ${BIN_INSTALL_DIR}
LIBRARY ${INSTALL_TARGETS_DEFAULT_ARGS}
ARCHIVE ${INSTALL_TARGETS_DEFAULT_ARGS} )
else()
set (KDE4_ICON_DIR ${CMAKE_INSTALL_PREFIX}/share/icons)
endif()
##
......@@ -500,10 +519,23 @@ macro_log_feature(SHARED_MIME_INFO_FOUND "SharedMimeInfo" "Shared Mime Info" "ht
macro_optional_find_package(Poppler)
macro_log_feature( POPPLER_FOUND "Poppler-Qt5" "A PDF rendering library" "http://poppler.freedesktop.org" FALSE "" "Required by the Krita PDF filter, Karbon PDF import filter and CSTester PDF feature")
##
## Test for pthreads (for G'Mic)
##
macro_optional_find_package(Threads)
macro_log_feature(Threads_FOUND "PThreads" "A low-level threading library" "" FALSE "" "Optionally used by the G'Mic plugin")
##
## Test for OpenMP (for G'Mic)
##
macro_optional_find_package(OpenMP)
macro_log_feature(OPENMP_FOUND "OpenMP" "A low-level parallel execution library" "http://openmp.org/wp/" FALSE "" "Optionally used by the G'Mic plugin"
##
## Generate a file for prefix information
## Test for Curl (for G'Mic)
##
macro_optional_find_package(CURL)
macro_log_feature(CURL_FOUND "CURL" "A tool to fetch remote data" "http://curl.haxx.se/" FALSE "" "Optionally used by the G'Mic plugin"
###############################
################################
......
......@@ -42,12 +42,12 @@ if(MSVC OR (WIN32 AND "${CMAKE_CXX_COMPILER_ID}" STREQUAL "Intel"))
# set(CMAKE_CXX_STACK_SIZE "999999999")
endif()
macro_optional_find_package(FFTW3)
macro_log_feature(FFTW3_FOUND "FFTW3" "A fast, free C FFT library" "http://www.fftw.org/" FALSE "" "Required by the Krita for fast convolution operators")
macro_bool_to_01(FFTW3_FOUND HAVE_FFTW3)
configure_file(image/config_convolution.h.cmake ${CMAKE_CURRENT_BINARY_DIR}/image/config_convolution.h)
configure_file(config-ocio.h.cmake ${CMAKE_CURRENT_BINARY_DIR}/config-ocio.h )
include(CheckFunctionExists)
check_function_exists(powf HAVE_POWF)
configure_file(${CMAKE_CURRENT_SOURCE_DIR}/config-powf.h.cmake ${CMAKE_CURRENT_BINARY_DIR}/config-powf.h)
if(HAVE_OPENGL)
message(STATUS "OpenGL found -- krita will be able to use OpenGL for hardware accelerated rendering.")
......@@ -55,26 +55,10 @@ else()
message(STATUS "OpenGL NOT found - krita will not be able to use OpenGL for hardware accelerated rendering.")
endif()
macro_optional_find_package(OCIO)
macro_log_feature(OCIO_FOUND "OCIO" "The OpenColorIO Library" "http://www.opencolorio.org" FALSE "" "Required by the Krita LUT docker")
macro_bool_to_01(OCIO_FOUND HAVE_OCIO)
configure_file(config-ocio.h.cmake ${CMAKE_CURRENT_BINARY_DIR}/config-ocio.h )
if(UNIX)
set(CMAKE_REQUIRED_LIBRARIES "${CMAKE_REQUIRED_LIBRARIES};m")
endif()
check_function_exists(powf HAVE_POWF)
configure_file(${CMAKE_CURRENT_SOURCE_DIR}/config-powf.h.cmake ${CMAKE_CURRENT_BINARY_DIR}/config-powf.h)
set(LINK_OPENEXR_LIB)
if(OPENEXR_FOUND)
include_directories(${OPENEXR_INCLUDE_DIR})
set(LINK_OPENEXR_LIB ${OPENEXR_LIBRARIES})
add_definitions(${OPENEXR_DEFINITIONS})
endif()
if(WIN32)
if(MSVC)
# C4522: 'class' : multiple assignment operators specified
......@@ -120,10 +104,6 @@ set(KRITA_INCLUDES
include_directories(${KRITA_INCLUDES})
if(HAVE_OPENGL)
include_directories(${OPENGL_INCLUDE_DIR})
endif()
add_subdirectory( libglobal )
add_subdirectory( libpsd )
add_subdirectory( image )
......
......@@ -23,8 +23,7 @@ set(kritagemini_SRCS
if (WIN32)
set(kritagemini_SRCS ${kritagemini_SRCS} KritaGeminiWin.rc)
else ()
file(GLOB ICONS_SRCS "${KDE4_ICON_DIR}/oxygen/*/apps/kritagemini.png")
ecm_add_app_icon(kritagemini_SRCS ICONS ${ICONS_SRCS})
ecm_add_app_icon(kritagemini_SRCS ICONS kritagemini.png)
endif ()
# Krita Gemini application
......
......@@ -33,14 +33,13 @@ set(gmic_headers_SRCS
${GMIC_SOURCE_DIR}/gmic.h
)
# Mandatory flags
sModelIndexConverterShowAll# Mandatory flags
add_definitions(-Dgmic_gimp)
add_definitions(-Dgmic_build)
add_definitions(-Dgmic_float_only)
add_definitions(-Dcimg_use_vt100 )
# PARALLEL
find_package(Threads)
if (Threads_FOUND)
message("G'Mic: using pthreads")
add_definitions(-Dgmic_is_parallel)
......@@ -48,7 +47,6 @@ if (Threads_FOUND)
endif()
#OpenMP
find_package(OpenMP)
if(OPENMP_FOUND)
message("G'Mic: using OpenMP")
set (CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} ${OpenMP_CXX_FLAGS}")
......@@ -70,15 +68,13 @@ if (PNG_FOUND)
endif()
# ZLIB
find_package( ZLIB REQUIRED )
if ( ZLIB_FOUND )
if (ZLIB_FOUND)
add_definitions(-Dcimg_use_zlib)
include_directories( ${ZLIB_INCLUDE_DIRS} )
endif()
# CURL
find_package(CURL)
if (CURL_FOUND)
message("G'Mic: using Curl")
add_definitions(-Dcimg_use_curl)
......
......@@ -4,30 +4,6 @@ if(CMAKE_SIZEOF_VOID_P EQUAL 4)
add_definitions( -DCPU_32_BITS )
endif()
macro_optional_find_package(PNG)
macro_log_feature(PNG_FOUND "png" "Official PNG reference library" "http://www.libpng.org/pub/png/libpng.html" FALSE "" "Required by the Krita PNG filter")
macro_optional_find_package(OpenEXR)
macro_log_feature(OPENEXR_FOUND "OpenEXR" "High dynamic-range (HDR) image file format" "http://www.openexr.com" FALSE "" "Required by the Krita OpenEXR filter")
macro_optional_find_package(TIFF)
macro_log_feature(TIFF_FOUND "tiff" "TIFF Library and Utilities" "http://www.remotesensing.org/libtiff" FALSE "" "Required by the Krita TIFF filter")
macro_optional_find_package(JPEG)
macro_log_feature(JPEG_FOUND "jpeg" "Free library for JPEG image compression. Note: libjpeg8 is NOT supported." "http://www.libjpeg-turbo.org" FALSE "" "Required by the Krita JPEG filter")
macro_optional_find_package(OpenJPEG)
macro_log_feature(OPENJPEG_FOUND "openjpeg" "Free library for JPEG 2000 image compression" "http://www.openjpeg.org" FALSE "" "Required by the Krita JPEG 2000 filter")
set(LIBRAW_MIN_VERSION "0.16")
find_package(LibRaw ${LIBRAW_MIN_VERSION})
set_package_properties("LibRaw" PROPERTIES
DESCRIPTION "Required to build libkdcraw"
URL "http://www.libraw.org"
TYPE RECOMMENDED
PURPOSE "Library to decode RAW image"
)
if(JPEG_FOUND AND HAVE_LCMS2)
add_subdirectory(jpeg)
endif()
......
add_subdirectory(tests)
macro_optional_find_package(ZLIB)
macro_bool_to_01(ZLIB_FOUND HAVE_ZLIB)
configure_file(config_psd.h.cmake ${CMAKE_CURRENT_BINARY_DIR}/config_psd.h)
include_directories(${ZLIB_INCLUDE_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