Skip to content

Commit

Permalink
cleanup: Move install targets to CMake files under export.
Browse files Browse the repository at this point in the history
Since the install logic needs to install everything that is part of the
public interface of the project, it is arguable best put in the CMake
files of the `export` folder, which also contains the public code. This
also removes the necessity to include the subdirectories under `src` in
a particular order, which would otherwise exist due to the `install`
command needing to see all installed targets.
  • Loading branch information
ingomueller-net committed Mar 15, 2024
1 parent e0848a9 commit ac7fc6b
Show file tree
Hide file tree
Showing 3 changed files with 16 additions and 21 deletions.
17 changes: 15 additions & 2 deletions export/planloader/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -7,8 +7,21 @@ target_link_libraries(planloader substrait_io)

install(
TARGETS planloader
LIBRARY DESTINATION ${CMAKE_INSTALL_LIBDIR}
PRIVATE_HEADER DESTINATION ${CMAKE_INSTALL_INCDIR})
substrait_io
substrait_common
substrait_proto
substrait_textplan_converter
substrait_textplan_loader
substrait_base_proto_visitor
symbol_table
error_listener
substrait_type
substrait_expression
textplan_grammar
EXPORT SubstraitTargets)
install(FILES ../../include/substrait/common/Io.h
DESTINATION "${CMAKE_INSTALL_INCLUDEDIR}/substrait/common")
install(EXPORT SubstraitTargets DESTINATION lib/cmake/Substrait)

if(${SUBSTRAIT_CPP_BUILD_TESTING})
add_subdirectory(tests)
Expand Down
2 changes: 1 addition & 1 deletion src/substrait/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -18,9 +18,9 @@ set(CMAKE_RUNTIME_OUTPUT_DIRECTORY
set(ADDITIONAL_CLEAN_FILES
"${CMAKE_ARCHIVE_OUTPUT_DIRECTORY};${CMAKE_RUNTIME_OUTPUT_DIRECTORY}")

add_subdirectory(common)
add_subdirectory(type)
add_subdirectory(expression)
add_subdirectory(function)
add_subdirectory(proto)
add_subdirectory(textplan)
add_subdirectory(common)
18 changes: 0 additions & 18 deletions src/substrait/common/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -24,24 +24,6 @@ if(${SUBSTRAIT_CPP_BUILD_TESTING})
add_subdirectory(tests)
endif()

install(
TARGETS substrait_io
substrait_common
substrait_proto
substrait_textplan_converter
substrait_textplan_loader
substrait_base_proto_visitor
symbol_table
error_listener
substrait_type
substrait_expression
textplan_grammar
DESTINATION ${CMAKE_INSTALL_LIBDIR}
EXPORT SubstraitTargets)
install(FILES ../../../include/substrait/common/Io.h
DESTINATION "${CMAKE_INSTALL_INCLUDEDIR}/substrait/common")
install(EXPORT SubstraitTargets DESTINATION lib/cmake/Substrait)

add_executable(plantransformer PlanTransformerTool.cpp)

target_link_libraries(plantransformer substrait_io)

0 comments on commit ac7fc6b

Please sign in to comment.