Skip to content

Commit

Permalink
add librtprocess as git subtree
Browse files Browse the repository at this point in the history
add <LHDR_ROOT_SOURCE>/librtprocess as git subtree
modify librtprocess/CMakeLists.txt for building a static library and
link against lhdr
modify main lhdr CMakeLists.txt for building and linking librtprocess
inside lhdr
  • Loading branch information
fcomida committed Aug 12, 2019
1 parent e27ca1b commit ac32037
Show file tree
Hide file tree
Showing 9 changed files with 26 additions and 65 deletions.
8 changes: 5 additions & 3 deletions CMakeLists.txt
Expand Up @@ -109,8 +109,8 @@ IF(GIT_FOUND)
get_git_head_revision(GIT_REFSPEC GIT_SHA1)
ENDIF()

find_package(PkgConfig)
pkg_check_modules(RTPROCESS REQUIRED rtprocess>=0.2.0)
##find_package(PkgConfig)
##pkg_check_modules(RTPROCESS REQUIRED rtprocess>=0.2.0)

IF(WIN32)

Expand Down Expand Up @@ -220,7 +220,7 @@ SET(LIBS ${LIBS} ${JPEG_LIBRARIES})
SET(LIBS ${LIBS} ${LCMS2_LIBRARIES})
SET(LIBS ${LIBS} ${PNG_LIBRARIES})
SET(LIBS ${LIBS} ${Boost_LIBRARIES})
SET(LIBS ${LIBS} ${RTPROCESS_LIBRARIES})
##SET(LIBS ${LIBS} ${RTPROCESS_LIBRARIES})

INCLUDE_DIRECTORIES("${CMAKE_SOURCE_DIR}/src/")
INCLUDE_DIRECTORIES("${CMAKE_BINARY_DIR}/src/")
Expand All @@ -240,7 +240,9 @@ SET(LUMINANCE_HDR_H ${LUMINANCE_HDR_H}
SET(LUMINANCE_HDR_RCCS icons.qrc)
QT5_ADD_RESOURCES(LUMINANCE_HDR_RCCS_SRCS ${LUMINANCE_HDR_RCCS})

INCLUDE_DIRECTORIES("${CMAKE_SOURCE_DIR}/librtprocess/src/include")
ADD_SUBDIRECTORY(src)
ADD_SUBDIRECTORY(librtprocess)

IF(ENABLE_UNIT_TEST)
ENABLE_TESTING()
Expand Down
69 changes: 14 additions & 55 deletions librtprocess/CMakeLists.txt
@@ -1,12 +1,3 @@
# Required cmake version
cmake_minimum_required(VERSION 3.5.0)
cmake_policy(SET CMP0048 NEW)

if (NOT DEFINED CMAKE_BUILD_TYPE)
set(CMAKE_BUILD_TYPE "RelWithDebInfo")
endif()
# Specify search path for CMake modules to be loaded by include()
# and find_package()
list(APPEND CMAKE_MODULE_PATH "${CMAKE_CURRENT_SOURCE_DIR}/cmake/Modules")

### Add defaults for cmake
Expand All @@ -17,56 +8,24 @@ include(DefineCMakeDefaults)
# and -DCMAKE_BUILD_TYPE=AddressSanitizer
include(DefineCompilerFlags)

project(rtprocess VERSION 0.11.0 LANGUAGES CXX)

# include cmake files
include(DefineOptions.cmake)
include(CompilerChecks.cmake)
include(GNUInstallDirs)
include(CMakePackageConfigHelpers)
include(CPackConfig.cmake)

# By default we don't use a specific processor target, so PROC_TARGET_NUMBER is set to 0.
# Specify other values to optimize for specific processor architecture as listed in ProcessorTargets.cmake:
set(PROC_TARGET_NUMBER 0 CACHE STRING "Selected target processor from the list taken from ProcessorTargets.cmake")
# Loads the ProcessorTargets list:
include(ProcessorTargets.cmake)
set(PROC_FLAGS "" CACHE STRING "Target processor related build/link flags")
if(NOT(PROC_TARGET_NUMBER EQUAL 0))
set(PROC_FLAGS ${PROC_TARGET_${PROC_TARGET_NUMBER}_FLAGS})
endif()

add_subdirectory(src)
add_subdirectory(pkgconfig)

# cmake config files
if (WIN32)
set(RTPROCESS_LIBRARY_NAME ${CMAKE_SHARED_LIBRARY_PREFIX}${PROJECT_NAME}${CMAKE_IMPORT_LIBRARY_SUFFIX})
else()
set(RTPROCESS_LIBRARY_NAME ${CMAKE_SHARED_LIBRARY_PREFIX}${PROJECT_NAME}${CMAKE_SHARED_LIBRARY_SUFFIX})
endif()

set(INCLUDE_INSTALL_DIR ${CMAKE_INSTALL_INCLUDEDIR} CACHE INTERNAL "")
set(LIB_INSTALL_DIR ${CMAKE_INSTALL_LIBDIR} CACHE INTERNAL "")
configure_package_config_file(${PROJECT_NAME}-config.cmake.in
${CMAKE_CURRENT_BINARY_DIR}/${PROJECT_NAME}-config.cmake
PATH_VARS
INCLUDE_INSTALL_DIR LIB_INSTALL_DIR
INSTALL_DESTINATION
${CMAKE_INSTALL_LIBDIR}/cmake/${PROJECT_NAME})

write_basic_package_version_file(${PROJECT_NAME}-config-version.cmake
COMPATIBILITY
AnyNewerVersion)

install(FILES
${CMAKE_CURRENT_BINARY_DIR}/${PROJECT_NAME}-config.cmake
${CMAKE_CURRENT_BINARY_DIR}/${PROJECT_NAME}-config-version.cmake
DESTINATION
${CMAKE_INSTALL_LIBDIR}/cmake/${PROJECT_NAME}
COMPONENT
devel)

# Add 'make dist' target which makes sure to invoke cmake before
add_custom_target(dist
COMMAND ${CMAKE_MAKE_PROGRAM} package_source)
ADD_LIBRARY(librtprocess STATIC ${CMAKE_CURRENT_SOURCE_DIR}/src/demosaic/ahd.cc
${CMAKE_CURRENT_SOURCE_DIR}/src/demosaic/amaze.cc
${CMAKE_CURRENT_SOURCE_DIR}/src/demosaic/bayerfast.cc
${CMAKE_CURRENT_SOURCE_DIR}/src/demosaic/border.cc
${CMAKE_CURRENT_SOURCE_DIR}/src/demosaic/dcb.cc
${CMAKE_CURRENT_SOURCE_DIR}/src/demosaic/hphd.cc
${CMAKE_CURRENT_SOURCE_DIR}/src/demosaic/igv.cc
${CMAKE_CURRENT_SOURCE_DIR}/src/demosaic/lmmse.cc
${CMAKE_CURRENT_SOURCE_DIR}/src/demosaic/markesteijn.cc
${CMAKE_CURRENT_SOURCE_DIR}/src/demosaic/rcd.cc
${CMAKE_CURRENT_SOURCE_DIR}/src/demosaic/vng4.cc
${CMAKE_CURRENT_SOURCE_DIR}/src/demosaic/xtransfast.cc)
SET(LUMINANCE_MODULES_CLI ${LUMINANCE_MODULES_CLI} librtprocess PARENT_SCOPE)
SET(LUMINANCE_MODULES_GUI ${LUMINANCE_MODULES_GUI} librtprocess PARENT_SCOPE)
2 changes: 1 addition & 1 deletion librtprocess/DefineOptions.cmake
@@ -1,4 +1,4 @@
option(OPTION_OMP "Build with OpenMP support" ON)
option(VERBOSE "Build in verbose mode" OFF)
option(PICKY_DEVELOPER "Build with picky developer flags" OFF)
option(WITH_STATIC_LIB "Build with a static library" OFF)
option(WITH_STATIC_LIB "Build with a static library" ON)
4 changes: 2 additions & 2 deletions src/Libpfs/io/rawreader.cpp
Expand Up @@ -27,7 +27,7 @@
#include <sstream>
#include <vector>

#include <rtprocess/librtprocess.h>
#include "librtprocess.h"

#include <Libpfs/colorspace/copy.h>
#include <Libpfs/colorspace/gamma.h>
Expand Down Expand Up @@ -626,7 +626,7 @@ void RAWReader::read(Frame &frame, const Params &params) {
break;
case 10:
PRINT_DEBUG("AMAZE DEMOSAICING");
amaze_demosaic(W, H, 0, 0, W, H, rawdata, r, g, b, cf_array, callback, 1.0, 0, 1.0, 1.0, 4);
amaze_demosaic(W, H, 0, 0, W, H, rawdata, r, g, b, cf_array, callback, 1.0, 0, 1.0f, 1.0f);
break;
}
}
Expand Down
2 changes: 1 addition & 1 deletion src/Libpfs/rt_algo.cpp
Expand Up @@ -30,7 +30,7 @@
#endif

#include "rt_algo.h"
#include "rt_math.h"
#include "lhdr_math.h"

namespace lhdrengine
{
Expand Down
2 changes: 1 addition & 1 deletion src/TonemappingOperators/vanhateren06/tmo_vanhateren06.cpp
Expand Up @@ -38,7 +38,7 @@
#include "Libpfs/utils/msec_timer.h"
#include "Libpfs/utils/clamp.h"
#include <Libpfs/colorspace/normalizer.h>
#include "rt_math.h"
#include "lhdr_math.h"
#include "tmo_vanhateren06.h"

using namespace pfs;
Expand Down
File renamed without changes.
2 changes: 1 addition & 1 deletion src/sleef.c
Expand Up @@ -13,7 +13,7 @@
#include <assert.h>
#include <stdint.h>
//#include <math.h>
#include "rt_math.h"
#include "lhdr_math.h"
//#include <bits/nan.h>
//#include <bits/inf.h>

Expand Down
2 changes: 1 addition & 1 deletion src/sleefsseavx.c
Expand Up @@ -16,7 +16,7 @@
//#include <bits/nan.h>
//#include <bits/inf.h>
//#include "sleefsseavx.h"
#include "rt_math.h"
#include "lhdr_math.h"
#ifdef __SSE2__
#include "helpersse2.h"

Expand Down

0 comments on commit ac32037

Please sign in to comment.