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