diff options
Diffstat (limited to 'CMakeLists.txt')
-rw-r--r-- | CMakeLists.txt | 46 |
1 files changed, 46 insertions, 0 deletions
diff --git a/CMakeLists.txt b/CMakeLists.txt new file mode 100644 index 0000000..04a2be4 --- /dev/null +++ b/CMakeLists.txt @@ -0,0 +1,46 @@ +################################################################################ +# 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) |