# project: definitions project(pingcheck) set(VERSION 0.8) set(VERSION_REVISION 0) set(TARGET ${PROJECT_NAME}) # cmake: build options set(CMAKE_COLOR_MAKEFILE ON) cmake_minimum_required(VERSION 2.6 FATAL_ERROR) # compiler: add definitions and arguments to the compiler add_definitions( -DVERSION_STRING=${VERSION} -DPROJECT_NAME=\"${PROJECT_NAME}\" -DVERSION_REVISION_STRING=${VERSION_REVISION} ) # package: package information set(CPACK_PACKAGE_VERSION ${VERSION}) set(CPACK_PACKAGE_CONTACT "Intra2net AG") set(CPACK_PACKAGE_DESCRIPTION ${TARGET}) set(CPACK_PACKAGE_DESCRIPTION_SUMMARY "Pingcheck") set(CPACK_SOURCE_GENERATOR TGZ) set(CPACK_SOURCE_IGNORE_FILES "\\\\.git;build;build-rpm") set(CPACK_SOURCE_IGNORE_FILES "~$" "\\\\.git" "\\\\.kdev4" "build" "build-rpm" ) set(CPACK_SOURCE_PACKAGE_FILE_NAME "${TARGET}-${VERSION}") # "make dist" target set(ARCHIVE_NAME ${CMAKE_PROJECT_NAME}-${VERSION}) add_custom_target(dist COMMAND git archive --prefix=${ARCHIVE_NAME}/ HEAD | bzip2 > ${CMAKE_BINARY_DIR}/${ARCHIVE_NAME}.tar.bz2 WORKING_DIRECTORY ${CMAKE_SOURCE_DIR}) # cmake: build the application in the source directory add_subdirectory(src) # cmake: build the test cases add_subdirectory(test) include(CPack)