1 cmake_minimum_required(VERSION 2.8.11 FATAL_ERROR)
5 set(CAROTENE_NS "carotene" CACHE STRING "Namespace for Carotene definitions")
7 set(CAROTENE_INCLUDE_DIR include)
8 set(CAROTENE_SOURCE_DIR src)
10 file(GLOB_RECURSE carotene_headers RELATIVE "${CMAKE_CURRENT_LIST_DIR}" "${CAROTENE_INCLUDE_DIR}/*.hpp")
11 file(GLOB_RECURSE carotene_sources RELATIVE "${CMAKE_CURRENT_LIST_DIR}" "${CAROTENE_SOURCE_DIR}/*.cpp"
12 "${CAROTENE_SOURCE_DIR}/*.hpp")
14 include_directories(${CAROTENE_INCLUDE_DIR})
16 if(CMAKE_COMPILER_IS_GNUCC)
17 set(CMAKE_CXX_FLAGS "-fvisibility=hidden ${CMAKE_CXX_FLAGS}")
19 # allow more inlines - these parameters improve performance for:
20 # - matchTemplate about 5-10%
21 # - goodFeaturesToTrack 10-20%
22 # - cornerHarris 30% for some cases
24 set_source_files_properties(${carotene_sources} COMPILE_FLAGS "--param ipcp-unit-growth=100000 --param inline-unit-growth=100000 --param large-stack-frame-growth=5000")
27 add_library(carotene_objs OBJECT
32 if(NOT CAROTENE_NS STREQUAL "carotene")
33 target_compile_definitions(carotene_objs PUBLIC "-DCAROTENE_NS=${CAROTENE_NS}")
37 target_compile_definitions(carotene_objs PRIVATE "-DWITH_NEON")
40 add_library(carotene STATIC EXCLUDE_FROM_ALL "$<TARGET_OBJECTS:carotene_objs>")