Date: Friday, June 17, 2022 @ 14:06:41 Author: arojas Revision: 1238296
archrelease: copy trunk to community-x86_64 Added: gmic/repos/community-x86_64/CMakeLists.txt (from rev 1238295, gmic/trunk/CMakeLists.txt) gmic/repos/community-x86_64/FindCImg.cmake (from rev 1238295, gmic/trunk/FindCImg.cmake) gmic/repos/community-x86_64/FindGMicStdlib.cmake (from rev 1238295, gmic/trunk/FindGMicStdlib.cmake) gmic/repos/community-x86_64/PKGBUILD (from rev 1238295, gmic/trunk/PKGBUILD) Deleted: gmic/repos/community-x86_64/CMakeLists.txt gmic/repos/community-x86_64/FindCImg.cmake gmic/repos/community-x86_64/FindGMicStdlib.cmake gmic/repos/community-x86_64/PKGBUILD ----------------------+ CMakeLists.txt | 478 ++++++++++++++++++++++++------------------------- FindCImg.cmake | 338 +++++++++++++++++----------------- FindGMicStdlib.cmake | 50 ++--- PKGBUILD | 144 +++++++------- 4 files changed, 505 insertions(+), 505 deletions(-) Deleted: CMakeLists.txt =================================================================== --- CMakeLists.txt 2022-06-17 14:06:26 UTC (rev 1238295) +++ CMakeLists.txt 2022-06-17 14:06:41 UTC (rev 1238296) @@ -1,239 +0,0 @@ -# -# File : CMakeLists.txt -# ( cmake-based build system configuration file ) -# -# Basic usage : -# -# - cmake . -# - make -# -# ( https://gmic.eu ) -# -# Author : Sander Knopper -# ( https://github.com/saknopper ) -# -# Based on work by Ștefan Talpalaru -# ( https://github.com/stefantalpalaru ) -# -# Licenses : This file is 'dual-licensed', you have to choose one -# of the two licenses below to apply. -# -# CeCILL-C -# The CeCILL-C license is close to the GNU LGPL. -# ( http://cecill.info/licences/Licence_CeCILL-C_V1-en.html ) -# -# or CeCILL v2.1 -# The CeCILL license is compatible with the GNU GPL. -# ( http://cecill.info/licences/Licence_CeCILL_V2.1-en.html ) -# -# This software is governed either by the CeCILL or the CeCILL-C license -# under French law and abiding by the rules of distribution of free software. -# You can use, modify and or redistribute the software under the terms of -# the CeCILL or CeCILL-C licenses as circulated by CEA, CNRS and INRIA -# at the following URL: "http://cecill.info". -# -# As a counterpart to the access to the source code and rights to copy, -# modify and redistribute granted by the license, users are provided only -# with a limited warranty and the software's author, the holder of the -# economic rights, and the successive licensors have only limited -# liability. -# -# In this respect, the user's attention is drawn to the risks associated -# with loading, using, modifying and/or developing or reproducing the -# software by the user in light of its specific status of free software, -# that may mean that it is complicated to manipulate, and that also -# therefore means that it is reserved for developers and experienced -# professionals having in-depth computer knowledge. Users are therefore -# encouraged to load and test the software's suitability as regards their -# requirements in conditions enabling the security of their systems and/or -# data to be ensured and, more generally, to use and operate it in the -# same conditions as regards security. -# -# The fact that you are presently reading this means that you have had -# knowledge of the CeCILL and CeCILL-C licenses and that you accept its terms. -# - -cmake_minimum_required(VERSION 3.14.0) - -if(CMAKE_SOURCE_DIR STREQUAL CMAKE_BINARY_DIR) - message("Build directory is equal to source directory. Binaries will be put in the src directory.") - message("") - - set(CMAKE_RUNTIME_OUTPUT_DIRECTORY "${CMAKE_SOURCE_DIR}/src/" CACHE FILEPATH "Output directory for all targets." FORCE) - set(GMIC_BINARIES_PATH ${CMAKE_RUNTIME_OUTPUT_DIRECTORY}) -else() - set(GMIC_BINARIES_PATH ${CMAKE_BINARY_DIR}) -endif() - -set(CMAKE_CXX_STANDARD 11) -set(CXX_STANDARD_REQUIRED ON) - -project(gmic CXX C) - -set(CMAKE_MODULE_PATH ${CMAKE_MODULE_PATH} "${CMAKE_CURRENT_SOURCE_DIR}/cmake") - -find_package(PkgConfig) -include(FeatureSummary) -include(GNUInstallDirs) - -find_package(CImg REQUIRED) -find_package(GMicStdlib REQUIRED) - -# options controlling the build process -option(BUILD_LIB "Build the GMIC shared library" ON) -option(BUILD_LIB_STATIC "Build the GMIC static library" ON) -option(BUILD_CLI "Build the CLI interface" ON) -option(BUILD_MAN "Build the manpage" ON) -option(BUILD_BASH_COMPLETION "Build Bash completion" ON) -option(CUSTOM_CFLAGS "Override default compiler optimization flags" OFF) -option(ENABLE_DYNAMIC_LINKING "Dynamically link the binaries to the GMIC shared library" OFF) -option(ENABLE_LTO "Enable -flto (Link Time Optimizer) on gcc and clang" OFF) - -if(NOT CMAKE_BUILD_TYPE) - set(CMAKE_BUILD_TYPE Release) -endif() - -# compile flags -set(CMAKE_POSITION_INDEPENDENT_CODE True) - -list(APPEND GMIC_CXX_COMPILE_FLAGS -Dcimg_use_vt100 -Dgmic_is_parallel -Dcimg_use_abort) -if(APPLE) - list(APPEND GMIC_CXX_COMPILE_FLAGS -mmacosx-version-min=10.8 -stdlib=libc++ -Wno-error=c++11-narrowing -Wc++11-extensions -fpermissive) -elseif(CMAKE_CXX_COMPILER_ID STREQUAL "Clang") - list(APPEND GMIC_CXX_COMPILE_FLAGS -Wno-error=c++11-narrowing -fpermissive) -else() - list(APPEND GMIC_CXX_COMPILE_FLAGS -Wno-error=narrowing -fno-ipa-sra -fpermissive) -endif() - -if(NOT "${PRERELEASE_TAG}" STREQUAL "") - list(APPEND GMIC_CXX_COMPILE_FLAGS "-Dgmic_prerelease=\"${PRERELEASE_TAG}\"") -endif() - -if (ENABLE_LTO) - # https://stackoverflow.com/a/47370726/160386 - include(CheckIPOSupported) - check_ipo_supported(RESULT supported OUTPUT error) - if(supported) - message(STATUS "IPO / LTO enabled") - set(CMAKE_INTERPROCEDURAL_OPTIMIZATION TRUE) - else() - message(STATUS "IPO / LTO not supported: <${error}>") - endif() -endif() - -if(ENABLE_DYNAMIC_LINKING) - if(NOT BUILD_LIB) - message(FATAL_ERROR "ENABLE_DYNAMIC_LINKING needs BUILD_LIB") - endif() - set(CMAKE_SKIP_RPATH TRUE) -endif() - -string(TOLOWER "${CMAKE_BUILD_TYPE}" CMAKE_BUILD_TYPE_LOWER) -if (${CMAKE_BUILD_TYPE_LOWER} STREQUAL "debug") - list(PREPEND GMIC_CXX_COMPILE_FLAGS -g -ansi -Wall -Wextra -pedantic -Dcimg_verbosity=3) -endif() -if (${CMAKE_BUILD_TYPE_LOWER} STREQUAL "relwithdebinfo") - list(PREPEND GMIC_CXX_COMPILE_FLAGS -g) -endif() - -if (NOT CUSTOM_CFLAGS) - if (${CMAKE_BUILD_TYPE_LOWER} STREQUAL "debug") - list(PREPEND GMIC_CXX_COMPILE_FLAGS -Og) - else() - list(PREPEND GMIC_CXX_COMPILE_FLAGS -Ofast) - endif() -endif() - -# source files -set(CLI_Sources src/gmic.cpp) - -if(BUILD_LIB) - add_library(libgmic SHARED ${CLI_Sources}) - target_compile_options(libgmic PRIVATE ${GMIC_CXX_COMPILE_FLAGS} -Dgmic_core) - set_target_properties(libgmic PROPERTIES SOVERSION "1" OUTPUT_NAME "gmic") - target_link_libraries(libgmic - CImg::CImg - GMicStdlib::Stdlib - ) - target_include_directories(libgmic - PUBLIC - $<INSTALL_INTERFACE:include> - $<BUILD_INTERFACE:${CMAKE_CURRENT_SOURCE_DIR}/src> - ) - - install(TARGETS libgmic EXPORT GmicTargets - PUBLIC_HEADER DESTINATION "${CMAKE_INSTALL_LIBDIR}" - LIBRARY DESTINATION "${CMAKE_INSTALL_LIBDIR}" - RUNTIME DESTINATION "${CMAKE_INSTALL_BINDIR}" - ARCHIVE DESTINATION "${CMAKE_INSTALL_LIBDIR}" - ) - install(FILES src/gmic.h src/CImg.h DESTINATION "${CMAKE_INSTALL_INCLUDEDIR}") -endif() - - -if(BUILD_LIB_STATIC) - add_library(libgmicstatic STATIC ${CLI_Sources}) - target_compile_options(libgmicstatic PRIVATE ${GMIC_CXX_COMPILE_FLAGS} -Dgmic_core) - set_target_properties(libgmicstatic PROPERTIES OUTPUT_NAME "gmic") - target_link_libraries(libgmicstatic - CImg::CImg - GMicStdlib::Stdlib - ) - target_include_directories(libgmicstatic - PUBLIC - $<INSTALL_INTERFACE:include> - $<BUILD_INTERFACE:${CMAKE_CURRENT_SOURCE_DIR}/src> - ) - - install(TARGETS libgmicstatic EXPORT GmicTargets ARCHIVE DESTINATION "${CMAKE_INSTALL_LIBDIR}") - install(FILES src/gmic.h DESTINATION "${CMAKE_INSTALL_INCLUDEDIR}") -endif() - - -if(BUILD_CLI) - add_executable(gmic src/gmic_cli.cpp) - target_compile_options(gmic PRIVATE ${GMIC_CXX_COMPILE_FLAGS}) - if(ENABLE_DYNAMIC_LINKING) - target_link_libraries(gmic libgmic) - else() - target_link_libraries(gmic libgmicstatic) - endif() - - install(TARGETS gmic RUNTIME DESTINATION bin LIBRARY DESTINATION lib) -endif() - -if(BUILD_MAN) - file(MAKE_DIRECTORY ${CMAKE_BINARY_DIR}/man) - add_custom_command( - OUTPUT ${CMAKE_BINARY_DIR}/man/gmic.1 - DEPENDS gmic - COMMAND LD_LIBRARY_PATH=${GMIC_BINARIES_PATH} ${GMIC_BINARIES_PATH}/gmic ${CMAKE_SOURCE_DIR}/src/gmic_stdlib.gmic it ${CMAKE_SOURCE_DIR}/src/gmic_stdlib.gmic reference man > ${CMAKE_BINARY_DIR}/man/gmic.1 - ) - add_custom_target(man ALL DEPENDS ${CMAKE_BINARY_DIR}/man/gmic.1) - install(FILES ${CMAKE_BINARY_DIR}/man/gmic.1 DESTINATION ${CMAKE_INSTALL_MANDIR}/man1/) -endif() - -if(BUILD_BASH_COMPLETION) - file(MAKE_DIRECTORY ${CMAKE_BINARY_DIR}/resources) - add_custom_command( - OUTPUT ${CMAKE_BINARY_DIR}/resources/gmic_bashcompletion.sh - DEPENDS gmic - COMMAND LD_LIBRARY_PATH=${GMIC_BINARIES_PATH} ${GMIC_BINARIES_PATH}/gmic ${CMAKE_SOURCE_DIR}/src/gmic_stdlib.gmic it ${CMAKE_SOURCE_DIR}/src/gmic_stdlib.gmic parse_cli bashcompletion > ${CMAKE_BINARY_DIR}/resources/gmic_bashcompletion.sh - ) - add_custom_target(bashcompletion ALL DEPENDS ${CMAKE_BINARY_DIR}/resources/gmic_bashcompletion.sh) - install(FILES ${CMAKE_BINARY_DIR}/resources/gmic_bashcompletion.sh - DESTINATION ${CMAKE_INSTALL_DATADIR}/bash-completion/completions - RENAME gmic - ) -endif() - -include(CMakePackageConfigHelpers) -file(WRITE "${CMAKE_CURRENT_BINARY_DIR}/GmicConfig.cmake.in" "@PACKAGE_INIT@\ninclude(\${CMAKE_CURRENT_LIST_DIR}/GmicTargets.cmake)\n") -configure_package_config_file( - ${CMAKE_CURRENT_BINARY_DIR}/GmicConfig.cmake.in - ${CMAKE_CURRENT_BINARY_DIR}/GmicConfig.cmake - INSTALL_DESTINATION ${CMAKE_INSTALL_LIBDIR}/cmake/gmic -) -install(EXPORT GmicTargets DESTINATION ${CMAKE_INSTALL_LIBDIR}/cmake/gmic) -install(FILES ${CMAKE_CURRENT_BINARY_DIR}/GmicConfig.cmake DESTINATION ${CMAKE_INSTALL_LIBDIR}/cmake/gmic) -feature_summary(WHAT ALL) Copied: gmic/repos/community-x86_64/CMakeLists.txt (from rev 1238295, gmic/trunk/CMakeLists.txt) =================================================================== --- CMakeLists.txt (rev 0) +++ CMakeLists.txt 2022-06-17 14:06:41 UTC (rev 1238296) @@ -0,0 +1,239 @@ +# +# File : CMakeLists.txt +# ( cmake-based build system configuration file ) +# +# Basic usage : +# +# - cmake . +# - make +# +# ( https://gmic.eu ) +# +# Author : Sander Knopper +# ( https://github.com/saknopper ) +# +# Based on work by Ștefan Talpalaru +# ( https://github.com/stefantalpalaru ) +# +# Licenses : This file is 'dual-licensed', you have to choose one +# of the two licenses below to apply. +# +# CeCILL-C +# The CeCILL-C license is close to the GNU LGPL. +# ( http://cecill.info/licences/Licence_CeCILL-C_V1-en.html ) +# +# or CeCILL v2.1 +# The CeCILL license is compatible with the GNU GPL. +# ( http://cecill.info/licences/Licence_CeCILL_V2.1-en.html ) +# +# This software is governed either by the CeCILL or the CeCILL-C license +# under French law and abiding by the rules of distribution of free software. +# You can use, modify and or redistribute the software under the terms of +# the CeCILL or CeCILL-C licenses as circulated by CEA, CNRS and INRIA +# at the following URL: "http://cecill.info". +# +# As a counterpart to the access to the source code and rights to copy, +# modify and redistribute granted by the license, users are provided only +# with a limited warranty and the software's author, the holder of the +# economic rights, and the successive licensors have only limited +# liability. +# +# In this respect, the user's attention is drawn to the risks associated +# with loading, using, modifying and/or developing or reproducing the +# software by the user in light of its specific status of free software, +# that may mean that it is complicated to manipulate, and that also +# therefore means that it is reserved for developers and experienced +# professionals having in-depth computer knowledge. Users are therefore +# encouraged to load and test the software's suitability as regards their +# requirements in conditions enabling the security of their systems and/or +# data to be ensured and, more generally, to use and operate it in the +# same conditions as regards security. +# +# The fact that you are presently reading this means that you have had +# knowledge of the CeCILL and CeCILL-C licenses and that you accept its terms. +# + +cmake_minimum_required(VERSION 3.14.0) + +if(CMAKE_SOURCE_DIR STREQUAL CMAKE_BINARY_DIR) + message("Build directory is equal to source directory. Binaries will be put in the src directory.") + message("") + + set(CMAKE_RUNTIME_OUTPUT_DIRECTORY "${CMAKE_SOURCE_DIR}/src/" CACHE FILEPATH "Output directory for all targets." FORCE) + set(GMIC_BINARIES_PATH ${CMAKE_RUNTIME_OUTPUT_DIRECTORY}) +else() + set(GMIC_BINARIES_PATH ${CMAKE_BINARY_DIR}) +endif() + +set(CMAKE_CXX_STANDARD 11) +set(CXX_STANDARD_REQUIRED ON) + +project(gmic CXX C) + +set(CMAKE_MODULE_PATH ${CMAKE_MODULE_PATH} "${CMAKE_CURRENT_SOURCE_DIR}/cmake") + +find_package(PkgConfig) +include(FeatureSummary) +include(GNUInstallDirs) + +find_package(CImg REQUIRED) +find_package(GMicStdlib REQUIRED) + +# options controlling the build process +option(BUILD_LIB "Build the GMIC shared library" ON) +option(BUILD_LIB_STATIC "Build the GMIC static library" ON) +option(BUILD_CLI "Build the CLI interface" ON) +option(BUILD_MAN "Build the manpage" ON) +option(BUILD_BASH_COMPLETION "Build Bash completion" ON) +option(CUSTOM_CFLAGS "Override default compiler optimization flags" OFF) +option(ENABLE_DYNAMIC_LINKING "Dynamically link the binaries to the GMIC shared library" OFF) +option(ENABLE_LTO "Enable -flto (Link Time Optimizer) on gcc and clang" OFF) + +if(NOT CMAKE_BUILD_TYPE) + set(CMAKE_BUILD_TYPE Release) +endif() + +# compile flags +set(CMAKE_POSITION_INDEPENDENT_CODE True) + +list(APPEND GMIC_CXX_COMPILE_FLAGS -Dcimg_use_vt100 -Dgmic_is_parallel -Dcimg_use_abort) +if(APPLE) + list(APPEND GMIC_CXX_COMPILE_FLAGS -mmacosx-version-min=10.8 -stdlib=libc++ -Wno-error=c++11-narrowing -Wc++11-extensions -fpermissive) +elseif(CMAKE_CXX_COMPILER_ID STREQUAL "Clang") + list(APPEND GMIC_CXX_COMPILE_FLAGS -Wno-error=c++11-narrowing -fpermissive) +else() + list(APPEND GMIC_CXX_COMPILE_FLAGS -Wno-error=narrowing -fno-ipa-sra -fpermissive) +endif() + +if(NOT "${PRERELEASE_TAG}" STREQUAL "") + list(APPEND GMIC_CXX_COMPILE_FLAGS "-Dgmic_prerelease=\"${PRERELEASE_TAG}\"") +endif() + +if (ENABLE_LTO) + # https://stackoverflow.com/a/47370726/160386 + include(CheckIPOSupported) + check_ipo_supported(RESULT supported OUTPUT error) + if(supported) + message(STATUS "IPO / LTO enabled") + set(CMAKE_INTERPROCEDURAL_OPTIMIZATION TRUE) + else() + message(STATUS "IPO / LTO not supported: <${error}>") + endif() +endif() + +if(ENABLE_DYNAMIC_LINKING) + if(NOT BUILD_LIB) + message(FATAL_ERROR "ENABLE_DYNAMIC_LINKING needs BUILD_LIB") + endif() + set(CMAKE_SKIP_RPATH TRUE) +endif() + +string(TOLOWER "${CMAKE_BUILD_TYPE}" CMAKE_BUILD_TYPE_LOWER) +if (${CMAKE_BUILD_TYPE_LOWER} STREQUAL "debug") + list(PREPEND GMIC_CXX_COMPILE_FLAGS -g -ansi -Wall -Wextra -pedantic -Dcimg_verbosity=3) +endif() +if (${CMAKE_BUILD_TYPE_LOWER} STREQUAL "relwithdebinfo") + list(PREPEND GMIC_CXX_COMPILE_FLAGS -g) +endif() + +if (NOT CUSTOM_CFLAGS) + if (${CMAKE_BUILD_TYPE_LOWER} STREQUAL "debug") + list(PREPEND GMIC_CXX_COMPILE_FLAGS -Og) + else() + list(PREPEND GMIC_CXX_COMPILE_FLAGS -Ofast) + endif() +endif() + +# source files +set(CLI_Sources src/gmic.cpp) + +if(BUILD_LIB) + add_library(libgmic SHARED ${CLI_Sources}) + target_compile_options(libgmic PRIVATE ${GMIC_CXX_COMPILE_FLAGS} -Dgmic_core) + set_target_properties(libgmic PROPERTIES SOVERSION "1" OUTPUT_NAME "gmic") + target_link_libraries(libgmic + CImg::CImg + GMicStdlib::Stdlib + ) + target_include_directories(libgmic + PUBLIC + $<INSTALL_INTERFACE:include> + $<BUILD_INTERFACE:${CMAKE_CURRENT_SOURCE_DIR}/src> + ) + + install(TARGETS libgmic EXPORT GmicTargets + PUBLIC_HEADER DESTINATION "${CMAKE_INSTALL_LIBDIR}" + LIBRARY DESTINATION "${CMAKE_INSTALL_LIBDIR}" + RUNTIME DESTINATION "${CMAKE_INSTALL_BINDIR}" + ARCHIVE DESTINATION "${CMAKE_INSTALL_LIBDIR}" + ) + install(FILES src/gmic.h src/CImg.h DESTINATION "${CMAKE_INSTALL_INCLUDEDIR}") +endif() + + +if(BUILD_LIB_STATIC) + add_library(libgmicstatic STATIC ${CLI_Sources}) + target_compile_options(libgmicstatic PRIVATE ${GMIC_CXX_COMPILE_FLAGS} -Dgmic_core) + set_target_properties(libgmicstatic PROPERTIES OUTPUT_NAME "gmic") + target_link_libraries(libgmicstatic + CImg::CImg + GMicStdlib::Stdlib + ) + target_include_directories(libgmicstatic + PUBLIC + $<INSTALL_INTERFACE:include> + $<BUILD_INTERFACE:${CMAKE_CURRENT_SOURCE_DIR}/src> + ) + + install(TARGETS libgmicstatic EXPORT GmicTargets ARCHIVE DESTINATION "${CMAKE_INSTALL_LIBDIR}") + install(FILES src/gmic.h DESTINATION "${CMAKE_INSTALL_INCLUDEDIR}") +endif() + + +if(BUILD_CLI) + add_executable(gmic src/gmic_cli.cpp) + target_compile_options(gmic PRIVATE ${GMIC_CXX_COMPILE_FLAGS}) + if(ENABLE_DYNAMIC_LINKING) + target_link_libraries(gmic libgmic) + else() + target_link_libraries(gmic libgmicstatic) + endif() + + install(TARGETS gmic RUNTIME DESTINATION bin LIBRARY DESTINATION lib) +endif() + +if(BUILD_MAN) + file(MAKE_DIRECTORY ${CMAKE_BINARY_DIR}/man) + add_custom_command( + OUTPUT ${CMAKE_BINARY_DIR}/man/gmic.1 + DEPENDS gmic + COMMAND LD_LIBRARY_PATH=${GMIC_BINARIES_PATH} ${GMIC_BINARIES_PATH}/gmic ${CMAKE_SOURCE_DIR}/src/gmic_stdlib.gmic it ${CMAKE_SOURCE_DIR}/src/gmic_stdlib.gmic reference man > ${CMAKE_BINARY_DIR}/man/gmic.1 + ) + add_custom_target(man ALL DEPENDS ${CMAKE_BINARY_DIR}/man/gmic.1) + install(FILES ${CMAKE_BINARY_DIR}/man/gmic.1 DESTINATION ${CMAKE_INSTALL_MANDIR}/man1/) +endif() + +if(BUILD_BASH_COMPLETION) + file(MAKE_DIRECTORY ${CMAKE_BINARY_DIR}/resources) + add_custom_command( + OUTPUT ${CMAKE_BINARY_DIR}/resources/gmic_bashcompletion.sh + DEPENDS gmic + COMMAND LD_LIBRARY_PATH=${GMIC_BINARIES_PATH} ${GMIC_BINARIES_PATH}/gmic ${CMAKE_SOURCE_DIR}/src/gmic_stdlib.gmic it ${CMAKE_SOURCE_DIR}/src/gmic_stdlib.gmic parse_cli bashcompletion > ${CMAKE_BINARY_DIR}/resources/gmic_bashcompletion.sh + ) + add_custom_target(bashcompletion ALL DEPENDS ${CMAKE_BINARY_DIR}/resources/gmic_bashcompletion.sh) + install(FILES ${CMAKE_BINARY_DIR}/resources/gmic_bashcompletion.sh + DESTINATION ${CMAKE_INSTALL_DATADIR}/bash-completion/completions + RENAME gmic + ) +endif() + +include(CMakePackageConfigHelpers) +file(WRITE "${CMAKE_CURRENT_BINARY_DIR}/GmicConfig.cmake.in" "@PACKAGE_INIT@\ninclude(\${CMAKE_CURRENT_LIST_DIR}/GmicTargets.cmake)\n") +configure_package_config_file( + ${CMAKE_CURRENT_BINARY_DIR}/GmicConfig.cmake.in + ${CMAKE_CURRENT_BINARY_DIR}/GmicConfig.cmake + INSTALL_DESTINATION ${CMAKE_INSTALL_LIBDIR}/cmake/gmic +) +install(EXPORT GmicTargets DESTINATION ${CMAKE_INSTALL_LIBDIR}/cmake/gmic) +install(FILES ${CMAKE_CURRENT_BINARY_DIR}/GmicConfig.cmake DESTINATION ${CMAKE_INSTALL_LIBDIR}/cmake/gmic) +feature_summary(WHAT ALL) Deleted: FindCImg.cmake =================================================================== --- FindCImg.cmake 2022-06-17 14:06:26 UTC (rev 1238295) +++ FindCImg.cmake 2022-06-17 14:06:41 UTC (rev 1238296) @@ -1,169 +0,0 @@ -set(HEADER_URL "https://github.com/dtschump/CImg/raw/master/CImg.h") -set(HEADER_DIR ${CMAKE_SOURCE_DIR}/src) -set(HEADER_NAME CImg.h) -set(HEADER_PATH ${HEADER_DIR}/${HEADER_NAME}) - -# CImg.h header -if(NOT EXISTS ${HEADER_PATH}) - file(DOWNLOAD ${HEADER_URL} ${HEADER_PATH} STATUS download_status) - - list(GET download_status 0 status_code) - if(NOT ${status_code} EQUAL 0) - message(FATAL_ERROR "Missing ${HEADER_NAME} and unable to obtain it. Please download it from ${HEADER_URL} and save it to src/ directory.") - endif() -endif() - -include(FindPackageHandleStandardArgs) -find_package_handle_standard_args(CImg - REQUIRED_VARS HEADER_PATH -) - -# Build options -option(ENABLE_CURL "Add support for curl" ON) -option(ENABLE_X "Add support for X11" ON) -option(ENABLE_XSHM "Add support for X11 Xshm extension" OFF) -option(ENABLE_FFMPEG "Add support for FFMpeg" ON) -option(ENABLE_FFTW "Add support for FFTW" ON) -option(ENABLE_GRAPHICSMAGICK "Add support for GrahicsMagick" ON) -option(ENABLE_JPEG "Add support for handling images in Jpeg format" ON) -option(ENABLE_OPENCV "Add support for OpenCV" OFF) -option(ENABLE_OPENEXR "Add support for handling images in EXR format" ON) -option(ENABLE_OPENMP "Add support for parallel processing" ON) -option(ENABLE_PNG "Add support for handling images in PNG format" ON) -option(ENABLE_TIFF "Add support for handling images in Tiff format" ON) -option(ENABLE_ZLIB "Add support for data compression via Zlib" ON) - -set(COMPILE_FLAGS) -set(LINK_FLAGS) -set(CLI_COMPILE_FLAGS) -set(EXTRA_LIBRARY_TARGETS) - -## Add dependencies - -# OpenMP support -if(ENABLE_OPENMP) - find_package(OpenMP) - if(OpenMP_FOUND) - list(APPEND COMPILE_FLAGS "cimg_use_openmp") - list(APPEND EXTRA_LIBRARY_TARGETS OpenMP::OpenMP_CXX) - endif() -endif() - -# Zlib support -if(ENABLE_ZLIB) - find_package(ZLIB) - - if(ZLIB_FOUND) - list(APPEND COMPILE_FLAGS "cimg_use_zlib") - list(APPEND EXTRA_LIBRARY_TARGETS ZLIB::ZLIB) - endif() -endif() - -# Curl support -if(ENABLE_CURL) - find_package(CURL) - - if(CURL_FOUND) - list(APPEND COMPILE_FLAGS "cimg_use_curl") - list(APPEND EXTRA_LIBRARY_TARGETS CURL::libcurl) - endif() -endif() - -# X11 support -if(ENABLE_X) - find_package(X11) - - if(X11_FOUND) - list(APPEND COMPILE_FLAGS "cimg_display=1" "cimg_appname=\"gmic\"") - list(APPEND EXTRA_LIBRARY_TARGETS X11::X11) - else() - list(APPEND COMPILE_FLAGS "cimg_display=0" "cimg_appname=\"gmic\"") - endif() - - if(ENABLE_XSHM AND X11_XShm_FOUND) - list(APPEND COMPILE_FLAGS "cimg_use_xshm") - list(APPEND EXTRA_LIBRARY_TARGETS X11::Xext) - endif() -endif() - -if(ENABLE_FFTW) - find_package(FFTW3) - - if(FFTW3_FOUND) - list(APPEND COMPILE_FLAGS "cimg_use_fftw3") - list(APPEND EXTRA_LIBRARY_TARGETS ${FFTW3_LIBRARIES} -lfftw3_threads) - endif() -endif() - -if(ENABLE_OPENCV) - find_package(OpenCV) - - if(OPENCV_FOUND) - list(APPEND CLI_COMPILE_FLAGS "cimg_use_opencv") - list(APPEND EXTRA_LIBRARY_TARGETS ${OpenCV_LIBRARIES}) - endif() -endif() - -if(ENABLE_GRAPHICSMAGICK) - find_package(GraphicsMagick) - - if(GraphicsMagick_FOUND) - list(APPEND CLI_COMPILE_FLAGS "cimg_use_magick") - list(APPEND EXTRA_LIBRARY_TARGETS GraphicsMagick::GraphicsMagick++) - endif() -endif() - -if(ENABLE_TIFF) - find_package(TIFF) - - if(TIFF_FOUND) - list(APPEND CLI_COMPILE_FLAGS "cimg_use_tiff") - list(APPEND EXTRA_LIBRARY_TARGETS TIFF::TIFF) - endif() -endif() - -if(ENABLE_PNG) - find_package(PNG) - - if(PNG_FOUND) - list(APPEND CLI_COMPILE_FLAGS "cimg_use_png") - list(APPEND EXTRA_LIBRARY_TARGETS PNG::PNG) - endif() -endif() - -if(ENABLE_JPEG) - find_package(JPEG) - - if(JPEG_FOUND) - list(APPEND CLI_COMPILE_FLAGS "cimg_use_jpeg") - list(APPEND EXTRA_LIBRARY_TARGETS JPEG::JPEG) - endif() -endif() - -if(ENABLE_OPENEXR) - find_package(OpenEXR) - - if(OpenEXR_FOUND) - list(APPEND CLI_COMPILE_FLAGS "cimg_use_openexr") - list(APPEND EXTRA_LIBRARY_TARGETS OpenEXR::OpenEXR) - endif() -endif() - -if(MINGW) - list(APPEND LINK_FLAGS "-Wl,--stack,16777216") -endif() - -find_package(Threads) -if(Threads_FOUND) - list(APPEND EXTRA_LIBRARY_TARGETS Threads::Threads) -endif() - - -# Library definition - -add_library(CImg::CImg INTERFACE IMPORTED) - -target_compile_definitions(CImg::CImg INTERFACE ${COMPILE_FLAGS} ${CLI_COMPILE_FLAGS}) -target_link_options(CImg::CImg INTERFACE ${LINK_FLAGS}) -target_link_libraries(CImg::CImg INTERFACE ${EXTRA_LIBRARY_TARGETS}) -target_include_directories(CImg::CImg INTERFACE ${HEADER_DIR}) Copied: gmic/repos/community-x86_64/FindCImg.cmake (from rev 1238295, gmic/trunk/FindCImg.cmake) =================================================================== --- FindCImg.cmake (rev 0) +++ FindCImg.cmake 2022-06-17 14:06:41 UTC (rev 1238296) @@ -0,0 +1,169 @@ +set(HEADER_URL "https://github.com/dtschump/CImg/raw/master/CImg.h") +set(HEADER_DIR ${CMAKE_SOURCE_DIR}/src) +set(HEADER_NAME CImg.h) +set(HEADER_PATH ${HEADER_DIR}/${HEADER_NAME}) + +# CImg.h header +if(NOT EXISTS ${HEADER_PATH}) + file(DOWNLOAD ${HEADER_URL} ${HEADER_PATH} STATUS download_status) + + list(GET download_status 0 status_code) + if(NOT ${status_code} EQUAL 0) + message(FATAL_ERROR "Missing ${HEADER_NAME} and unable to obtain it. Please download it from ${HEADER_URL} and save it to src/ directory.") + endif() +endif() + +include(FindPackageHandleStandardArgs) +find_package_handle_standard_args(CImg + REQUIRED_VARS HEADER_PATH +) + +# Build options +option(ENABLE_CURL "Add support for curl" ON) +option(ENABLE_X "Add support for X11" ON) +option(ENABLE_XSHM "Add support for X11 Xshm extension" OFF) +option(ENABLE_FFMPEG "Add support for FFMpeg" ON) +option(ENABLE_FFTW "Add support for FFTW" ON) +option(ENABLE_GRAPHICSMAGICK "Add support for GrahicsMagick" ON) +option(ENABLE_JPEG "Add support for handling images in Jpeg format" ON) +option(ENABLE_OPENCV "Add support for OpenCV" OFF) +option(ENABLE_OPENEXR "Add support for handling images in EXR format" ON) +option(ENABLE_OPENMP "Add support for parallel processing" ON) +option(ENABLE_PNG "Add support for handling images in PNG format" ON) +option(ENABLE_TIFF "Add support for handling images in Tiff format" ON) +option(ENABLE_ZLIB "Add support for data compression via Zlib" ON) + +set(COMPILE_FLAGS) +set(LINK_FLAGS) +set(CLI_COMPILE_FLAGS) +set(EXTRA_LIBRARY_TARGETS) + +## Add dependencies + +# OpenMP support +if(ENABLE_OPENMP) + find_package(OpenMP) + if(OpenMP_FOUND) + list(APPEND COMPILE_FLAGS "cimg_use_openmp") + list(APPEND EXTRA_LIBRARY_TARGETS OpenMP::OpenMP_CXX) + endif() +endif() + +# Zlib support +if(ENABLE_ZLIB) + find_package(ZLIB) + + if(ZLIB_FOUND) + list(APPEND COMPILE_FLAGS "cimg_use_zlib") + list(APPEND EXTRA_LIBRARY_TARGETS ZLIB::ZLIB) + endif() +endif() + +# Curl support +if(ENABLE_CURL) + find_package(CURL) + + if(CURL_FOUND) + list(APPEND COMPILE_FLAGS "cimg_use_curl") + list(APPEND EXTRA_LIBRARY_TARGETS CURL::libcurl) + endif() +endif() + +# X11 support +if(ENABLE_X) + find_package(X11) + + if(X11_FOUND) + list(APPEND COMPILE_FLAGS "cimg_display=1" "cimg_appname=\"gmic\"") + list(APPEND EXTRA_LIBRARY_TARGETS X11::X11) + else() + list(APPEND COMPILE_FLAGS "cimg_display=0" "cimg_appname=\"gmic\"") + endif() + + if(ENABLE_XSHM AND X11_XShm_FOUND) + list(APPEND COMPILE_FLAGS "cimg_use_xshm") + list(APPEND EXTRA_LIBRARY_TARGETS X11::Xext) + endif() +endif() + +if(ENABLE_FFTW) + find_package(FFTW3) + + if(FFTW3_FOUND) + list(APPEND COMPILE_FLAGS "cimg_use_fftw3") + list(APPEND EXTRA_LIBRARY_TARGETS ${FFTW3_LIBRARIES} -lfftw3_threads) + endif() +endif() + +if(ENABLE_OPENCV) + find_package(OpenCV) + + if(OPENCV_FOUND) + list(APPEND CLI_COMPILE_FLAGS "cimg_use_opencv") + list(APPEND EXTRA_LIBRARY_TARGETS ${OpenCV_LIBRARIES}) + endif() +endif() + +if(ENABLE_GRAPHICSMAGICK) + find_package(GraphicsMagick) + + if(GraphicsMagick_FOUND) + list(APPEND CLI_COMPILE_FLAGS "cimg_use_magick") + list(APPEND EXTRA_LIBRARY_TARGETS GraphicsMagick::GraphicsMagick++) + endif() +endif() + +if(ENABLE_TIFF) + find_package(TIFF) + + if(TIFF_FOUND) + list(APPEND CLI_COMPILE_FLAGS "cimg_use_tiff") + list(APPEND EXTRA_LIBRARY_TARGETS TIFF::TIFF) + endif() +endif() + +if(ENABLE_PNG) + find_package(PNG) + + if(PNG_FOUND) + list(APPEND CLI_COMPILE_FLAGS "cimg_use_png") + list(APPEND EXTRA_LIBRARY_TARGETS PNG::PNG) + endif() +endif() + +if(ENABLE_JPEG) + find_package(JPEG) + + if(JPEG_FOUND) + list(APPEND CLI_COMPILE_FLAGS "cimg_use_jpeg") + list(APPEND EXTRA_LIBRARY_TARGETS JPEG::JPEG) + endif() +endif() + +if(ENABLE_OPENEXR) + find_package(OpenEXR) + + if(OpenEXR_FOUND) + list(APPEND CLI_COMPILE_FLAGS "cimg_use_openexr") + list(APPEND EXTRA_LIBRARY_TARGETS OpenEXR::OpenEXR) + endif() +endif() + +if(MINGW) + list(APPEND LINK_FLAGS "-Wl,--stack,16777216") +endif() + +find_package(Threads) +if(Threads_FOUND) + list(APPEND EXTRA_LIBRARY_TARGETS Threads::Threads) +endif() + + +# Library definition + +add_library(CImg::CImg INTERFACE IMPORTED) + +target_compile_definitions(CImg::CImg INTERFACE ${COMPILE_FLAGS} ${CLI_COMPILE_FLAGS}) +target_link_options(CImg::CImg INTERFACE ${LINK_FLAGS}) +target_link_libraries(CImg::CImg INTERFACE ${EXTRA_LIBRARY_TARGETS}) +target_include_directories(CImg::CImg INTERFACE ${HEADER_DIR}) Deleted: FindGMicStdlib.cmake =================================================================== --- FindGMicStdlib.cmake 2022-06-17 14:06:26 UTC (rev 1238295) +++ FindGMicStdlib.cmake 2022-06-17 14:06:41 UTC (rev 1238296) @@ -1,25 +0,0 @@ -set(HEADER_URL "https://gmic.eu/gmic_stdlib.h") -set(HEADER_DIR ${CMAKE_SOURCE_DIR}/src) -set(HEADER_NAME gmic_stdlib.h) -set(HEADER_PATH ${HEADER_DIR}/${HEADER_NAME}) - -# gmic_stdlib.h header -if(NOT EXISTS ${HEADER_PATH}) - file(DOWNLOAD ${HEADER_URL} ${HEADER_PATH} STATUS download_status) - - list(GET download_status 0 status_code) - if(NOT ${status_code} EQUAL 0) - message(FATAL_ERROR "Missing ${HEADER_NAME} and unable to obtain it. Please download it from ${HEADER_URL} and save it to src/ directory.") - endif() -endif() - -include(FindPackageHandleStandardArgs) -find_package_handle_standard_args(GMicStdlib - REQUIRED_VARS HEADER_PATH -) - -add_library(GMicStdlib::Stdlib INTERFACE IMPORTED) - -set_target_properties(GMicStdlib::Stdlib PROPERTIES - INTERFACE_INCLUDE_DIRECTORIES "${HEADER_DIR}" -) Copied: gmic/repos/community-x86_64/FindGMicStdlib.cmake (from rev 1238295, gmic/trunk/FindGMicStdlib.cmake) =================================================================== --- FindGMicStdlib.cmake (rev 0) +++ FindGMicStdlib.cmake 2022-06-17 14:06:41 UTC (rev 1238296) @@ -0,0 +1,25 @@ +set(HEADER_URL "https://gmic.eu/gmic_stdlib.h") +set(HEADER_DIR ${CMAKE_SOURCE_DIR}/src) +set(HEADER_NAME gmic_stdlib.h) +set(HEADER_PATH ${HEADER_DIR}/${HEADER_NAME}) + +# gmic_stdlib.h header +if(NOT EXISTS ${HEADER_PATH}) + file(DOWNLOAD ${HEADER_URL} ${HEADER_PATH} STATUS download_status) + + list(GET download_status 0 status_code) + if(NOT ${status_code} EQUAL 0) + message(FATAL_ERROR "Missing ${HEADER_NAME} and unable to obtain it. Please download it from ${HEADER_URL} and save it to src/ directory.") + endif() +endif() + +include(FindPackageHandleStandardArgs) +find_package_handle_standard_args(GMicStdlib + REQUIRED_VARS HEADER_PATH +) + +add_library(GMicStdlib::Stdlib INTERFACE IMPORTED) + +set_target_properties(GMicStdlib::Stdlib PROPERTIES + INTERFACE_INCLUDE_DIRECTORIES "${HEADER_DIR}" +) Deleted: PKGBUILD =================================================================== --- PKGBUILD 2022-06-17 14:06:26 UTC (rev 1238295) +++ PKGBUILD 2022-06-17 14:06:41 UTC (rev 1238296) @@ -1,72 +0,0 @@ -# Maintainer: Antonio Rojas <aro...@archlinux.org> -# Contributor: Sergej Pupykin <pupykin.s+a...@gmail.com> -# Contributor: Jan "heftig" Steffens <jan.steff...@gmail.com> -# Contributor: farid <farid at archlinuc-br.org> -# Contributor: Archie <mym...@gmail.com> - -pkgbase=gmic -pkgname=(gmic gimp-plugin-gmic) -pkgver=3.1.3 -pkgrel=1 -arch=(x86_64) -url='https://gmic.eu/' -license=(custom:CeCILL) -makedepends=(cmake gimp qt5-base fftw openexr opencv eigen graphicsmagick qt5-tools) -source=(https://gmic.eu/files/source/gmic_$pkgver.tar.gz - CMakeLists.txt FindCImg.cmake FindGMicStdlib.cmake) -sha256sums=('02bbce405ddc8531cdee45a7256812d3adda8aa0d5952bcff168e221795ff65a' - '089c4ad204a1ed43c9425e3f39e5a3a8bab3d6e8c4fb5a6dfc69e0fca15abd15' - '5ad1b499cb0a9e3d9fff6a851346d6f356dfc592442183d6330726a29ee25384' - '83e4635a6fd101511381bc865255f4de88834da51911ce3eb45ddac2558cabcc') - -prepare() { - mv CMakeLists.txt gmic-$pkgver - mkdir -p gmic-$pkgver/cmake - mv FindCImg.cmake FindGMicStdlib.cmake gmic-$pkgver/cmake -} - -build() { - cmake -B build -S gmic-$pkgver \ - -DCMAKE_INSTALL_PREFIX=/usr \ - -DENABLE_DYNAMIC_LINKING=ON \ - -DBUILD_LIB_STATIC=OFF \ - -DENABLE_OPENCV=ON - cmake --build build - - export LDFLAGS="$LDFLAGS -L../build" - cmake -B build-qt -S gmic-$pkgver/gmic-qt \ - -DCMAKE_INSTALL_PREFIX=/usr \ - -DENABLE_DYNAMIC_LINKING=ON \ - -DGMIC_PATH="$srcdir"/gmic-$pkgver/src \ - -DGMIC_QT_HOST=none - cmake --build build-qt - - cmake -B build-gimp -S gmic-$pkgver/gmic-qt \ - -DCMAKE_INSTALL_PREFIX=/usr \ - -DENABLE_DYNAMIC_LINKING=ON \ - -DGMIC_PATH="$srcdir"/gmic-$pkgver/src \ - -DGMIC_QT_HOST=gimp - cmake --build build-gimp -} - -package_gmic() { - pkgdesc="GREYC's Magic Image Converter: image processing framework" - depends=(graphicsmagick opencv fftw) - optdepends=('qt5-base: for the Qt UI') - conflicts=(cimg) - - DESTDIR="$pkgdir" cmake --install build - install -Dm644 gmic-$pkgver/COPYING "$pkgdir"/usr/share/licenses/$pkgname/LICENSE - - DESTDIR="$pkgdir" cmake --install build-qt - - install -Dm644 gmic-$pkgver/resources/gmic_cluts.gmz -t "$pkgdir"/usr/share/gmic -} - -package_gimp-plugin-gmic() { - pkgdesc="Gimp plugin for the G'MIC image processing framework" - depends=(gimp gmic qt5-base) - - DESTDIR="$pkgdir" cmake --install build-gimp - install -Dm644 gmic-$pkgver/COPYING "$pkgdir"/usr/share/licenses/$pkgname/LICENSE -} Copied: gmic/repos/community-x86_64/PKGBUILD (from rev 1238295, gmic/trunk/PKGBUILD) =================================================================== --- PKGBUILD (rev 0) +++ PKGBUILD 2022-06-17 14:06:41 UTC (rev 1238296) @@ -0,0 +1,72 @@ +# Maintainer: Antonio Rojas <aro...@archlinux.org> +# Contributor: Sergej Pupykin <pupykin.s+a...@gmail.com> +# Contributor: Jan "heftig" Steffens <jan.steff...@gmail.com> +# Contributor: farid <farid at archlinuc-br.org> +# Contributor: Archie <mym...@gmail.com> + +pkgbase=gmic +pkgname=(gmic gimp-plugin-gmic) +pkgver=3.1.3 +pkgrel=2 +arch=(x86_64) +url='https://gmic.eu/' +license=(custom:CeCILL) +makedepends=(cmake gimp qt5-base fftw openexr opencv eigen graphicsmagick qt5-tools) +source=(https://gmic.eu/files/source/gmic_$pkgver.tar.gz + CMakeLists.txt FindCImg.cmake FindGMicStdlib.cmake) +sha256sums=('25d1583932801321fe559ee87c3c19c60d45f9119447d86049f073ad295b3da3' + '089c4ad204a1ed43c9425e3f39e5a3a8bab3d6e8c4fb5a6dfc69e0fca15abd15' + '5ad1b499cb0a9e3d9fff6a851346d6f356dfc592442183d6330726a29ee25384' + '83e4635a6fd101511381bc865255f4de88834da51911ce3eb45ddac2558cabcc') + +prepare() { + mv CMakeLists.txt gmic-$pkgver + mkdir -p gmic-$pkgver/cmake + mv FindCImg.cmake FindGMicStdlib.cmake gmic-$pkgver/cmake +} + +build() { + cmake -B build -S gmic-$pkgver \ + -DCMAKE_INSTALL_PREFIX=/usr \ + -DENABLE_DYNAMIC_LINKING=ON \ + -DBUILD_LIB_STATIC=OFF \ + -DENABLE_OPENCV=ON + cmake --build build + + export LDFLAGS="$LDFLAGS -L../build" + cmake -B build-qt -S gmic-$pkgver/gmic-qt \ + -DCMAKE_INSTALL_PREFIX=/usr \ + -DENABLE_DYNAMIC_LINKING=ON \ + -DGMIC_PATH="$srcdir"/gmic-$pkgver/src \ + -DGMIC_QT_HOST=none + cmake --build build-qt + + cmake -B build-gimp -S gmic-$pkgver/gmic-qt \ + -DCMAKE_INSTALL_PREFIX=/usr \ + -DENABLE_DYNAMIC_LINKING=ON \ + -DGMIC_PATH="$srcdir"/gmic-$pkgver/src \ + -DGMIC_QT_HOST=gimp + cmake --build build-gimp +} + +package_gmic() { + pkgdesc="GREYC's Magic Image Converter: image processing framework" + depends=(graphicsmagick opencv fftw) + optdepends=('qt5-base: for the Qt UI') + conflicts=(cimg) + + DESTDIR="$pkgdir" cmake --install build + install -Dm644 gmic-$pkgver/COPYING "$pkgdir"/usr/share/licenses/$pkgname/LICENSE + + DESTDIR="$pkgdir" cmake --install build-qt + + install -Dm644 gmic-$pkgver/resources/gmic_cluts.gmz -t "$pkgdir"/usr/share/gmic +} + +package_gimp-plugin-gmic() { + pkgdesc="Gimp plugin for the G'MIC image processing framework" + depends=(gimp gmic qt5-base) + + DESTDIR="$pkgdir" cmake --install build-gimp + install -Dm644 gmic-$pkgver/COPYING "$pkgdir"/usr/share/licenses/$pkgname/LICENSE +}