Reorganization of cmake files
[pingcheck] / CMakeLists.txt
1 # IMPORTANT: Do not add whitespaces between cmake commands! This will break
2 # the package build!
3 # Do set(CONTENTS) instead of set( CONTENTS ) or set (CONTENTS)
4
5 # cmake: required version
6 cmake_minimum_required (VERSION 2.6)
7
8 # cmake: set the directory where the executable will be placed
9 set(CMAKE_RUNTIME_OUTPUT_DIRECTORY ${CMAKE_CURRENT_BINARY_DIR})
10
11 # cmake: set the directory where the make install places the executable
12 set(CMAKE_INSTALL_PREFIX ${CMAKE_CURRENT_BINARY_DIR})
13
14 # project: definitions
15 project(libpingcheck)
16 set(VERSION 0.1)
17 set(TARGET ${PROJECT_NAME})
18
19 # compiler: disable the full compiler output
20 set(CMAKE_VERBOSE_MAKEFILE OFF)
21
22 # compiler: build type
23 set(CMAKE_BUILD_TYPE Debug)
24
25 # compiler: add definitions and arguments to the compiler
26 add_definitions(
27     -Werror -Wall -Wextra -Weffc++ -O2 -DVERSION_STRING=${VERSION}
28     -DPROJECT_NAME=\"${PROJECT_NAME}\"
29 )
30
31 # package: package information
32 set(CPACK_PACKAGE_VERSION ${VERSION})
33 set(CPACK_PACKAGE_CONTACT "Intra2net AG")
34 set(CPACK_PACKAGE_DESCRIPTION ${TARGET})
35 set(CPACK_PACKAGE_DESCRIPTION_SUMMARY "Pingcheck")
36 set(CPACK_SOURCE_GENERATOR TGZ)
37 set(CPACK_SOURCE_IGNORE_FILES "\\\\.git;build;build-rpm")
38 set(CPACK_SOURCE_PACKAGE_FILE_NAME "${TARGET}-${VERSION}")
39
40 # build the application in the source directory
41 add_subdirectory(src)
42
43 # package: ???
44 include(CPack)