From ef6773fd94031cf006f5f35bce2fd750633e6242 Mon Sep 17 00:00:00 2001 From: Aleksi Sapon Date: Tue, 31 Jan 2023 12:27:02 -0500 Subject: [PATCH] Fix macOS platform check when finding transcoders The check must verify the target platform, instead of the host. This fixes cross-compiling on macOS. Also when targeting iOS, install(TARGET) commands require a BUNDLE destination for executables. This was missing for the samples. --- cmake/XercesTranscoderSelection.cmake | 2 +- samples/CMakeLists.txt | 1 + 2 files changed, 2 insertions(+), 1 deletion(-) diff --git a/cmake/XercesTranscoderSelection.cmake b/cmake/XercesTranscoderSelection.cmake index 5dd7c6257..ca9b29e93 100644 --- a/cmake/XercesTranscoderSelection.cmake +++ b/cmake/XercesTranscoderSelection.cmake @@ -30,7 +30,7 @@ endif() # MacOS set(macosunicodeconverter_available 0) -if(CMAKE_HOST_APPLE) +if(CMAKE_SYSTEM_NAME STREQUAL "Darwin") check_include_file_cxx(CoreServices/CoreServices.h HAVE_CORESERVICES_CORESERVICES_H) find_library(CORE_SERVICES_LIBRARY CoreServices ) if (HAVE_CORESERVICES_CORESERVICES_H AND CORE_SERVICES_LIBRARY) diff --git a/samples/CMakeLists.txt b/samples/CMakeLists.txt index 7426998f2..685af6804 100644 --- a/samples/CMakeLists.txt +++ b/samples/CMakeLists.txt @@ -150,6 +150,7 @@ add_sample_executable(XInclude install( TARGETS ${sample_programs} RUNTIME DESTINATION "${CMAKE_INSTALL_BINDIR}" + BUNDLE DESTINATION "${CMAKE_INSTALL_BINDIR}" COMPONENT "runtime") # Run tests