From 6807aa519f950375f08b18d319eb0dc5fd25e58c Mon Sep 17 00:00:00 2001 From: Juan Ramos Date: Thu, 5 Oct 2023 13:16:05 -0600 Subject: cmake: Use XCODE variable Simplifies CMake code in various places for Apple builds --- cube/macOS/cube/cube.cmake | 6 +++--- cube/macOS/cubepp/cubepp.cmake | 6 +++--- 2 files changed, 6 insertions(+), 6 deletions(-) (limited to 'cube') diff --git a/cube/macOS/cube/cube.cmake b/cube/macOS/cube/cube.cmake index ee98135d..15a56849 100644 --- a/cube/macOS/cube/cube.cmake +++ b/cube/macOS/cube/cube.cmake @@ -28,14 +28,14 @@ set(cube_RESOURCES ${CMAKE_BINARY_DIR}/staging-json/MoltenVK_icd.json ${CMAKE_CURRENT_SOURCE_DIR}/macOS/cube/Resources/VulkanIcon.icns) # Have Xcode handle the Storyboard -if(${CMAKE_GENERATOR} MATCHES "^Xcode.*") +if(XCODE) set(cube_RESOURCES ${cube_RESOURCES} ${CMAKE_CURRENT_SOURCE_DIR}/macOS/cube/Resources/Main.storyboard) endif() add_executable(vkcube MACOSX_BUNDLE ${cube_SRCS} ${cube_HDRS} ${cube_RESOURCES} cube.vert.inc cube.frag.inc) # Handle the Storyboard ourselves -if(NOT ${CMAKE_GENERATOR} MATCHES "^Xcode.*") +if(NOT XCODE) # Compile the storyboard file with the ibtool. add_custom_command(TARGET vkcube POST_BUILD COMMAND ${IBTOOL} @@ -70,7 +70,7 @@ set_source_files_properties("${CMAKE_BINARY_DIR}/staging-json/MoltenVK_icd.json" "Resources/vulkan/icd.d") # Copy the MoltenVK lib into the bundle. -if(${CMAKE_GENERATOR} MATCHES "^Xcode.*") +if(XCODE) add_custom_command(TARGET vkcube POST_BUILD COMMAND ${CMAKE_COMMAND} -E copy "${MOLTENVK_DIR}/MoltenVK/dylib/macOS/libMoltenVK.dylib" ${CMAKE_CURRENT_BINARY_DIR}/$/vkcube.app/Contents/Frameworks/libMoltenVK.dylib diff --git a/cube/macOS/cubepp/cubepp.cmake b/cube/macOS/cubepp/cubepp.cmake index 4ff82b6b..e6a3e485 100644 --- a/cube/macOS/cubepp/cubepp.cmake +++ b/cube/macOS/cubepp/cubepp.cmake @@ -30,14 +30,14 @@ set(cubepp_RESOURCES ${CMAKE_BINARY_DIR}/staging-json/MoltenVK_icd.json ${CMAKE_CURRENT_SOURCE_DIR}/macOS/cubepp/Resources/VulkanIcon.icns) # Have Xcode handle the Storyboard -if(${CMAKE_GENERATOR} MATCHES "^Xcode.*") +if(XCODE) set(cubepp_RESOURCES ${cubepp_RESOURCES} ${CMAKE_CURRENT_SOURCE_DIR}/macOS/cubepp/Resources/Main.storyboard) endif() add_executable(vkcubepp MACOSX_BUNDLE ${cubepp_SRCS} ${cubepp_HDRS} ${cubepp_RESOURCES} cube.vert.inc cube.frag.inc) # Handle the Storyboard ourselves -if(NOT ${CMAKE_GENERATOR} MATCHES "^Xcode.*") +if(NOT XCODE) # Compile the storyboard file with the ibtool. add_custom_command(TARGET vkcubepp POST_BUILD COMMAND ${IBTOOL} @@ -72,7 +72,7 @@ set_source_files_properties("${CMAKE_BINARY_DIR}/staging-json/MoltenVK_icd.json" "Resources/vulkan/icd.d") # Copy the MoltenVK lib into the bundle. -if(${CMAKE_GENERATOR} MATCHES "^Xcode.*") +if(XCODE) add_custom_command(TARGET vkcubepp POST_BUILD COMMAND ${CMAKE_COMMAND} -E copy "${MOLTENVK_DIR}/MoltenVK/dylib/macOS/libMoltenVK.dylib" ${CMAKE_CURRENT_BINARY_DIR}/$/vkcubepp.app/Contents/Frameworks/libMoltenVK.dylib -- cgit v1.2.3