# project: definitions project(pingcheck) set(VERSION 0.6) set(VERSION_REVISION 5) set(TARGET ${PROJECT_NAME}) # cmake: build options if("${CMAKE_BUILD_TYPE}" STREQUAL "") set(CMAKE_BUILD_TYPE Debug) endif("${CMAKE_BUILD_TYPE}" STREQUAL "") set(CMAKE_COLOR_MAKEFILE ON) cmake_minimum_required(VERSION 2.6 FATAL_ERROR) # compiler: add definitions and arguments to the compiler add_definitions( -Wall -Wextra -Weffc++ -Wshadow -Wcast-qual -Wconversion -pedantic -Wabi -Wfloat-equal -Winline -Wmissing-declarations -Wmissing-format-attribute -Wno-long-long -Woverloaded-virtual -Wpacked -Wredundant-decls -Wsign-promo -Wstack-protector -fstack-protector #-Werror #-O2 -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)