-
Notifications
You must be signed in to change notification settings - Fork 20
/
Copy pathCMakeLists.txt.deprecated
103 lines (77 loc) · 2.89 KB
/
CMakeLists.txt.deprecated
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
# If this works, it's by accident
cmake_minimum_required(VERSION 2.4.6)
include(CheckIncludeFile)
include(CheckLibraryExists)
if(COMMAND cmake_policy)
# Quash warnings about mixing library search paths
cmake_policy(SET CMP0003 NEW)
# Quash warning about pre-processor symbol escaping (which it doesn't
# seem to actually do)
cmake_policy(SET CMP0005 OLD)
endif(COMMAND cmake_policy)
###################
## CONFIGURATION ##
###################
# Not every platform has (or needs) librt
check_library_exists(rt clock_gettime "" HAVE_LIBRT)
if(HAVE_LIBRT)
set(LIBRT "rt")
endif()
set(CMAKE_BUILD_TYPE Debug)
set(VERSION 1.2.1)
add_definitions(-DPACKAGE_VERSION=\\"${VERSION}\\" -D_XOPEN_SOURCE=600)
#add_definitions(-Wc++-compat -Wall -Wextra -Wconversion -Wpointer-arith -Wfloat-equal -Wshadow -Wwrite-strings -I.)
if(APPLE)
add_definitions(-DHAVE_STRLEN)
endif()
include_directories(include)
#############
## HEADERS ##
#############
install (FILES include/ach.h include/Ach.hpp DESTINATION include)
#############
## TARGETS ##
#############
## libach ##
add_library(ach SHARED src/ach.c src/pipe.c src/dns.c)
target_link_libraries(ach pthread ${LIBRT})
install( TARGETS ach DESTINATION lib )
# This needs to manually kept in sync with the libtool versions
# Libtool-generated versions are authoratative
# Does not correspond to the package version
SET_TARGET_PROPERTIES( ach PROPERTIES
SOVERSION 1 # Major version
VERSION 1.2.1 ) # Major.minor.patch
add_library(achcpp SHARED cpp/achcpp.cpp)
target_link_libraries(achcpp pthread)
install( TARGETS achcpp DESTINATION lib )
SET_TARGET_PROPERTIES( achcpp PROPERTIES
SOVERSION 0 # Major version
VERSION 0.0.0 ) # Major.minor.patch
## achtool ##
add_executable(achtool src/achtool.c src/achutil.c)
target_link_libraries(achtool ach pthread ${LIBRT})
SET_TARGET_PROPERTIES(achtool PROPERTIES OUTPUT_NAME ach)
install( TARGETS achtool DESTINATION bin )
## achcop ##
add_executable(achcop src/achcop.c src/achutil.c)
target_link_libraries(achcop ach pthread ${LIBRT} m)
install( TARGETS achcop DESTINATION bin )
## achd ##
add_executable(achd src/achd/achd.c src/achd/client.c src/achd/io.c src/achd/transport.c src/achutil.c)
target_link_libraries(achd ach pthread ${LIBRT} m)
install( TARGETS achd DESTINATION bin )
## achtest ##
add_executable(achtest src/test/achtest.c)
target_link_libraries(achtest ach pthread ${LIBRT} m)
## achcat ##
add_executable(achcat src/achcat.c src/achutil.c)
target_link_libraries(achcat ach pthread ${LIBRT})
install( TARGETS achcat DESTINATION bin )
## achbench ##
add_executable(achbench src/ach-bench.c src/achutil.c)
target_link_libraries(achbench ach pthread ${LIBRT} m)
install( TARGETS achbench DESTINATION bin )
## ach-example ##
add_executable(ach-example src/ach-example.c)
target_link_libraries(ach-example ach pthread ${LIBRT} m)