CMakeLists.txt 1.4 KB

1234567891011121314151617181920212223242526272829303132333435
  1. if(NOT ANDROID)
  2. message("cpufeatures is ANDROID project")
  3. endif()
  4. ocv_update(OPENCV_CPUFEATURES_TARGET_NAME libcpufeatures)
  5. set(CPUFEATURES_ROOT "${CMAKE_CURRENT_SOURCE_DIR}" CACHE PATH "Android cpufeatures project sources (for example, <android-ndk>/sources/android/cpufeatures)")
  6. set(CPUFEATURES_INCLUDE_DIRS ${CPUFEATURES_ROOT} CACHE INTERNAL "")
  7. set(CPUFEATURES_LIBRARIES "${OPENCV_CPUFEATURES_TARGET_NAME}" CACHE INTERNAL "")
  8. if(NOT DEFINED CPUFEATURES_SOURCES)
  9. set(CPUFEATURES_SOURCES ${CPUFEATURES_ROOT}/cpu-features.c ${CPUFEATURES_ROOT}/cpu-features.h)
  10. endif()
  11. include_directories(${CPUFEATURES_INCLUDE_DIRS})
  12. add_library(${OPENCV_CPUFEATURES_TARGET_NAME} STATIC ${OPENCV_3RDPARTY_EXCLUDE_FROM_ALL} ${CPUFEATURES_SOURCES})
  13. set_target_properties(${OPENCV_CPUFEATURES_TARGET_NAME}
  14. PROPERTIES OUTPUT_NAME cpufeatures
  15. DEBUG_POSTFIX "${OPENCV_DEBUG_POSTFIX}"
  16. COMPILE_PDB_NAME cpufeatures
  17. COMPILE_PDB_NAME_DEBUG "cpufeatures${OPENCV_DEBUG_POSTFIX}"
  18. ARCHIVE_OUTPUT_DIRECTORY ${3P_LIBRARY_OUTPUT_PATH}
  19. )
  20. if(ENABLE_SOLUTION_FOLDERS)
  21. set_target_properties(${OPENCV_CPUFEATURES_TARGET_NAME} PROPERTIES FOLDER "3rdparty")
  22. endif()
  23. if(NOT BUILD_SHARED_LIBS)
  24. ocv_install_target(${OPENCV_CPUFEATURES_TARGET_NAME} EXPORT OpenCVModules ARCHIVE DESTINATION ${OPENCV_3P_LIB_INSTALL_PATH} COMPONENT dev OPTIONAL)
  25. endif()
  26. ocv_install_3rdparty_licenses(cpufeatures LICENSE README.md)