From 8dfd48a9c2ca86316e9081657e67e7857bbfdfab Mon Sep 17 00:00:00 2001 From: Glenn Date: Mon, 6 May 2024 08:02:26 -0400 Subject: [PATCH 1/2] Update CMakeLists.txt --- CMakeLists.txt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index d77bd830ae..38af3eed16 100755 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -15,7 +15,7 @@ project( OSGEARTH DESCRIPTION "osgEarth 3D Geospatial SDK" HOMEPAGE_URL "https://github.com/gwaldron/osgearth" - LANGUAGES CXX) + LANGUAGES CXX C) # SDK version number set(OSGEARTH_MAJOR_VERSION 3) From f1ed4571ffbdf7fbba7c9e09adcb8ad983b8df5c Mon Sep 17 00:00:00 2001 From: Glenn Date: Mon, 6 May 2024 08:33:22 -0400 Subject: [PATCH 2/2] Update osgearth-macros.cmake --- cmake/osgearth-macros.cmake | 24 +++++++++++++++++++----- 1 file changed, 19 insertions(+), 5 deletions(-) diff --git a/cmake/osgearth-macros.cmake b/cmake/osgearth-macros.cmake index 9d8665426c..26f784f738 100644 --- a/cmake/osgearth-macros.cmake +++ b/cmake/osgearth-macros.cmake @@ -128,6 +128,11 @@ macro(add_osgearth_library_as_plugin) if(OSGEARTH_INSTALL_SHADERS) install(FILES ${MY_SHADERS} DESTINATION resources/shaders) endif() + + # macos-specific + if(OSG_BUILD_PLATFORM_IPHONE) + set_target_properties(${TARGET_TARGETNAME} PROPERTIES XCODE_ATTRIBUTE_ENABLE_BITCODE ${IPHONE_ENABLE_BITCODE}) + endif() # install the dynamic libraries. install(TARGETS ${MY_TARGET} @@ -187,14 +192,19 @@ macro(add_osgearth_app) target_link_libraries(${MY_TARGET} PRIVATE osgEarth ${OPENSCENEGRAPH_LIBRARIES} ${MY_LIBRARIES}) set_target_properties(${MY_TARGET} PROPERTIES PROJECT_LABEL "${MY_TARGET}") + + # macos-specific + if(OSG_BUILD_PLATFORM_IPHONE) + set_target_properties(${TARGET_TARGETNAME} PROPERTIES XCODE_ATTRIBUTE_ENABLE_BITCODE ${IPHONE_ENABLE_BITCODE}) + endif() install(TARGETS ${MY_TARGET} RUNTIME DESTINATION bin) - if(NOT MY_FOLDER) - set(MY_FOLDER "Ungrouped") - endif() + if(NOT MY_FOLDER) + set(MY_FOLDER "Ungrouped") + endif() - SET_PROPERTY(TARGET ${MY_TARGET} PROPERTY FOLDER "${MY_FOLDER}") + set_property(TARGET ${MY_TARGET} PROPERTY FOLDER "${MY_FOLDER}") endmacro(add_osgearth_app) @@ -363,7 +373,11 @@ macro(add_osgearth_library) FILES ${MY_PUBLIC_HEADERS} DESTINATION ${INSTALL_INCDIR}) else() - # MAC OSX stuff. + # macos-specific + if(OSG_BUILD_PLATFORM_IPHONE) + set_target_properties(${TARGET_TARGETNAME} PROPERTIES XCODE_ATTRIBUTE_ENABLE_BITCODE ${IPHONE_ENABLE_BITCODE}) + endif() + set(CMAKE_BUILD_WITH_INSTALL_RPATH TRUE) set(CMAKE_INSTALL_RPATH "${OSGEARTH_BUILD_FRAMEWORKS_INSTALL_NAME_DIR}")