aboutsummaryrefslogtreecommitdiff
path: root/ports/avro-cpp/install.patch
blob: 1035b3bf35c8f119d794520681087bf558b81e2f (plain)
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
104
105
106
diff --git a/lang/c++/CMakeLists.txt b/lang/c++/CMakeLists.txt
index bf764ce4..e84524d0 100644
--- a/lang/c++/CMakeLists.txt
+++ b/lang/c++/CMakeLists.txt
@@ -48,6 +48,8 @@ list(GET AVRO_VERSION 2 AVRO_VERSION_PATCH)
 project (Avro-cpp)
 set(CMAKE_MODULE_PATH ${CMAKE_MODULE_PATH} ${CMAKE_SOURCE_DIR})
 
+find_package(ZLIB REQUIRED)
+
 if (WIN32 AND NOT CYGWIN AND NOT MSYS)
     add_definitions (/EHa)
     add_definitions (
@@ -125,12 +127,12 @@ set_target_properties (avrocpp PROPERTIES
 set_target_properties (avrocpp_s PROPERTIES
     VERSION ${AVRO_VERSION_MAJOR}.${AVRO_VERSION_MINOR}.${AVRO_VERSION_PATCH})
 
-target_link_libraries (avrocpp ${Boost_LIBRARIES} ${SNAPPY_LIBRARIES})
+target_link_libraries (avrocpp ${Boost_LIBRARIES} ${SNAPPY_LIBRARIES} ZLIB::ZLIB)
 target_include_directories(avrocpp PRIVATE ${SNAPPY_INCLUDE_DIR})
 
 add_executable (precompile test/precompile.cc)
 
-target_link_libraries (precompile avrocpp_s ${Boost_LIBRARIES} ${SNAPPY_LIBRARIES})
+target_link_libraries (precompile avrocpp_s ${Boost_LIBRARIES} ${SNAPPY_LIBRARIES} ZLIB::ZLIB)
 
 macro (gen file ns)
     add_custom_command (OUTPUT ${file}.hh
@@ -160,37 +162,42 @@ gen (primitivetypes pt)
 gen (cpp_reserved_words cppres)
 
 add_executable (avrogencpp impl/avrogencpp.cc)
-target_link_libraries (avrogencpp avrocpp_s ${Boost_LIBRARIES} ${SNAPPY_LIBRARIES})
+target_link_libraries (avrogencpp avrocpp_s ${Boost_LIBRARIES} ${SNAPPY_LIBRARIES} ZLIB::ZLIB)
 
-enable_testing()
+if(BUILD_TESTING)
+  enable_testing()
+endif()
 
 macro (unittest name)
     add_executable (${name} test/${name}.cc)
-    target_link_libraries (${name} avrocpp ${Boost_LIBRARIES} ${SNAPPY_LIBRARIES})
+    target_link_libraries (${name} avrocpp ${Boost_LIBRARIES} ${SNAPPY_LIBRARIES} ZLIB::ZLIB)
     add_test (NAME ${name} WORKING_DIRECTORY ${CMAKE_CURRENT_SOURCE_DIR}
         COMMAND ${CMAKE_CURRENT_BINARY_DIR}/${name})
 endmacro (unittest)
 
-unittest (buffertest)
-unittest (unittest)
-unittest (SchemaTests)
-unittest (LargeSchemaTests)
-unittest (CodecTests)
-unittest (StreamTests)
-unittest (SpecificTests)
-unittest (DataFileTests)
-unittest (JsonTests)
-unittest (AvrogencppTests)
-unittest (CompilerTests)
-unittest (AvrogencppTestReservedWords)
-
-add_dependencies (AvrogencppTestReservedWords cpp_reserved_words_hh)
-
-add_dependencies (AvrogencppTests bigrecord_hh bigrecord_r_hh bigrecord2_hh
-    tweet_hh
-    union_array_union_hh union_map_union_hh union_conflict_hh
-    recursive_hh reuse_hh circulardep_hh tree1_hh tree2_hh crossref_hh
-    primitivetypes_hh empty_record_hh)
+if(BUILD_TESTING)
+    unittest (buffertest)
+    unittest (unittest)
+    unittest (SchemaTests) 
+    unittest (LargeSchemaTests)
+    unittest (CodecTests)
+    unittest (StreamTests)
+    unittest (SpecificTests)
+    unittest (DataFileTests)
+    unittest (JsonTests)
+    unittest (AvrogencppTests)
+    unittest (CompilerTests)
+    unittest (AvrogencppTestReservedWords)
+
+    add_dependencies (AvrogencppTestReservedWords cpp_reserved_words_hh)
+
+    add_dependencies (AvrogencppTests bigrecord_hh bigrecord_r_hh bigrecord2_hh
+        tweet_hh
+        union_array_union_hh union_map_union_hh union_conflict_hh
+        recursive_hh reuse_hh circulardep_hh tree1_hh tree2_hh crossref_hh
+        primitivetypes_hh empty_record_hh)
+
+endif()
 
 include (InstallRequiredSystemLibraries)
 
@@ -201,9 +208,9 @@ include (CPack)
 install (TARGETS avrocpp avrocpp_s
     LIBRARY DESTINATION lib
     ARCHIVE DESTINATION lib
-    RUNTIME DESTINATION lib)
+    RUNTIME DESTINATION bin)
 
-install (TARGETS avrogencpp RUNTIME DESTINATION bin)
+install (TARGETS avrogencpp RUNTIME DESTINATION tools/bin)
 
 install (DIRECTORY api/ DESTINATION include/avro
     FILES_MATCHING PATTERN *.hh)