Merge pull request #3912 from mattiaverga/klt

Optionally use system KLT library
This commit is contained in:
Beep6581 2017-06-26 14:08:01 +02:00 committed by GitHub
commit 0b4405972d
3 changed files with 85 additions and 0 deletions

View File

@ -112,6 +112,7 @@ option(WITH_MYFILE_MMAP "Build using memory mapped file" ON)
option(WITH_LTO "Build with link-time optimizations" OFF)
option(WITH_SAN "Build with run-time sanitizer" OFF)
option(WITH_PROF "Build with profiling instrumentation" OFF)
option(WITH_SYSTEM_KLT "Build using system's KLT libraries." OFF)
option(OPTION_OMP "Build with OpenMP support" ON)
option(STRICT_MUTEX "True (recommended): MyMutex will behave like POSIX Mutex; False: MyMutex will behave like POSIX RecMutex; Note: forced to ON for Debug builds" ON)
option(TRACE_MYRWMUTEX "Trace custom R/W Mutex (Debug builds only); redirecting std::out to a file is strongly recommended!" OFF)
@ -292,6 +293,9 @@ find_package(JPEG REQUIRED)
find_package(PNG REQUIRED)
find_package(TIFF REQUIRED)
find_package(ZLIB REQUIRED)
if (WITH_SYSTEM_KLT)
find_package (KLT REQUIRED)
endif()
# Check for libcanberra-gtk3 (sound events on Linux):
if(UNIX AND(NOT APPLE))

View File

@ -0,0 +1,73 @@
# - Try to find KLT
# Once done this will define
#
# KLT_FOUND - system has KLT
# KLT_INCLUDE_DIRS - the KLT include directory
# KLT_LIBRARIES - Link these to use KLT
# KLT_DEFINITIONS - Compiler switches required for using KLT
#
# Copyright (c) 2009 Andreas Schneider <mail@cynapses.org>
# updated for KLT by Dan Horák
#
# Redistribution and use is allowed according to the terms of the New
# BSD license.
# For details see the accompanying COPYING-CMAKE-SCRIPTS file.
#
if (KLT_LIBRARIES AND KLT_INCLUDE_DIRS)
# in cache already
set(KLT_FOUND TRUE)
else (KLT_LIBRARIES AND KLT_INCLUDE_DIRS)
find_path(KLT_INCLUDE_DIR
NAMES
klt.h
PATHS
/usr/include
/usr/local/include
/opt/local/include
/sw/include
${CMAKE_INSTALL_PREFIX}/include
PATH_SUFFIXES
klt
)
mark_as_advanced(KLT_INCLUDE_DIR)
find_library(KLT_LIBRARY
NAMES
klt
PATHS
/usr/lib64
/usr/lib
/usr/local/lib
/opt/local/lib
/sw/lib
${CMAKE_INSTALL_PREFIX}/lib
)
mark_as_advanced(KLT_LIBRARY)
set(KLT_INCLUDE_DIRS
${KLT_INCLUDE_DIR}
)
set(KLT_LIBRARIES
${KLT_LIBRARY}
)
if (KLT_INCLUDE_DIRS AND KLT_LIBRARIES)
set(KLT_FOUND TRUE)
endif (KLT_INCLUDE_DIRS AND KLT_LIBRARIES)
if (KLT_FOUND)
if (NOT KLT_FIND_QUIETLY)
message(STATUS "Found KLT: ${KLT_LIBRARIES}")
endif (NOT KLT_FIND_QUIETLY)
else (KLT_FOUND)
message(STATUS "KLT not found.")
endif (KLT_FOUND)
mark_as_advanced(KLT_INCLUDE_DIRS KLT_LIBRARIES)
endif (KLT_LIBRARIES AND KLT_INCLUDE_DIRS)

View File

@ -111,6 +111,14 @@ set(RTENGINESOURCEFILES
utils.cc
)
if (NOT WITH_SYSTEM_KLT)
set (RTENGINESOURCEFILES ${RTENGINESOURCEFILES}
klt/convolve.cc klt/error.cc klt/klt.cc klt/klt_util.cc klt/pnmio.cc klt/pyramid.cc klt/selectGoodFeatures.cc
klt/storeFeatures.cc klt/trackFeatures.cc klt/writeFeatures.cc
)
set (KLT_LIBRARIES)
endif ()
include_directories(BEFORE "${CMAKE_CURRENT_BINARY_DIR}")
add_library(rtengine ${RTENGINESOURCEFILES})