1 # ----------------------------------------------------------------------------
2 # CMake file for libwebp. See root CMakeLists.txt
4 # ----------------------------------------------------------------------------
5 project(${WEBP_LIBRARY})
7 ocv_include_directories(${CMAKE_CURRENT_SOURCE_DIR})
8 ocv_include_directories("${CMAKE_CURRENT_SOURCE_DIR}/cpu-features")
10 file(GLOB lib_srcs dec/*.c dsp/*.c enc/*.c mux/*.c utils/*.c webp/*.c)
11 file(GLOB lib_hdrs dec/*.h dsp/*.h enc/*.h mux/*.h utils/*.h webp/*.h)
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")
21 file(GLOB cpuf_s cpu-features/*.c)
22 file(GLOB cpuf_h cpu-features/*.h)
25 set(lib_srcs ${lib_srcs} ${cpuf_s})
26 set(lib_hdrs ${lib_hdrs} ${cpuf_h})
29 # ----------------------------------------------------------------------------------
30 # Define the library target:
31 # ----------------------------------------------------------------------------------
33 add_definitions(-DWEBP_USE_THREAD)
35 add_library(${WEBP_LIBRARY} STATIC ${lib_srcs} ${lib_hdrs})
38 if(CMAKE_COMPILER_IS_GNUCXX OR CV_ICC)
39 set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -fPIC")
43 ocv_warnings_disable(CMAKE_C_FLAGS -Wunused-variable -Wshadow -Wmaybe-uninitialized)
44 ocv_warnings_disable(CMAKE_C_FLAGS /wd4244 /wd4267) # vs2005
46 set_target_properties(${WEBP_LIBRARY}
47 PROPERTIES OUTPUT_NAME ${WEBP_LIBRARY}
48 DEBUG_POSTFIX "${OPENCV_DEBUG_POSTFIX}"
49 ARCHIVE_OUTPUT_DIRECTORY ${3P_LIBRARY_OUTPUT_PATH}
52 if(ENABLE_SOLUTION_FOLDERS)
53 set_target_properties(${WEBP_LIBRARY} PROPERTIES FOLDER "3rdparty")
56 if(NOT BUILD_SHARED_LIBS)
57 install(TARGETS ${WEBP_LIBRARY} ARCHIVE DESTINATION ${OPENCV_3P_LIB_INSTALL_PATH} COMPONENT main)