Cleaned up KLT CMake files from PR #3912

This commit is contained in:
Morgan Hardwood 2017-06-26 14:17:23 +02:00
parent 0b4405972d
commit 73573e1b87
3 changed files with 61 additions and 60 deletions

View File

@ -112,7 +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(WITH_SYSTEM_KLT "Build using system KLT library." 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)
@ -293,8 +293,8 @@ find_package(JPEG REQUIRED)
find_package(PNG REQUIRED)
find_package(TIFF REQUIRED)
find_package(ZLIB REQUIRED)
if (WITH_SYSTEM_KLT)
find_package (KLT REQUIRED)
if(WITH_SYSTEM_KLT)
find_package(KLT REQUIRED)
endif()
# Check for libcanberra-gtk3 (sound events on Linux):

View File

@ -15,59 +15,52 @@
#
if (KLT_LIBRARIES AND KLT_INCLUDE_DIRS)
# in cache already
set(KLT_FOUND TRUE)
else (KLT_LIBRARIES AND KLT_INCLUDE_DIRS)
if(KLT_LIBRARIES AND KLT_INCLUDE_DIRS)
# in cache already
set(KLT_FOUND TRUE)
else()
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_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)
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_INCLUDE_DIRS
${KLT_INCLUDE_DIR}
)
set(KLT_LIBRARIES ${KLT_LIBRARY})
set(KLT_LIBRARIES
${KLT_LIBRARY}
)
if(KLT_INCLUDE_DIRS AND KLT_LIBRARIES)
set(KLT_FOUND TRUE)
endif()
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)
if(KLT_FOUND)
if(NOT KLT_FIND_QUIETLY)
message(STATUS "Found KLT: ${KLT_LIBRARIES}")
endif()
else()
message(STATUS "KLT not found.")
endif()
mark_as_advanced(KLT_INCLUDE_DIRS KLT_LIBRARIES)
endif()

View File

@ -111,13 +111,21 @@ 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 ()
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}")