1cmake_minimum_required(VERSION 2.8)
2
3if("${CMAKE_VERSION}" VERSION_GREATER 3.0.0)
4    cmake_policy(SET CMP0042 NEW)
5endif()
6
7project("hdr_histogram")
8
9# Follow all steps below in order to calculate new ABI version when updating the library
10# NOTE: THIS IS UNRELATED to the actual project version
11#
12# 1. If the library source code has changed at all since the last update, then increment revision
13# 2. If any interfaces have been added, removed, or changed since the last update, increment current and set revision to 0.
14# 3. If any interfaces have been added since the last public release, then increment age.
15# 4. If any interfaces have been removed since the last public release, then set age to 0.
16
17set(HDR_SOVERSION_CURRENT   1)
18set(HDR_SOVERSION_AGE       0)
19set(HDR_SOVERSION_REVISION  1)
20
21set(HDR_VERSION ${HDR_SOVERSION_CURRENT}.${HDR_SOVERSION_AGE}.${HDR_SOVERSION_REVISION})
22set(HDR_SOVERSION ${HDR_SOVERSION_CURRENT})
23
24ENABLE_TESTING()
25
26if(UNIX)
27    set(CMAKE_C_FLAGS "-Wall -Wno-unknown-pragmas -Wextra -Wshadow -Winit-self -Wmissing-prototypes -D_GNU_SOURCE")
28    set(CMAKE_C_FLAGS_DEBUG "-O0 -g")
29    set(CMAKE_C_FLAGS_RELEASE "-O3 -g")
30endif()
31
32if(WIN32)
33    find_package (zlib REQUIRED)
34    include_directories(${ZLIB_INCLUDE_DIRS})
35endif()
36
37include_directories("${CMAKE_CURRENT_SOURCE_DIR}/src")
38
39add_subdirectory("${CMAKE_CURRENT_SOURCE_DIR}/src")
40add_subdirectory("${CMAKE_CURRENT_SOURCE_DIR}/test")
41add_subdirectory("${CMAKE_CURRENT_SOURCE_DIR}/examples")
42
43SET(CPACK_GENERATOR "TGZ")
44SET(CPACK_PACKAGE_VERSION "0.9.6")
45
46INCLUDE(CPack)
47