From: AoD314 Date: Thu, 7 Mar 2013 15:28:15 +0000 (+0400) Subject: added CMakeLists.txt for build WebP X-Git-Tag: submit/tizen_ivi/20141117.190038~2^2~1148^2~3 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=fd44322b4fcc50e7316364caeb7b4f15b1eeb11b;p=profile%2Fivi%2Fopencv.git added CMakeLists.txt for build WebP --- diff --git a/3rdparty/libwebp/CMakeLists.txt b/3rdparty/libwebp/CMakeLists.txt new file mode 100644 index 0000000..6c6c1a6 --- /dev/null +++ b/3rdparty/libwebp/CMakeLists.txt @@ -0,0 +1,57 @@ +# ---------------------------------------------------------------------------- +# CMake file for libwebp. See root CMakeLists.txt +# +# ---------------------------------------------------------------------------- +project(${WEBP_LIBRARY}) + +ocv_include_directories(${CMAKE_CURRENT_SOURCE_DIR}) +ocv_include_directories("${CMAKE_CURRENT_SOURCE_DIR}/cpu-features") + +file(GLOB lib_srcs dec/*.c dsp/*.c enc/*.c mux/*.c utils/*.c webp/*.c) +file(GLOB lib_hdrs dec/*.h dsp/*.h enc/*.h mux/*.h utils/*.h webp/*.h) + +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() + +file(GLOB cpuf_s cpu-features/*.c) +file(GLOB cpuf_h cpu-features/*.h) + +if(ANDROID) + set(lib_srcs ${lib_srcs} ${cpuf_s}) + set(lib_hdrs ${lib_hdrs} ${cpuf_h}) +endif() + +# ---------------------------------------------------------------------------------- +# Define the library target: +# ---------------------------------------------------------------------------------- + +add_definitions(-DWEBP_USE_THREAD) + +add_library(${WEBP_LIBRARY} STATIC ${lib_srcs} ${lib_hdrs}) + +if(UNIX) + if(CMAKE_COMPILER_IS_GNUCXX OR CV_ICC) + set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -fPIC") + endif() +endif() + +ocv_warnings_disable(CMAKE_C_FLAGS -Wunused-variable -Wshadow) + +set_target_properties(${WEBP_LIBRARY} + PROPERTIES OUTPUT_NAME ${WEBP_LIBRARY} + DEBUG_POSTFIX "${OPENCV_DEBUG_POSTFIX}" + 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) + install(TARGETS ${WEBP_LIBRARY} ARCHIVE DESTINATION ${OPENCV_3P_LIB_INSTALL_PATH} COMPONENT main) +endif()