2010-09-22 04:01:54 +02:00
|
|
|
if(ANDROID)
|
|
|
|
file(GLOB_RECURSE flann_sources_cpp *.cpp)
|
|
|
|
define_android_manual(flann "${flann_sources_cpp}" "$(LOCAL_PATH)/../include $(LOCAL_PATH)/../include/flann")
|
|
|
|
else(ANDROID)
|
2010-05-11 19:44:00 +02:00
|
|
|
if (DEFINED OPENCV_VERSION)
|
|
|
|
|
|
|
|
# ----------------------------------------------------------------------------
|
|
|
|
# CMake file for libflann. See root CMakeLists.txt
|
|
|
|
#
|
|
|
|
# ----------------------------------------------------------------------------
|
|
|
|
project(flann)
|
|
|
|
|
|
|
|
# List of C++ files:
|
|
|
|
|
|
|
|
#set(CMAKE_BUILD_TYPE Debug)
|
|
|
|
|
|
|
|
include_directories(
|
|
|
|
${CMAKE_CURRENT_SOURCE_DIR}
|
|
|
|
"${CMAKE_CURRENT_SOURCE_DIR}/../include/flann"
|
|
|
|
)
|
|
|
|
|
|
|
|
# The .cpp files:
|
2010-09-14 20:13:09 +02:00
|
|
|
file(GLOB flann_sources *.cpp *.h *.hpp)
|
|
|
|
file(GLOB flann_h "${CMAKE_CURRENT_SOURCE_DIR}/../include/flann/*.h" "${CMAKE_CURRENT_SOURCE_DIR}/../include/flann/*.hpp")
|
2010-05-11 19:44:00 +02:00
|
|
|
|
2010-09-14 20:13:09 +02:00
|
|
|
source_group("Src" FILES ${flann_sources})
|
|
|
|
source_group("Include" FILES ${flann_h})
|
2010-05-11 19:44:00 +02:00
|
|
|
|
2010-09-14 20:13:09 +02:00
|
|
|
set(flann_sources ${flann_sources} ${flann_h})
|
2010-05-11 19:44:00 +02:00
|
|
|
|
|
|
|
# ----------------------------------------------------------------------------------
|
|
|
|
# Define the library target:
|
|
|
|
# ----------------------------------------------------------------------------------
|
|
|
|
|
|
|
|
set(the_target "flann")
|
|
|
|
|
|
|
|
add_library(${the_target} STATIC ${flann_sources})
|
|
|
|
add_definitions(-Dflann_EXPORTS)
|
|
|
|
|
|
|
|
if(MSVC)
|
|
|
|
set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} /W3")
|
|
|
|
add_definitions(-DJAS_WIN_MSVC_BUILD)
|
|
|
|
endif()
|
|
|
|
|
|
|
|
if(UNIX)
|
|
|
|
if(CMAKE_COMPILER_IS_GNUCXX OR CV_ICC)
|
|
|
|
set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -fPIC")
|
|
|
|
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -fPIC")
|
|
|
|
endif()
|
|
|
|
endif()
|
|
|
|
|
|
|
|
set_target_properties(${the_target}
|
|
|
|
PROPERTIES
|
|
|
|
OUTPUT_NAME "${the_target}"
|
|
|
|
DEBUG_POSTFIX "${OPENCV_DEBUG_POSTFIX}"
|
|
|
|
ARCHIVE_OUTPUT_DIRECTORY "${CMAKE_BINARY_DIR}/3rdparty/lib"
|
|
|
|
)
|
|
|
|
|
|
|
|
ELSE()
|
|
|
|
|
|
|
|
INCLUDE_DIRECTORIES(algorithms util nn .)
|
|
|
|
|
|
|
|
ADD_SUBDIRECTORY( tests )
|
|
|
|
|
|
|
|
file(GLOB_RECURSE SOURCES *.cpp)
|
|
|
|
#SET(SOURCES flann.cpp util/Random.cpp nn/Testing.cpp algorithms/NNIndex.cpp algorithms/dist.cpp util/Logger.cpp util/Saving.cpp)
|
|
|
|
|
|
|
|
ADD_LIBRARY(flann ${SOURCES})
|
|
|
|
#ADD_LIBRARY(flann SHARED ${SOURCES}) #JL: Why the two versions??
|
|
|
|
#ADD_LIBRARY(flann_s STATIC ${SOURCES})
|
|
|
|
|
|
|
|
IF(WIN32)
|
|
|
|
INSTALL (
|
|
|
|
TARGETS flann
|
|
|
|
RUNTIME DESTINATION matlab
|
|
|
|
)
|
|
|
|
INSTALL (
|
|
|
|
TARGETS flann
|
|
|
|
RUNTIME DESTINATION python/pyflann/bindings
|
|
|
|
)
|
|
|
|
ELSE(WIN32)
|
|
|
|
INSTALL (
|
|
|
|
TARGETS flann
|
|
|
|
LIBRARY DESTINATION python/pyflann/bindings
|
|
|
|
)
|
|
|
|
ENDIF(WIN32)
|
|
|
|
|
|
|
|
INSTALL (
|
|
|
|
TARGETS flann # flann_s
|
|
|
|
RUNTIME DESTINATION bin
|
|
|
|
LIBRARY DESTINATION lib
|
|
|
|
ARCHIVE DESTINATION lib
|
|
|
|
)
|
|
|
|
|
|
|
|
# INSTALL (
|
|
|
|
# TARGETS flann flann_s
|
|
|
|
# ARCHIVE DESTINATION ${PROJECT_SOURCE_DIR}/python
|
|
|
|
# LIBRARY DESTINATION ${PROJECT_SOURCE_DIR}/python
|
|
|
|
# )
|
|
|
|
|
|
|
|
INSTALL (
|
|
|
|
FILES flann.h constants.h
|
|
|
|
DESTINATION include
|
|
|
|
)
|
|
|
|
|
|
|
|
ENDIF()
|
2010-09-22 04:01:54 +02:00
|
|
|
endif(ANDROID)#android
|