From 6762a6dd8bc3f821591cc60ed73b2496f560c050 Mon Sep 17 00:00:00 2001 From: Tom Rix Date: Tue, 16 Jan 2024 10:09:45 -0500 Subject: [PATCH] Fix build with BUILD_STANDALONE=OFF When the rdc is built with this configure option -DBUILD_STANDALONE=OFF This error is caused CMake Error at rdc_libs/CMakeLists.txt:106 (export): export given target "rdc_client" which is not built by this project. Resolve this by using conditional Change-Id: I3f6bb2946c609c7db9fc38015b7d9c8ae766f3a0 Signed-off-by: Tom Rix Signed-off-by: Galantsev, Dmitrii --- rdc_libs/CMakeLists.txt | 23 +++++++++++------------ 1 file changed, 11 insertions(+), 12 deletions(-) diff --git a/rdc_libs/CMakeLists.txt b/rdc_libs/CMakeLists.txt index 6580355bdc..210d8649c3 100755 --- a/rdc_libs/CMakeLists.txt +++ b/rdc_libs/CMakeLists.txt @@ -100,27 +100,26 @@ add_subdirectory(rdc_modules/rdc_rocp) # add librdc_rvs.so to RDC_LIB_MODULES add_subdirectory(rdc_modules/rdc_rvs) -if(BUILD_STANDALONE) - # add librdc_client.so - add_subdirectory(rdc_client) -endif() - # Create cmake target # Add all targets to the build-tree export set -export(TARGETS ${BOOTSTRAP_LIB} ${RDC_LIB} ${RDCCLIENT_LIB} +export(TARGETS ${BOOTSTRAP_LIB} ${RDC_LIB} FILE "${PROJECT_BINARY_DIR}/rdc_libs.cmake") ## Add the install directives for the runtime library. +install(TARGETS ${BOOTSTRAP_LIB} ${RDC_LIB} + EXPORT rdcTargets + LIBRARY DESTINATION ${CMAKE_INSTALL_LIBDIR} + COMPONENT ${CLIENT_COMPONENT}) + if(BUILD_STANDALONE) - install(TARGETS ${BOOTSTRAP_LIB} ${RDC_LIB} ${RDCCLIENT_LIB} - EXPORT rdcTargets - LIBRARY DESTINATION ${CMAKE_INSTALL_LIBDIR} - COMPONENT ${CLIENT_COMPONENT}) -else() - install(TARGETS ${BOOTSTRAP_LIB} ${RDC_LIB} + # add librdc_client.so + add_subdirectory(rdc_client) + install(TARGETS ${RDCCLIENT_LIB} EXPORT rdcTargets LIBRARY DESTINATION ${CMAKE_INSTALL_LIBDIR} COMPONENT ${CLIENT_COMPONENT}) + export(TARGETS ${RDCCLIENT_LIB} + APPEND FILE "${PROJECT_BINARY_DIR}/rdc_libs.cmake") endif() # Add module directives if those exist