microsoft/onnxruntime-extensions
Publicmirrored from https://github.com/microsoft/onnxruntime-extensionsAvailable
cmake/externals/libpng.cmake
24lines · modecode
| 1 | set(PNG_SHARED OFF CACHE INTERNAL "") |
| 2 | set(PNG_TESTS OFF CACHE INTERNAL "") |
| 3 | set(PNG_EXECUTABLES OFF CACHE INTERNAL "") |
| 4 | set(PNG_BUILD_ZLIB ON CACHE INTERNAL "") |
| 5 | |
| 6 | FetchContent_Declare( |
| 7 | libpng |
| 8 | GIT_REPOSITORY https://github.com/glennrp/libpng.git |
| 9 | GIT_TAG v1.6.39 |
| 10 | GIT_SHALLOW TRUE |
| 11 | ) |
| 12 | |
| 13 | FetchContent_MakeAvailable(libpng) |
| 14 | |
| 15 | if (MSVC) |
| 16 | # assume we're building zlib and need to manually specify the dependency. |
| 17 | add_dependencies(png_static ${ZLIB_LIBRARIES}) |
| 18 | endif() |
| 19 | |
| 20 | target_link_libraries(png_static ${ZLIB_LIBRARIES}) |
| 21 | target_include_directories(png_static PRIVATE ${zlib_SOURCE_DIR} ${zlib_BINARY_DIR}) |
| 22 | |
| 23 | set(libpng_INCLUDE_DIRS ${libpng_SOURCE_DIR} ${libpng_BINARY_DIR}) |
| 24 | set(libpng_LIB_NAME png_static) |
| 25 | |