PostgreSQL native library for Tarantool programming language
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

CMakeLists.txt 1.3KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748
  1. cmake_minimum_required(VERSION 2.8 FATAL_ERROR)
  2. project(pg C)
  3. if(NOT CMAKE_BUILD_TYPE)
  4. set(CMAKE_BUILD_TYPE Debug)
  5. endif()
  6. set(CMAKE_MODULE_PATH "${CMAKE_CURRENT_SOURCE_DIR}/cmake" ${CMAKE_MODULE_PATH})
  7. # Find Tarantool
  8. set(TARANTOOL_FIND_REQUIRED ON)
  9. find_package(Tarantool)
  10. include_directories(${TARANTOOL_INCLUDE_DIRS})
  11. # Find Postgrsql
  12. set(PostgreSQL_FIND_REQUIRED ON)
  13. find_package(PostgreSQL)
  14. include_directories(${PostgreSQL_INCLUDE_DIRS})
  15. link_directories(${PostgreSQL_LIBRARY_DIRS})
  16. # SSL
  17. find_package(OpenSSL REQUIRED)
  18. include_directories(${OPENSSL_INCLUDE_DIRS})
  19. link_directories(${OPENSSL_LIBRARIES})
  20. # SSL
  21. find_package(OpenSSL REQUIRED)
  22. include_directories(${OPENSSL_INCLUDE_DIRS})
  23. link_directories(${OPENSSL_LIBRARIES})
  24. # UUID
  25. find_package(UUID REQUIRED)
  26. include_directories(${UUID_INCLUDE_DIRS})
  27. link_directories(${UUID_LIBRARIES})
  28. # Set CFLAGS
  29. set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -DWITH_OPENSSL -luuid")
  30. set(CMAKE_C_FLAGS_DEBUG "${CMAKE_C_FLAGS_DEBUG} -Wall -Wextra")
  31. if(${CMAKE_SYSTEM_NAME} STREQUAL "Darwin")
  32. set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -undefined dynamic_lookup")
  33. set(CMAKE_C_FLAGS_DEBUG "${CMAKE_C_FLAGS_DEBUG} -undefined dynamic_lookup")
  34. endif()
  35. # Build module
  36. add_subdirectory(pg_tarantool)
  37. add_custom_target(check
  38. COMMAND ${PROJECT_SOURCE_DIR}/test/pg.test.lua)