1 # ----------------------------------------------------------------------------
2 # CMake file for libspng. See root CMakeLists.txt
4 # ----------------------------------------------------------------------------
6 project(${SPNG_LIBRARY})
8 set(CURR_INCLUDE_DIR "${CMAKE_CURRENT_LIST_DIR}")
9 set_property(GLOBAL PROPERTY SPNG_INCLUDE_DIR ${CURR_INCLUDE_DIR})
10 ocv_include_directories(${ZLIB_INCLUDE_DIRS})
12 file(GLOB_RECURSE spng_headers RELATIVE "${CMAKE_CURRENT_LIST_DIR}" "*.h")
13 file(GLOB_RECURSE spng_sources RELATIVE "${CMAKE_CURRENT_LIST_DIR}" "*.c")
15 message(STATUS "libspng will be used as PNG codec")
17 # ----------------------------------------------------------------------------------
18 # Define the library target:
19 # ----------------------------------------------------------------------------------
22 add_definitions(-D_CRT_SECURE_NO_DEPRECATE)
25 add_library(${SPNG_LIBRARY} STATIC ${OPENCV_3RDPARTY_EXCLUDE_FROM_ALL} ${spng_headers} ${spng_sources})
26 ocv_warnings_disable(CMAKE_C_FLAGS -Wunused-variable)
27 target_link_libraries(${SPNG_LIBRARY} ${ZLIB_LIBRARIES})
29 set_target_properties(${SPNG_LIBRARY}
30 PROPERTIES OUTPUT_NAME ${SPNG_LIBRARY}
31 DEBUG_POSTFIX "${OPENCV_DEBUG_POSTFIX}"
32 COMPILE_PDB_NAME ${SPNG_LIBRARY}
33 COMPILE_PDB_NAME_DEBUG "${SPNG_LIBRARY}${OPENCV_DEBUG_POSTFIX}"
34 ARCHIVE_OUTPUT_DIRECTORY ${3P_LIBRARY_OUTPUT_PATH}
37 target_compile_definitions(${SPNG_LIBRARY} PUBLIC SPNG_STATIC)
39 if(ENABLE_SOLUTION_FOLDERS)
40 set_target_properties(${SPNG_LIBRARY} PROPERTIES FOLDER "3rdparty")
43 if(NOT BUILD_SHARED_LIBS)
44 ocv_install_target(${SPNG_LIBRARY} EXPORT OpenCVModules ARCHIVE DESTINATION ${OPENCV_3P_LIB_INSTALL_PATH} COMPONENT dev OPTIONAL)
47 ocv_install_3rdparty_licenses(${SPNG_LIBRARY} LICENSE)