CMakeLists.txt 1.5 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354
  1. cmake_minimum_required(VERSION 2.6.0)
  2. if (APPLE)
  3. set(CMAKE_EXE_LINKER_FLAGS "-fopenmp -L$ENV{HOME}/Code/xpir/freshxpir/xpir-ng/local/lib/ -lboost_program_options")
  4. endif()
  5. include_directories(.)
  6. include_directories(..)
  7. include_directories(../..)
  8. add_executable(pir_server DBDirectoryProcessor.cpp DBGenerator.cpp PIRServer.cpp PIRSession.cpp ServerService.cpp main.cpp)
  9. target_link_libraries(pir_server pir ${Boost_LIBRARIES} ${GMP_LIBRARIES} pthread )
  10. # set (git_cmd "git")
  11. # set (git_arg "--version")
  12. # message(STATUS "git cmd: ${git_cmd}")
  13. # execute_process(COMMAND ${git_cmd} ${git_arg}
  14. # WORKING_DIRECTORY ${PROJECT_SOURCE_DIR}
  15. # RESULT_VARIABLE git_result
  16. # OUTPUT_VARIABLE git_ver)
  17. #
  18. # message(STATUS "git ver[${git_result}]: ${git_ver}")
  19. file(COPY "../tools/check-correctness.sh" DESTINATION ".")
  20. file(COPY "../tools/makedb.sh" DESTINATION ".")
  21. file(COPY "../tools/mkdb-correctness.sh" DESTINATION ".")
  22. add_custom_command(
  23. OUTPUT .db
  24. WORKING_DIR ${PROJECT_BINARY_DIR}/apps/server
  25. COMMAND ./makedb.sh 1024 16 2>/dev/null
  26. COMMAND touch .db
  27. )
  28. add_custom_target(db ALL DEPENDS .db)
  29. add_custom_command(
  30. OUTPUT .db-correct
  31. WORKING_DIR ${PROJECT_BINARY_DIR}/apps/server
  32. COMMAND ./mkdb-correctness.sh
  33. COMMAND touch .db-correct
  34. )
  35. add_custom_target(dbcorrect DEPENDS .db-correct)
  36. add_custom_command(
  37. OUTPUT .check
  38. WORKING_DIR ${PROJECT_BINARY_DIR}/apps/server
  39. COMMAND ./check-correctness.sh
  40. )
  41. add_custom_target(check DEPENDS .check dbcorrect pir_client pir_server)