CMakeLists.txt 2.2 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566
  1. # ----------------------------------------------------------------------------
  2. # CMake file for libwebp. See root CMakeLists.txt
  3. #
  4. # ----------------------------------------------------------------------------
  5. project(${WEBP_LIBRARY})
  6. ocv_include_directories(${CMAKE_CURRENT_SOURCE_DIR})
  7. if(ANDROID)
  8. ocv_include_directories(${CPUFEATURES_INCLUDE_DIRS})
  9. endif()
  10. file(GLOB lib_srcs src/dec/*.c src/demux/*.c src/dsp/*.c src/enc/*.c src/mux/*.c src/utils/*.c src/webp/*.c)
  11. file(GLOB lib_hdrs src/dec/*.h src/demux/*.h src/dsp/*.h src/enc/*.h src/mux/*.h src/utils/*.h src/webp/*.h)
  12. # FIXIT
  13. if(ANDROID AND ARMEABI_V7A AND NOT NEON)
  14. foreach(file ${lib_srcs})
  15. if("${file}" MATCHES "_neon.c")
  16. set_source_files_properties("${file}" COMPILE_FLAGS "-mfpu=neon")
  17. endif()
  18. endforeach()
  19. endif()
  20. # FIX for quant.h - requires C99 for() loops
  21. ocv_check_flag_support(C "-std=c99" _varname "${CMAKE_C_FLAGS}")
  22. if(${_varname})
  23. set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -std=c99")
  24. endif()
  25. # ----------------------------------------------------------------------------------
  26. # Define the library target:
  27. # ----------------------------------------------------------------------------------
  28. if(NOT OPENCV_DISABLE_THREAD_SUPPORT)
  29. add_definitions(-DWEBP_USE_THREAD)
  30. endif()
  31. add_library(${WEBP_LIBRARY} STATIC ${OPENCV_3RDPARTY_EXCLUDE_FROM_ALL} ${lib_srcs} ${lib_hdrs})
  32. if(ANDROID)
  33. target_link_libraries(${WEBP_LIBRARY} ${CPUFEATURES_LIBRARIES})
  34. endif()
  35. ocv_warnings_disable(CMAKE_C_FLAGS -Wunused-variable -Wunused-function -Wshadow -Wmaybe-uninitialized
  36. -Wmissing-prototypes # clang
  37. -Wmissing-declarations # gcc
  38. -Wimplicit-fallthrough
  39. )
  40. ocv_warnings_disable(CMAKE_C_FLAGS /wd4244 /wd4267) # vs2005
  41. set_target_properties(${WEBP_LIBRARY}
  42. PROPERTIES OUTPUT_NAME ${WEBP_LIBRARY}
  43. DEBUG_POSTFIX "${OPENCV_DEBUG_POSTFIX}"
  44. COMPILE_PDB_NAME ${WEBP_LIBRARY}
  45. COMPILE_PDB_NAME_DEBUG "${WEBP_LIBRARY}${OPENCV_DEBUG_POSTFIX}"
  46. ARCHIVE_OUTPUT_DIRECTORY ${3P_LIBRARY_OUTPUT_PATH}
  47. )
  48. if(ENABLE_SOLUTION_FOLDERS)
  49. set_target_properties(${WEBP_LIBRARY} PROPERTIES FOLDER "3rdparty")
  50. endif()
  51. if(NOT BUILD_SHARED_LIBS)
  52. ocv_install_target(${WEBP_LIBRARY} EXPORT OpenCVModules ARCHIVE DESTINATION ${OPENCV_3P_LIB_INSTALL_PATH} COMPONENT dev OPTIONAL)
  53. endif()