From 6e590c31d0ceaf3edc717d4e79aacc9afed46f5c Mon Sep 17 00:00:00 2001 From: Mark Lobodzinski Date: Wed, 11 Apr 2018 13:38:11 -0600 Subject: cube: Move cube directory up to top level dir Change-Id: Ie1116b0b6de742b4f85834a4c9d1927dd641e19b --- cube/macOS/common.cmake | 39 +++++++++++++++++++++++++++++++++++++++ 1 file changed, 39 insertions(+) create mode 100644 cube/macOS/common.cmake (limited to 'cube/macOS/common.cmake') diff --git a/cube/macOS/common.cmake b/cube/macOS/common.cmake new file mode 100644 index 00000000..6a35db95 --- /dev/null +++ b/cube/macOS/common.cmake @@ -0,0 +1,39 @@ +# Set up common settings for building all demos on Apple platforms. + +# Source for the MoltenVK ICD library and JSON file +set(MOLTENVK_DIR "${PROJECT_SOURCE_DIR}/external/MoltenVK") + +# MoltenVK JSON File + +# Modify the ICD JSON file to adjust the library path. +# The ICD JSON file goes in the Resources/vulkan/icd.d directory, so adjust the +# library_path to the relative path to the Frameworks directory in the bundle.. +# The regex does: substitute ':"' with: +# ': "../../../Frameworks/' +add_custom_target(MoltenVK_icd-staging-json ALL + COMMAND mkdir -p ${CMAKE_CURRENT_BINARY_DIR}/staging-json + COMMAND sed -e "/\"library_path\":/s$:[[:space:]]*\"[[:space:]]*[\\.\\/]*$: \"..\\/..\\/..\\/Frameworks\\/$" + ${MOLTENVK_DIR}/MoltenVK/icd/MoltenVK_icd.json > + ${CMAKE_CURRENT_BINARY_DIR}/staging-json/MoltenVK_icd.json + VERBATIM + DEPENDS "${MOLTENVK_DIR}/MoltenVK/icd/MoltenVK_icd.json" +) +set_source_files_properties(${CMAKE_CURRENT_BINARY_DIR}/staging-json/MoltenVK_icd.json PROPERTIES + GENERATED TRUE +) + +find_library(COCOA NAMES Cocoa) + +# Locate Interface Builder Tool, needed to build things like Storyboards outside of Xcode. +if (NOT ${CMAKE_GENERATOR} MATCHES "^Xcode.*") + # Make sure we can find the 'ibtool' program. If we can NOT find it we + # skip generation of this project + find_program(IBTOOL ibtool HINTS "/usr/bin" "${OSX_DEVELOPER_ROOT}/usr/bin") + if (${IBTOOL} STREQUAL "IBTOOL-NOTFOUND") + message(SEND_ERROR + "ibtool can not be found and is needed to compile the .xib files. " + "It should have been installed with the Apple developer tools. " + "The default system paths were searched in addition to ${OSX_DEVELOPER_ROOT}/usr/bin." + ) + endif() +endif() -- cgit v1.2.3