################################################################################ # General ################################################################################ # set project's name PROJECT( nbd-broker ) # cmake min version CMAKE_MINIMUM_REQUIRED( VERSION 2.8.0 ) # set compiler optimizations for debug and release SET(CMAKE_BUILD_TYPE Debug) SET(CMAKE_CXX_FLAGS_DEBUG "-O0 -g -Wall") SET(CMAKE_CXX_FLAGS_RELEASE "-O2 -march=native") # local cmake modules SET(CMAKE_MODULE_PATH "${CMAKE_SOURCE_DIR}/cmake") # this command finds libraries and sets all required variables FIND_PACKAGE(Gearman REQUIRED) # some includes INCLUDE_DIRECTORIES( ${CMAKE_SOURCE_DIR} ${CMAKE_BINARY_DIR} ) ################################################################################ # Variables ################################################################################ FILE( GLOB_RECURSE NBDBROKERWORKER_SRCS "src/worker/*.cpp" ) FILE( GLOB_RECURSE NBDBROKERCLIENT_SRCS "src/client/*.cpp" ) ################################################################################ # Build ################################################################################ # build ADD_EXECUTABLE( nbd-broker-worker ${NBDBROKERWORKER_SRCS} ) ADD_EXECUTABLE( nbd-broker-client ${NBDBROKERCLIENT_SRCS} ) # link TARGET_LINK_LIBRARIES( nbd-broker-worker ${GEARMAN_LIBRARIES} ) TARGET_LINK_LIBRARIES( nbd-broker-client ${GEARMAN_LIBRARIES} ) # install INSTALL(TARGETS nbd-broker-worker nbd-broker-client RUNTIME DESTINATION bin)