CMakeLists.txt 654 B

123456789101112131415161718192021222324252627282930
  1. project(libpng C)
  2. include_directories(
  3. "${CMAKE_CURRENT_SOURCE_DIR}"
  4. ${OPENJPEG_SOURCE_DIR}/thirdparty/include
  5. )
  6. file(GLOB SRCS *.c)
  7. file(GLOB HDRS *.h)
  8. set(EXT_HDRS
  9. ${OPENJPEG_SOURCE_DIR}/thirdparty/include/zlib.h
  10. ${OPENJPEG_SOURCE_DIR}/thirdparty/include/zconf.h
  11. )
  12. #
  13. set(LIBTARGET "png")
  14. #
  15. add_library(${LIBTARGET} STATIC ${SRCS} ${HDRS} ${EXT_HDRS})
  16. #
  17. if(MSVC)
  18. set_target_properties(${LIBTARGET} PROPERTIES PREFIX "lib")
  19. endif(MSVC)
  20. #
  21. target_link_libraries(${LIBTARGET} ${Z_LIBNAME} ${M_LIBRARY})
  22. #
  23. set_target_properties(${LIBTARGET}
  24. PROPERTIES
  25. OUTPUT_NAME "${LIBTARGET}"
  26. ARCHIVE_OUTPUT_DIRECTORY ${CMAKE_BINARY_DIR}/thirdparty/lib)
  27. #