2013-03-07 23:28:15 +08:00
|
|
|
# ----------------------------------------------------------------------------
|
|
|
|
# CMake file for libwebp. See root CMakeLists.txt
|
|
|
|
#
|
|
|
|
# ----------------------------------------------------------------------------
|
|
|
|
project(${WEBP_LIBRARY})
|
|
|
|
|
|
|
|
ocv_include_directories(${CMAKE_CURRENT_SOURCE_DIR})
|
2017-06-13 00:10:13 +08:00
|
|
|
if(ANDROID)
|
|
|
|
ocv_include_directories(${CPUFEATURES_INCLUDE_DIRS})
|
|
|
|
endif()
|
2013-03-07 23:28:15 +08:00
|
|
|
|
2017-12-08 23:19:30 +08:00
|
|
|
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)
|
|
|
|
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)
|
2013-03-07 23:28:15 +08:00
|
|
|
|
2015-12-10 23:03:48 +08:00
|
|
|
# FIXIT
|
2013-03-07 23:28:15 +08:00
|
|
|
if(ANDROID AND ARMEABI_V7A AND NOT NEON)
|
|
|
|
foreach(file ${lib_srcs})
|
|
|
|
if("${file}" MATCHES "_neon.c")
|
|
|
|
set_source_files_properties("${file}" COMPILE_FLAGS "-mfpu=neon")
|
|
|
|
endif()
|
|
|
|
endforeach()
|
|
|
|
endif()
|
|
|
|
|
2019-06-04 02:25:34 +08:00
|
|
|
# FIX for quant.h - requires C99 for() loops
|
|
|
|
ocv_check_flag_support(C "-std=c99" _varname "${CMAKE_C_FLAGS}")
|
|
|
|
if(${_varname})
|
|
|
|
set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -std=c99")
|
|
|
|
endif()
|
2013-03-07 23:28:15 +08:00
|
|
|
|
|
|
|
|
|
|
|
# ----------------------------------------------------------------------------------
|
|
|
|
# Define the library target:
|
|
|
|
# ----------------------------------------------------------------------------------
|
|
|
|
|
|
|
|
add_definitions(-DWEBP_USE_THREAD)
|
|
|
|
|
|
|
|
add_library(${WEBP_LIBRARY} STATIC ${lib_srcs} ${lib_hdrs})
|
2017-06-13 00:10:13 +08:00
|
|
|
if(ANDROID)
|
|
|
|
target_link_libraries(${WEBP_LIBRARY} ${CPUFEATURES_LIBRARIES})
|
|
|
|
endif()
|
2013-03-07 23:28:15 +08:00
|
|
|
|
2017-12-08 23:19:30 +08:00
|
|
|
ocv_warnings_disable(CMAKE_C_FLAGS -Wunused-variable -Wunused-function -Wshadow -Wmaybe-uninitialized
|
|
|
|
-Wmissing-prototypes # clang
|
|
|
|
-Wmissing-declarations # gcc
|
2018-04-20 00:54:03 +08:00
|
|
|
-Wimplicit-fallthrough
|
2017-12-08 23:19:30 +08:00
|
|
|
)
|
2013-03-13 15:34:04 +08:00
|
|
|
ocv_warnings_disable(CMAKE_C_FLAGS /wd4244 /wd4267) # vs2005
|
2013-03-07 23:28:15 +08:00
|
|
|
|
|
|
|
set_target_properties(${WEBP_LIBRARY}
|
|
|
|
PROPERTIES OUTPUT_NAME ${WEBP_LIBRARY}
|
|
|
|
DEBUG_POSTFIX "${OPENCV_DEBUG_POSTFIX}"
|
2015-08-17 08:28:22 +08:00
|
|
|
COMPILE_PDB_NAME ${WEBP_LIBRARY}
|
|
|
|
COMPILE_PDB_NAME_DEBUG "${WEBP_LIBRARY}${OPENCV_DEBUG_POSTFIX}"
|
2013-03-07 23:28:15 +08:00
|
|
|
ARCHIVE_OUTPUT_DIRECTORY ${3P_LIBRARY_OUTPUT_PATH}
|
|
|
|
)
|
|
|
|
|
|
|
|
if(ENABLE_SOLUTION_FOLDERS)
|
|
|
|
set_target_properties(${WEBP_LIBRARY} PROPERTIES FOLDER "3rdparty")
|
|
|
|
endif()
|
|
|
|
|
|
|
|
if(NOT BUILD_SHARED_LIBS)
|
2015-06-04 00:01:48 +08:00
|
|
|
ocv_install_target(${WEBP_LIBRARY} EXPORT OpenCVModules ARCHIVE DESTINATION ${OPENCV_3P_LIB_INSTALL_PATH} COMPONENT dev)
|
2013-03-07 23:28:15 +08:00
|
|
|
endif()
|
2013-10-15 22:43:37 +08:00
|
|
|
|