opencv/3rdparty/cpufeatures/CMakeLists.txt

36 lines
1.3 KiB
CMake
Raw Normal View History

2017-06-09 23:24:14 +08:00
if(NOT ANDROID)
message("cpufeatures is ANDROID project")
endif()
2017-05-19 21:14:01 +08:00
ocv_update(OPENCV_CPUFEATURES_TARGET_NAME libcpufeatures)
2017-06-09 23:24:14 +08:00
set(CPUFEATURES_ROOT "${CMAKE_CURRENT_SOURCE_DIR}" CACHE PATH "Android cpufeatures project sources (for example, <android-ndk>/sources/android/cpufeatures)")
2017-05-19 21:14:01 +08:00
2017-06-09 23:24:14 +08:00
set(CPUFEATURES_INCLUDE_DIRS ${CPUFEATURES_ROOT} CACHE INTERNAL "")
set(CPUFEATURES_LIBRARIES "${OPENCV_CPUFEATURES_TARGET_NAME}" CACHE INTERNAL "")
2017-05-19 21:14:01 +08:00
2017-06-09 23:24:14 +08:00
if(NOT DEFINED CPUFEATURES_SOURCES)
set(CPUFEATURES_SOURCES ${CPUFEATURES_ROOT}/cpu-features.c ${CPUFEATURES_ROOT}/cpu-features.h)
endif()
2017-05-19 21:14:01 +08:00
2017-06-09 23:24:14 +08:00
include_directories(${CPUFEATURES_INCLUDE_DIRS})
add_library(${OPENCV_CPUFEATURES_TARGET_NAME} STATIC ${CPUFEATURES_SOURCES})
2017-05-19 21:14:01 +08:00
set_target_properties(${OPENCV_CPUFEATURES_TARGET_NAME}
2017-05-19 21:14:01 +08:00
PROPERTIES OUTPUT_NAME cpufeatures
DEBUG_POSTFIX "${OPENCV_DEBUG_POSTFIX}"
COMPILE_PDB_NAME cpufeatures
COMPILE_PDB_NAME_DEBUG "cpufeatures${OPENCV_DEBUG_POSTFIX}"
ARCHIVE_OUTPUT_DIRECTORY ${3P_LIBRARY_OUTPUT_PATH}
2017-06-09 23:24:14 +08:00
)
2017-05-19 21:14:01 +08:00
if(ENABLE_SOLUTION_FOLDERS)
set_target_properties(${OPENCV_CPUFEATURES_TARGET_NAME} PROPERTIES FOLDER "3rdparty")
2017-05-19 21:14:01 +08:00
endif()
if(NOT BUILD_SHARED_LIBS)
ocv_install_target(${OPENCV_CPUFEATURES_TARGET_NAME} EXPORT OpenCVModules ARCHIVE DESTINATION ${OPENCV_3P_LIB_INSTALL_PATH} COMPONENT dev)
2017-05-19 21:14:01 +08:00
endif()
ocv_install_3rdparty_licenses(cpufeatures LICENSE README.md)