11cmake_minimum_required (VERSION 3.28)
22
3+ # Create the integration_tools library
4+ add_library (integration_tools src/integration_tools.cpp)
5+
6+ target_link_libraries (integration_tools
7+ PUBLIC
8+ sparrow-ipc
9+ sparrow::sparrow
10+ sparrow::json_reader
11+ )
12+
13+ target_include_directories (integration_tools
14+ PUBLIC
15+ ${CMAKE_CURRENT_SOURCE_DIR} /include
16+ PRIVATE
17+ ${CMAKE_SOURCE_DIR} /include
18+ ${CMAKE_BINARY_DIR} /generated
19+ )
20+
21+ set_target_properties (integration_tools
22+ PROPERTIES
23+ CXX_STANDARD 20
24+ CXX_STANDARD_REQUIRED ON
25+ CXX_EXTENSIONS OFF
26+ FOLDER "integration_tests"
27+ )
28+
29+ add_dependencies (integration_tools generate_flatbuffers_headers)
30+
331# Create executable for arrow_file_to_stream integration test
432add_executable (arrow_file_to_stream arrow_file_to_stream.cpp)
533
634target_link_libraries (arrow_file_to_stream
735 PRIVATE
8- sparrow-ipc
9- sparrow::sparrow
10- sparrow::json_reader
36+ integration_tools
37+ )
38+
39+ target_include_directories (arrow_file_to_stream
40+ PRIVATE
41+ ${CMAKE_CURRENT_SOURCE_DIR} /include
1142)
1243
1344set_target_properties (arrow_file_to_stream
@@ -23,21 +54,19 @@ set_target_properties(arrow_file_to_stream
2354 INSTALL_RPATH "$ORIGIN"
2455)
2556
26- target_include_directories (arrow_file_to_stream
27- PRIVATE
28- ${CMAKE_SOURCE_DIR} /include
29- ${CMAKE_BINARY_DIR} /generated
30- )
31-
3257add_dependencies (arrow_file_to_stream generate_flatbuffers_headers)
3358
3459# Create executable for arrow_stream_to_file integration test
3560add_executable (arrow_stream_to_file arrow_stream_to_file.cpp)
3661
3762target_link_libraries (arrow_stream_to_file
3863 PRIVATE
39- sparrow-ipc
40- sparrow::sparrow
64+ integration_tools
65+ )
66+
67+ target_include_directories (arrow_stream_to_file
68+ PRIVATE
69+ ${CMAKE_CURRENT_SOURCE_DIR} /include
4170)
4271
4372set_target_properties (arrow_stream_to_file
@@ -53,22 +82,19 @@ set_target_properties(arrow_stream_to_file
5382 INSTALL_RPATH "$ORIGIN"
5483)
5584
56- target_include_directories (arrow_stream_to_file
57- PRIVATE
58- ${CMAKE_SOURCE_DIR} /include
59- ${CMAKE_BINARY_DIR} /generated
60- )
61-
6285add_dependencies (arrow_stream_to_file generate_flatbuffers_headers)
6386
6487# Create executable for arrow_json_to_file integration test
6588add_executable (arrow_json_to_file arrow_json_to_file.cpp)
6689
6790target_link_libraries (arrow_json_to_file
6891 PRIVATE
69- sparrow-ipc
70- sparrow::sparrow
71- sparrow::json_reader
92+ integration_tools
93+ )
94+
95+ target_include_directories (arrow_json_to_file
96+ PRIVATE
97+ ${CMAKE_CURRENT_SOURCE_DIR} /include
7298)
7399
74100set_target_properties (arrow_json_to_file
@@ -84,22 +110,19 @@ set_target_properties(arrow_json_to_file
84110 INSTALL_RPATH "$ORIGIN"
85111)
86112
87- target_include_directories (arrow_json_to_file
88- PRIVATE
89- ${CMAKE_SOURCE_DIR} /include
90- ${CMAKE_BINARY_DIR} /generated
91- )
92-
93113add_dependencies (arrow_json_to_file generate_flatbuffers_headers)
94114
95115# Create executable for arrow_validate integration test
96116add_executable (arrow_validate arrow_validate.cpp)
97117
98118target_link_libraries (arrow_validate
99119 PRIVATE
100- sparrow-ipc
101- sparrow::sparrow
102- sparrow::json_reader
120+ integration_tools
121+ )
122+
123+ target_include_directories (arrow_validate
124+ PRIVATE
125+ ${CMAKE_CURRENT_SOURCE_DIR} /include
103126)
104127
105128set_target_properties (arrow_validate
@@ -115,46 +138,25 @@ set_target_properties(arrow_validate
115138 INSTALL_RPATH "$ORIGIN"
116139)
117140
118- target_include_directories (arrow_validate
119- PRIVATE
120- ${CMAKE_SOURCE_DIR} /include
121- ${CMAKE_BINARY_DIR} /generated
122- )
123-
124141add_dependencies (arrow_validate generate_flatbuffers_headers)
125142
126143# Create test executable for integration tools
127144add_executable (test_integration_tools main.cpp test_integration_tools.cpp)
128145
129146target_link_libraries (test_integration_tools
130147 PRIVATE
131- sparrow-ipc
132- sparrow::sparrow
133- sparrow::json_reader
134- doctest::doctest
135- arrow-testing-data
136- )
137-
138- target_compile_definitions (test_integration_tools
139- PRIVATE
140- INTEGRATION_TOOLS_DIR="${CMAKE_CURRENT_BINARY_DIR} "
141- )
142-
143- set_target_properties (test_integration_tools
144- PROPERTIES
145- CXX_STANDARD 20
146- CXX_STANDARD_REQUIRED ON
147- CXX_EXTENSIONS OFF
148+ integration_tools
149+ doctest::doctest
150+ arrow-testing-data
148151)
149152
150153target_include_directories (test_integration_tools
151154 PRIVATE
152- ${CMAKE_SOURCE_DIR} /include
153- ${CMAKE_BINARY_DIR} /generated
155+ ${CMAKE_CURRENT_SOURCE_DIR} /include
156+ ${CMAKE_SOURCE_DIR} /include
157+ ${CMAKE_BINARY_DIR} /generated
154158)
155159
156- add_dependencies (test_integration_tools generate_flatbuffers_headers arrow_file_to_stream arrow_stream_to_file arrow_json_to_file arrow_validate)
157-
158160# Register with CTest
159161enable_testing ()
160162add_test (NAME integration_tools_test COMMAND test_integration_tools)
0 commit comments