enabled gst
[profile/ivi/opencv.git] / 3rdparty / libwebp / CMakeLists.txt
1 # ----------------------------------------------------------------------------
2 #  CMake file for libwebp. See root CMakeLists.txt
3 #
4 # ----------------------------------------------------------------------------
5 project(${WEBP_LIBRARY})
6
7 ocv_include_directories(${CMAKE_CURRENT_SOURCE_DIR})
8 ocv_include_directories("${CMAKE_CURRENT_SOURCE_DIR}/cpu-features")
9
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)
12
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
21 file(GLOB cpuf_s cpu-features/*.c)
22 file(GLOB cpuf_h cpu-features/*.h)
23
24 if(ANDROID)
25   set(lib_srcs ${lib_srcs} ${cpuf_s})
26   set(lib_hdrs ${lib_hdrs} ${cpuf_h})
27 endif()
28
29 # ----------------------------------------------------------------------------------
30 #         Define the library target:
31 # ----------------------------------------------------------------------------------
32
33 add_definitions(-DWEBP_USE_THREAD)
34
35 add_library(${WEBP_LIBRARY} STATIC ${lib_srcs} ${lib_hdrs})
36
37 if(UNIX)
38   if(CMAKE_COMPILER_IS_GNUCXX OR CV_ICC)
39     set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -fPIC")
40   endif()
41 endif()
42
43 ocv_warnings_disable(CMAKE_C_FLAGS -Wunused-variable -Wshadow -Wmaybe-uninitialized)
44 ocv_warnings_disable(CMAKE_C_FLAGS /wd4244 /wd4267) # vs2005
45
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}
50   )
51
52 if(ENABLE_SOLUTION_FOLDERS)
53   set_target_properties(${WEBP_LIBRARY} PROPERTIES FOLDER "3rdparty")
54 endif()
55
56 if(NOT BUILD_SHARED_LIBS)
57   ocv_install_target(${WEBP_LIBRARY} EXPORT OpenCVModules ARCHIVE DESTINATION ${OPENCV_3P_LIB_INSTALL_PATH} COMPONENT main)
58 endif()
59