Signed-off-by: gregory guy <gregory-tde@laposte.net> some fixes and improvements. Signed-off-by: Slávek Banko <slavek.banko@axis.cz>pull/2/head
parent
c995c0ed60
commit
2e4e81b25e
@ -0,0 +1,81 @@
|
||||
############################################
|
||||
# #
|
||||
# Improvements and feedbacks are welcome #
|
||||
# #
|
||||
# This file is released under GPL >= 3 #
|
||||
# #
|
||||
############################################
|
||||
|
||||
|
||||
cmake_minimum_required( VERSION 2.8.12 )
|
||||
|
||||
|
||||
#### general package setup
|
||||
|
||||
project( libkdcraw )
|
||||
set( VERSION R14.1.0 )
|
||||
|
||||
|
||||
#### include essential cmake modules
|
||||
|
||||
include( FindPkgConfig )
|
||||
include( CheckFunctionExists )
|
||||
include( CheckSymbolExists )
|
||||
include( CheckIncludeFile )
|
||||
include( CheckIncludeFileCXX )
|
||||
include( CheckLibraryExists )
|
||||
include( CheckCSourceCompiles )
|
||||
include( CheckCXXSourceCompiles )
|
||||
|
||||
|
||||
#### include our cmake modules
|
||||
|
||||
set( CMAKE_MODULE_PATH "${CMAKE_SOURCE_DIR}/cmake/modules" )
|
||||
include( TDEMacros )
|
||||
|
||||
|
||||
##### setup install paths
|
||||
|
||||
include( TDESetupPaths )
|
||||
tde_setup_paths( )
|
||||
|
||||
|
||||
##### optional stuff
|
||||
|
||||
option( WITH_ALL_OPTIONS "Enable all optional support" OFF )
|
||||
option( WITH_GCC_VISIBILITY "Enable fvisibility and fvisibility-inlines-hidden" ${WITH_ALL_OPTIONS} )
|
||||
option( WITH_LCMS "Enable lcms support" ${WITH_ALL_OPTIONS} )
|
||||
option( WITH_OPENMP "Enable OpenMP support" ${WITH_ALL_OPTIONS} )
|
||||
|
||||
|
||||
##### user requested modules
|
||||
|
||||
option( BUILD_ALL "Build all" ON )
|
||||
option( BUILD_KDCRAW "Build kdcraw program" OFF )
|
||||
option( BUILD_TESTS "Build test programs" OFF )
|
||||
option( BUILD_TRANSLATIONS "Build translations" ${BUILD_ALL} )
|
||||
|
||||
|
||||
##### configure checks
|
||||
|
||||
include( ConfigureChecks.cmake )
|
||||
|
||||
|
||||
###### global compiler settings
|
||||
|
||||
add_definitions( -DHAVE_CONFIG_H )
|
||||
|
||||
set( CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} ${TQT_CXX_FLAGS}" )
|
||||
set( CMAKE_SHARED_LINKER_FLAGS "${CMAKE_SHARED_LINKER_FLAGS} -Wl,--no-undefined" )
|
||||
set( CMAKE_MODULE_LINKER_FLAGS "${CMAKE_MODULE_LINKER_FLAGS} -Wl,--no-undefined" )
|
||||
|
||||
|
||||
##### directories
|
||||
|
||||
add_subdirectory( ${PROJECT_NAME} )
|
||||
tde_conditional_add_subdirectory( BUILD_TRANSLATIONS po )
|
||||
|
||||
|
||||
##### write configure files
|
||||
|
||||
configure_file( config.h.cmake config.h @ONLY )
|
@ -0,0 +1,80 @@
|
||||
###########################################
|
||||
# #
|
||||
# Improvements and feedback are welcome #
|
||||
# #
|
||||
# This file is released under GPL >= 3 #
|
||||
# #
|
||||
###########################################
|
||||
|
||||
# required stuff
|
||||
find_package( TQt )
|
||||
find_package( TDE )
|
||||
|
||||
tde_setup_architecture_flags( )
|
||||
|
||||
include(TestBigEndian)
|
||||
test_big_endian(WORDS_BIGENDIAN)
|
||||
|
||||
tde_setup_largefiles( )
|
||||
|
||||
|
||||
##### check for gcc visibility support
|
||||
|
||||
if( WITH_GCC_VISIBILITY )
|
||||
tde_setup_gcc_visibility( )
|
||||
endif( WITH_GCC_VISIBILITY )
|
||||
|
||||
|
||||
##### check for lcms
|
||||
|
||||
if( WITH_LCMS )
|
||||
check_include_file( lcms2.h HAVE_LCMS2_H )
|
||||
if( HAVE_LCMS2_H )
|
||||
pkg_search_module( LCMS lcms2 )
|
||||
set( LCMS_HEADER lcms2.h )
|
||||
else()
|
||||
check_include_file( lcms.h HAVE_LCMS_H )
|
||||
if( HAVE_LCMS_H )
|
||||
pkg_search_module( LCMS lcms )
|
||||
set( LCMS_HEADER lcms.h )
|
||||
else()
|
||||
tde_message_fatal( "lcms is requested, but was not found on your system" )
|
||||
endif()
|
||||
endif()
|
||||
set( USE_LCMS 1 )
|
||||
endif( WITH_LCMS )
|
||||
|
||||
|
||||
##### check for OpenMP
|
||||
|
||||
if( WITH_OPENMP )
|
||||
if( CMAKE_CXX_COMPILER_ID MATCHES "GNU" )
|
||||
find_package( OpenMP )
|
||||
if( OPENMP_FOUND )
|
||||
set( CMAKE_C_FLAGS "${CMAKE_C_FLAGS} ${OpenMP_C_FLAGS}" )
|
||||
set( CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} ${OpenMP_CXX_FLAGS}" )
|
||||
else()
|
||||
tde_message_fatal( "OpenMP is requested, but was not found on your system" )
|
||||
endif()
|
||||
else()
|
||||
tde_message_fatal( "OpenMP build is available for the GNU GCC compiler only" )
|
||||
endif()
|
||||
endif( WITH_OPENMP )
|
||||
|
||||
|
||||
##### check for jpeg
|
||||
|
||||
if( BUILD_KDCRAW )
|
||||
find_package( JPEG )
|
||||
|
||||
if( JPEG_FOUND )
|
||||
set( HAVE_JPEG 1 )
|
||||
else()
|
||||
tde_message_fatal( "jpeg library is required, but was not found on your system" )
|
||||
endif()
|
||||
|
||||
##### check for the math libc
|
||||
|
||||
find_library( MATH_LIBC m )
|
||||
|
||||
endif( BUILD_KDCRAW )
|
@ -0,0 +1,17 @@
|
||||
#define VERSION "@VERSION@"
|
||||
|
||||
// Defined if you have fvisibility and fvisibility-inlines-hidden support.
|
||||
#cmakedefine __KDE_HAVE_GCC_VISIBILITY 1
|
||||
|
||||
/* Define WORDS_BIGENDIAN to 1 if your processor stores words with the most
|
||||
significant byte first (like Motorola and SPARC, unlike Intel). */
|
||||
#cmakedefine WORDS_BIGENDIAN @WORDS_BIGENDIAN@
|
||||
|
||||
/* Define lcms header */
|
||||
#cmakedefine LCMS_HEADER <@LCMS_HEADER@>
|
||||
|
||||
/* Defined for lcms support */
|
||||
#cmakedefine USE_LCMS 1
|
||||
|
||||
/* Defined if you have jpeg library */
|
||||
#cmakedefine HAVE_JPEG 1
|
@ -0,0 +1,20 @@
|
||||
add_subdirectory( libraw )
|
||||
add_subdirectory( libkdcraw )
|
||||
add_subdirectory( icons )
|
||||
|
||||
tde_conditional_add_subdirectory( BUILD_TESTS test )
|
||||
tde_conditional_add_subdirectory( BUILD_KDCRAW dcraw )
|
||||
|
||||
|
||||
##### other data
|
||||
|
||||
string( REGEX REPLACE "^${CMAKE_INSTALL_PREFIX}" "\${prefix}" PC_EXEC_PREFIX ${EXEC_INSTALL_PREFIX} )
|
||||
string( REGEX REPLACE "^${CMAKE_INSTALL_PREFIX}" "\${prefix}" PC_INCLUDE_DIR ${INCLUDE_INSTALL_DIR} )
|
||||
string( REGEX REPLACE "^${CMAKE_INSTALL_PREFIX}" "\${prefix}" PC_LIB_DIR ${LIB_INSTALL_DIR} )
|
||||
|
||||
configure_file( ${PROJECT_NAME}.pc.cmake ${PROJECT_NAME}.pc @ONLY )
|
||||
|
||||
install(
|
||||
FILES ${CMAKE_CURRENT_BINARY_DIR}/${PROJECT_NAME}.pc
|
||||
DESTINATION ${PKGCONFIG_INSTALL_DIR}
|
||||
)
|
@ -0,0 +1,38 @@
|
||||
include_directories(
|
||||
${CMAKE_BINARY_DIR}
|
||||
${CMAKE_CURRENT_BINARY_DIR}
|
||||
${CMAKE_CURRENT_SOURCE_DIR}
|
||||
${TDE_INCLUDE_DIR}
|
||||
${TQT_INCLUDE_DIRS}
|
||||
${LCMS_INCLUDE_DIRS}
|
||||
${JPEG_INCLUDE_DIR}
|
||||
)
|
||||
|
||||
link_directories(
|
||||
${TQT_LIBRARY_DIRS}
|
||||
${TDE_LIB_DIR}
|
||||
)
|
||||
|
||||
|
||||
##### kdcraw (executable)
|
||||
|
||||
tde_add_executable( kdcraw
|
||||
|
||||
SOURCES
|
||||
dcraw.c
|
||||
LINK
|
||||
${LCMS_LIBRARIES}
|
||||
${JPEG_LIBRARIES}
|
||||
${MATH_LIBC}
|
||||
|
||||
DESTINATION ${BIN_INSTALL_DIR}
|
||||
)
|
||||
|
||||
|
||||
##### other data
|
||||
|
||||
INSTALL(
|
||||
FILES kdcraw.1
|
||||
DESTINATION ${MAN_INSTALL_DIR}/man1
|
||||
COMPONENT doc
|
||||
)
|
@ -0,0 +1,3 @@
|
||||
##### icons
|
||||
|
||||
tde_install_icons()
|
@ -0,0 +1,12 @@
|
||||
prefix=@CMAKE_INSTALL_PREFIX@
|
||||
exec_prefix=@PC_EXEC_PREFIX@
|
||||
libdir=@PC_LIB_DIR@
|
||||
includedir=@PC_INCLUDE_DIR@
|
||||
|
||||
Name: @PROJECT_NAME@
|
||||
Description: A C++ wrapper around LibRaw library to decode RAW pictures. This library is used by digiKam and kipi-plugins.
|
||||
URL: https://mirror.git.trinitydesktop.org/gitea/TDE/libkdcraw
|
||||
Requires:
|
||||
Version: 0.1.9
|
||||
Libs: -L${libdir} -lkdcraw
|
||||
Cflags: -I${includedir}
|
@ -0,0 +1,49 @@
|
||||
include_directories(
|
||||
${CMAKE_BINARY_DIR}
|
||||
${CMAKE_CURRENT_BINARY_DIR}
|
||||
${CMAKE_CURRENT_SOURCE_DIR}
|
||||
${TDE_INCLUDE_DIR}
|
||||
${TQT_INCLUDE_DIRS}
|
||||
${CMAKE_SOURCE_DIR}/libkdcraw/libraw
|
||||
)
|
||||
|
||||
link_directories(
|
||||
${TQT_LIBRARY_DIRS}
|
||||
${TDE_LIB_DIR}
|
||||
)
|
||||
|
||||
set( _SRC_ kdcraw.cpp
|
||||
kdcrawprivate.cpp
|
||||
dcrawsettingswidget.cpp
|
||||
rnuminput.cpp
|
||||
rcombobox.cpp
|
||||
)
|
||||
|
||||
|
||||
##### kdcraw (shared)
|
||||
|
||||
tde_add_library( kdcraw SHARED AUTOMOC
|
||||
|
||||
SOURCES
|
||||
${_SRC_}
|
||||
LINK
|
||||
tdeui-shared
|
||||
tdecore-shared
|
||||
tdeio-shared
|
||||
raw-static
|
||||
|
||||
VERSION 4.0.3
|
||||
|
||||
DESTINATION ${LIB_INSTALL_DIR}
|
||||
)
|
||||
|
||||
|
||||
##### headers
|
||||
|
||||
install(
|
||||
FILES rawdecodingsettings.h kdcraw.h dcrawsettingswidget.h
|
||||
rnuminput.h rcombobox.h dcrawinfocontainer.h rawfiles.h
|
||||
libkdcraw_export.h version.h
|
||||
|
||||
DESTINATION ${INCLUDE_INSTALL_DIR}/${PROJECT_NAME}
|
||||
)
|
@ -0,0 +1,29 @@
|
||||
include_directories(
|
||||
${CMAKE_BINARY_DIR}
|
||||
${CMAKE_CURRENT_BINARY_DIR}
|
||||
${CMAKE_CURRENT_SOURCE_DIR}
|
||||
${TDE_INCLUDE_DIR}
|
||||
${TQT_INCLUDE_DIRS}
|
||||
${LCMS_INCLUDE_DIRS}
|
||||
)
|
||||
|
||||
link_directories(
|
||||
${TQT_LIBRARY_DIRS}
|
||||
${TDE_LIB_DIR}
|
||||
)
|
||||
|
||||
|
||||
##### raw (static)
|
||||
|
||||
tde_add_library( raw STATIC_PIC AUTOMOC
|
||||
|
||||
SOURCES
|
||||
src/libraw_cxx.cpp
|
||||
src/libraw_c_api.cpp
|
||||
internal/dcraw_common.cpp
|
||||
internal/dcraw_fileio.cpp
|
||||
internal/foveon.cpp
|
||||
LINK
|
||||
${LCMS_LIBRARIES}
|
||||
|
||||
)
|
@ -0,0 +1,66 @@
|
||||
include_directories(
|
||||
${CMAKE_BINARY_DIR}
|
||||
${CMAKE_CURRENT_BINARY_DIR}
|
||||
${CMAKE_CURRENT_SOURCE_DIR}
|
||||
${CMAKE_SOURCE_DIR}/libkdcraw/libraw
|
||||
${CMAKE_SOURCE_DIR}/libkdcraw/libkdcraw
|
||||
)
|
||||
|
||||
|
||||
##### test programs
|
||||
|
||||
tde_add_executable( raw2png AUTOMOC
|
||||
|
||||
SOURCES
|
||||
raw2png.cpp
|
||||
LINK
|
||||
kdcraw-shared
|
||||
)
|
||||
|
||||
tde_add_executable( identify AUTOMOC
|
||||
|
||||
SOURCES
|
||||
../libraw/samples/identify.cpp
|
||||
LINK
|
||||
raw-static
|
||||
)
|
||||
|
||||
tde_add_executable( simple_dcraw AUTOMOC
|
||||
|
||||
SOURCES
|
||||
../libraw/samples/simple_dcraw.cpp
|
||||
LINK
|
||||
raw-static
|
||||
)
|
||||
|
||||
tde_add_executable( mem_image AUTOMOC
|
||||
|
||||
SOURCES
|
||||
../libraw/samples/mem_image.cpp
|
||||
LINK
|
||||
raw-static
|
||||
)
|
||||
|
||||
tde_add_executable( 4channels AUTOMOC
|
||||
|
||||
SOURCES
|
||||
../libraw/samples/4channels.cpp
|
||||
LINK
|
||||
raw-static
|
||||
)
|
||||
|
||||
tde_add_executable( unprocessed_raw AUTOMOC
|
||||
|
||||
SOURCES
|
||||
../libraw/samples/unprocessed_raw.cpp
|
||||
LINK
|
||||
raw-static
|
||||
)
|
||||
|
||||
tde_add_executable( dcraw_emu AUTOMOC
|
||||
|
||||
SOURCES
|
||||
../libraw/samples/dcraw_emu.cpp
|
||||
LINK
|
||||
raw-static
|
||||
)
|
@ -0,0 +1,8 @@
|
||||
file( GLOB_RECURSE po_files RELATIVE ${CMAKE_CURRENT_SOURCE_DIR} ./*/*.po )
|
||||
|
||||
foreach( _po ${po_files} )
|
||||
string( REGEX REPLACE "/.*" "" _lang ${_po} )
|
||||
if( "${_linguas}" MATCHES "^;*$" OR ";${_linguas};" MATCHES ";${_lang};" )
|
||||
tde_create_translation( FILES ${_po} LANG ${_lang} )
|
||||
endif()
|
||||
endforeach()
|
Loading…
Reference in new issue