From ca5ca2858cf8371eff86a32f51b7445db3d18e52 Mon Sep 17 00:00:00 2001 From: Jon Evans Date: Thu, 4 Apr 2024 17:55:32 -0400 Subject: [PATCH] Fix installation packaging of kiapi on macOS --- api/CMakeLists.txt | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/api/CMakeLists.txt b/api/CMakeLists.txt index ab69cf66cd..cb0141e23e 100644 --- a/api/CMakeLists.txt +++ b/api/CMakeLists.txt @@ -120,3 +120,14 @@ target_include_directories( kiapi INTERFACE # Because when building internally, the generated files do not include the "api" base path target_include_directories( kiapi PUBLIC ${KIAPI_CPP_BASEPATH} ) + +if( APPLE ) + # puts library into the main kicad.app bundle in build tree + set_target_properties( kiapi PROPERTIES + LIBRARY_OUTPUT_DIRECTORY "${OSX_BUNDLE_BUILD_LIB_DIR}" + INSTALL_NAME_DIR "${OSX_BUNDLE_BUILD_LIB_DIR}" + ) + set_target_properties( kiapi PROPERTIES INSTALL_RPATH + "@executable_path/../Frameworks" ) + set_target_properties( kiapi PROPERTIES BUILD_WITH_INSTALL_RPATH 1 ) +endif()