| 1 | # project: definitions |
| 2 | project(pingcheck) |
| 3 | set(VERSION 0.8) |
| 4 | set(VERSION_REVISION 0) |
| 5 | set(TARGET ${PROJECT_NAME}) |
| 6 | |
| 7 | # cmake: build options |
| 8 | set(CMAKE_COLOR_MAKEFILE ON) |
| 9 | cmake_minimum_required(VERSION 2.6 FATAL_ERROR) |
| 10 | |
| 11 | # compiler: add definitions and arguments to the compiler |
| 12 | add_definitions( |
| 13 | -DVERSION_STRING=${VERSION} |
| 14 | -DPROJECT_NAME=\"${PROJECT_NAME}\" |
| 15 | -DVERSION_REVISION_STRING=${VERSION_REVISION} |
| 16 | ) |
| 17 | |
| 18 | # package: package information |
| 19 | set(CPACK_PACKAGE_VERSION ${VERSION}) |
| 20 | set(CPACK_PACKAGE_CONTACT "Intra2net AG") |
| 21 | set(CPACK_PACKAGE_DESCRIPTION ${TARGET}) |
| 22 | set(CPACK_PACKAGE_DESCRIPTION_SUMMARY "Pingcheck") |
| 23 | set(CPACK_SOURCE_GENERATOR TGZ) |
| 24 | set(CPACK_SOURCE_IGNORE_FILES "\\\\.git;build;build-rpm") |
| 25 | set(CPACK_SOURCE_IGNORE_FILES |
| 26 | "~$" |
| 27 | "\\\\.git" |
| 28 | "\\\\.kdev4" |
| 29 | "build" |
| 30 | "build-rpm" |
| 31 | ) |
| 32 | set(CPACK_SOURCE_PACKAGE_FILE_NAME "${TARGET}-${VERSION}") |
| 33 | |
| 34 | # "make dist" target |
| 35 | set(ARCHIVE_NAME ${CMAKE_PROJECT_NAME}-${VERSION}) |
| 36 | add_custom_target(dist |
| 37 | COMMAND git archive --prefix=${ARCHIVE_NAME}/ HEAD |
| 38 | | bzip2 > ${CMAKE_BINARY_DIR}/${ARCHIVE_NAME}.tar.bz2 |
| 39 | WORKING_DIRECTORY ${CMAKE_SOURCE_DIR}) |
| 40 | |
| 41 | # cmake: build the application in the source directory |
| 42 | add_subdirectory(src) |
| 43 | |
| 44 | # cmake: build the test cases |
| 45 | add_subdirectory(test) |
| 46 | |
| 47 | include(CPack) |