CMakeLists.txt 2.1 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152
  1. # ----------------------------------------------------------------------------
  2. # CMake file for libjasper. See root CMakeLists.txt
  3. #
  4. # ----------------------------------------------------------------------------
  5. project(${JASPER_LIBRARY})
  6. add_definitions(-DEXCLUDE_MIF_SUPPORT -DEXCLUDE_PNM_SUPPORT -DEXCLUDE_BMP_SUPPORT -DEXCLUDE_RAS_SUPPORT -DEXCLUDE_JPG_SUPPORT -DEXCLUDE_PGX_SUPPORT)
  7. ocv_include_directories(${CMAKE_CURRENT_SOURCE_DIR})
  8. file(GLOB lib_srcs *.c)
  9. file(GLOB lib_hdrs *.h)
  10. file(GLOB lib_ext_hdrs jasper/*.h)
  11. # ----------------------------------------------------------------------------------
  12. # Define the library target:
  13. # ----------------------------------------------------------------------------------
  14. add_library(${JASPER_LIBRARY} STATIC ${OPENCV_3RDPARTY_EXCLUDE_FROM_ALL} ${lib_srcs} ${lib_hdrs} ${lib_ext_hdrs})
  15. if(WIN32 AND NOT MINGW)
  16. add_definitions(-DJAS_WIN_MSVC_BUILD)
  17. endif(WIN32 AND NOT MINGW)
  18. ocv_warnings_disable(CMAKE_C_FLAGS -Wno-implicit-function-declaration -Wno-uninitialized -Wmissing-prototypes
  19. -Wno-unused-but-set-parameter -Wmissing-declarations -Wunused -Wshadow
  20. -Wsign-compare -Wstrict-overflow -Wpointer-compare
  21. -Wabsolute-value # clang on Linux
  22. -Wimplicit-fallthrough
  23. )
  24. ocv_warnings_disable(CMAKE_C_FLAGS -Wunused-parameter -Wstrict-prototypes) # clang
  25. ocv_warnings_disable(CMAKE_C_FLAGS /wd4013 /wd4018 /wd4101 /wd4244 /wd4267 /wd4715) # vs2005
  26. set_target_properties(${JASPER_LIBRARY}
  27. PROPERTIES
  28. OUTPUT_NAME ${JASPER_LIBRARY}
  29. DEBUG_POSTFIX "${OPENCV_DEBUG_POSTFIX}"
  30. COMPILE_PDB_NAME ${JASPER_LIBRARY}
  31. COMPILE_PDB_NAME_DEBUG "${JASPER_LIBRARY}${OPENCV_DEBUG_POSTFIX}"
  32. ARCHIVE_OUTPUT_DIRECTORY ${3P_LIBRARY_OUTPUT_PATH}
  33. )
  34. if(ENABLE_SOLUTION_FOLDERS)
  35. set_target_properties(${JASPER_LIBRARY} PROPERTIES FOLDER "3rdparty")
  36. endif()
  37. if(NOT BUILD_SHARED_LIBS)
  38. ocv_install_target(${JASPER_LIBRARY} EXPORT OpenCVModules ARCHIVE DESTINATION ${OPENCV_3P_LIB_INSTALL_PATH} COMPONENT dev OPTIONAL)
  39. endif()
  40. ocv_install_3rdparty_licenses(jasper LICENSE README copyright)