APR.cmake 1.1 KB

123456789101112131415161718192021222324252627282930313233343536
  1. # -*- cmake -*-
  2. if (APR_CMAKE_INCLUDED)
  3. return()
  4. endif (APR_CMAKE_INCLUDED)
  5. set (APR_CMAKE_INCLUDED TRUE)
  6. include(Linking)
  7. include(Prebuilt)
  8. # Disable system libs support for now, since our APR library is patched,
  9. # which is not the case on a standard system.
  10. #if (USESYSTEMLIBS)
  11. # set(APR_FIND_QUIETLY ON)
  12. # set(APR_FIND_REQUIRED OFF)
  13. # include(FindAPR)
  14. #endif (USESYSTEMLIBS)
  15. if (NOT APR_FOUND)
  16. use_prebuilt_binary(apr_suite)
  17. if (WINDOWS)
  18. add_definitions(-DAPR_DECLARE_STATIC)
  19. set(APR_LIBRARIES ${ARCH_PREBUILT_DIRS_RELEASE}/apr-1.lib)
  20. elseif (DARWIN)
  21. set(APR_LIBRARIES ${ARCH_PREBUILT_DIRS_RELEASE}/libapr-1.a)
  22. elseif (LINUX)
  23. # NOTE: under Linux, we cannot use a static libapr-1 library,
  24. # because the pthread implementation of the library build system
  25. # would possibly (in fact likely, since we use old Ubuntu 18.4) be
  26. # different than the one of the viewer build system and ld would
  27. # throw missing pthread_* symbols... HB
  28. set(APR_LIBRARIES apr-1 uuid rt)
  29. endif ()
  30. set(APR_INCLUDE_DIR ${LIBS_PREBUILT_DIR}/include/apr-1)
  31. endif (NOT APR_FOUND)
  32. include_directories(SYSTEM ${APR_INCLUDE_DIR})