| Commit | Line | Data |
|---|---|---|
| 60dcabeb L |
1 | cmake_minimum_required(VERSION 3.28 FATAL_ERROR) |
| 2 | ||
| 0dc2435f | 3 | # project: definitions |
| aca0d1d7 | 4 | project(pingcheck) |
| f10c2157 TJ |
5 | set(VERSION 0.8) |
| 6 | set(VERSION_REVISION 0) | |
| 0dc2435f | 7 | set(TARGET ${PROJECT_NAME}) |
| 4ea9706c | 8 | |
| 67016f61 | 9 | # cmake: build options |
| 96d2fb59 | 10 | set(CMAKE_COLOR_MAKEFILE ON) |
| 0dc2435f GMF |
11 | |
| 12 | # compiler: add definitions and arguments to the compiler | |
| 2d591235 | 13 | add_definitions( |
| 451c9121 | 14 | -DVERSION_STRING=${VERSION} |
| c3535345 | 15 | -DPROJECT_NAME=\"${PROJECT_NAME}\" |
| 0a1bd585 | 16 | -DVERSION_REVISION_STRING=${VERSION_REVISION} |
| 2d591235 | 17 | ) |
| 4c2fe1f1 | 18 | |
| 0dc2435f GMF |
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") | |
| 96d2fb59 TJ |
26 | set(CPACK_SOURCE_IGNORE_FILES |
| 27 | "~$" | |
| 28 | "\\\\.git" | |
| ca04b620 | 29 | "\\\\.kdev4" |
| 96d2fb59 TJ |
30 | "build" |
| 31 | "build-rpm" | |
| 32 | ) | |
| 0dc2435f | 33 | set(CPACK_SOURCE_PACKAGE_FILE_NAME "${TARGET}-${VERSION}") |
| 235ffac2 | 34 | |
| 6c0b0595 CH |
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 | ||
| 67016f61 | 42 | # cmake: build the application in the source directory |
| 0dc2435f GMF |
43 | add_subdirectory(src) |
| 44 | ||
| 67016f61 GMF |
45 | # cmake: build the test cases |
| 46 | add_subdirectory(test) | |
| 47 | ||
| 0dc2435f | 48 | include(CPack) |