From 9fd0b0f35e8f6e3ad46a5e5f3b0e485dbbef53d6 Mon Sep 17 00:00:00 2001 From: Hongze Zhang Date: Mon, 27 Jan 2025 23:13:57 -0800 Subject: [PATCH] build(cmake): Make monolithic libs be built inside Velox's own binary directory when being used as a subproject (#12144) Summary: Similar to https://github.com/facebookincubator/velox/pull/12128, currently when Velox is imported as a subproject of another project, the monolithic libs `libvelox.a` / `libvelox.so` will be generated in root project's binary directory which is sub-optimal. The patch fixes the issue so the libs will be generated inside Velox's binary directory. Pull Request resolved: https://github.com/facebookincubator/velox/pull/12144 Reviewed By: kgpai Differential Revision: D68606631 Pulled By: xiaoxmeng fbshipit-source-id: d0ef042c5ee935a598637b07549c9c48a06708fe --- CMake/VeloxUtils.cmake | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/CMake/VeloxUtils.cmake b/CMake/VeloxUtils.cmake index aceb9b19175c..cd9139172186 100644 --- a/CMake/VeloxUtils.cmake +++ b/CMake/VeloxUtils.cmake @@ -77,9 +77,9 @@ function(velox_add_library TARGET) # Create the target if this is the first invocation. add_library(velox ${_type} ${ARGN}) set_target_properties(velox PROPERTIES LIBRARY_OUTPUT_DIRECTORY - ${CMAKE_BINARY_DIR}/lib) + ${PROJECT_BINARY_DIR}/lib) set_target_properties(velox PROPERTIES ARCHIVE_OUTPUT_DIRECTORY - ${CMAKE_BINARY_DIR}/lib) + ${PROJECT_BINARY_DIR}/lib) install(TARGETS velox DESTINATION lib/velox) endif() # create alias for compatability