cmake_minimum_required(VERSION 2.6.0) if (APPLE) set(CMAKE_EXE_LINKER_FLAGS "-fopenmp -L$ENV{HOME}/Code/xpir/freshxpir/xpir-ng/local/lib/ -lboost_program_options") endif() include_directories(.) include_directories(..) include_directories(../..) add_executable(pir_server DBDirectoryProcessor.cpp DBGenerator.cpp PIRServer.cpp PIRSession.cpp ServerService.cpp main.cpp) target_link_libraries(pir_server pir ${Boost_LIBRARIES} ${GMP_LIBRARIES} pthread ) # set (git_cmd "git") # set (git_arg "--version") # message(STATUS "git cmd: ${git_cmd}") # execute_process(COMMAND ${git_cmd} ${git_arg} # WORKING_DIRECTORY ${PROJECT_SOURCE_DIR} # RESULT_VARIABLE git_result # OUTPUT_VARIABLE git_ver) # # message(STATUS "git ver[${git_result}]: ${git_ver}") file(COPY "../tools/check-correctness.sh" DESTINATION ".") file(COPY "../tools/makedb.sh" DESTINATION ".") file(COPY "../tools/mkdb-correctness.sh" DESTINATION ".") add_custom_command( OUTPUT .db WORKING_DIR ${PROJECT_BINARY_DIR}/apps/server COMMAND ./makedb.sh 1024 16 2>/dev/null COMMAND touch .db ) add_custom_target(db ALL DEPENDS .db) add_custom_command( OUTPUT .db-correct WORKING_DIR ${PROJECT_BINARY_DIR}/apps/server COMMAND ./mkdb-correctness.sh COMMAND touch .db-correct ) add_custom_target(dbcorrect DEPENDS .db-correct) add_custom_command( OUTPUT .check WORKING_DIR ${PROJECT_BINARY_DIR}/apps/server COMMAND ./check-correctness.sh ) add_custom_target(check DEPENDS .check dbcorrect pir_client pir_server)