aboutsummaryrefslogtreecommitdiff
path: root/cube/macOS
diff options
context:
space:
mode:
authorJuan Ramos <juan@lunarg.com>2023-11-15 18:30:30 -0700
committerJuan Ramos <114601453+juan-lunarg@users.noreply.github.com>2023-11-15 20:25:56 -0700
commit1ccfee8ee9c3e2b1456578de4ee70a91b2d424c2 (patch)
tree45410a5e3ee782f7c6fc5e0c45f9ecb1906322c8 /cube/macOS
parentd4f91cf4e25012aa868b4d8f009b299aea78b522 (diff)
downloadusermoji-1ccfee8ee9c3e2b1456578de4ee70a91b2d424c2.tar.xz
Remove *.cmake files and move MoltenVK logic into cube directory
Only vkcube/vkcubepp make use of MoltenVK
Diffstat (limited to 'cube/macOS')
-rw-r--r--cube/macOS/cube/CMakeLists.txt (renamed from cube/macOS/cube/cube.cmake)34
-rw-r--r--cube/macOS/cubepp/CMakeLists.txt (renamed from cube/macOS/cubepp/cubepp.cmake)36
2 files changed, 38 insertions, 32 deletions
diff --git a/cube/macOS/cube/cube.cmake b/cube/macOS/cube/CMakeLists.txt
index a3c5624e..3b4c2d30 100644
--- a/cube/macOS/cube/cube.cmake
+++ b/cube/macOS/cube/CMakeLists.txt
@@ -17,22 +17,26 @@
# VkCube Application Bundle
-set(cube_SRCS
- ${CMAKE_CURRENT_SOURCE_DIR}/macOS/cube/main.m
- ${CMAKE_CURRENT_SOURCE_DIR}/macOS/cube/AppDelegate.m
- ${CMAKE_CURRENT_SOURCE_DIR}/macOS/cube/DemoViewController.m)
-
-set(cube_HDRS ${CMAKE_CURRENT_SOURCE_DIR}/macOS/cube/AppDelegate.h ${CMAKE_CURRENT_SOURCE_DIR}/macOS/cube/DemoViewController.h)
-
-set(cube_RESOURCES ${CMAKE_BINARY_DIR}/staging-json/MoltenVK_icd.json
- ${CMAKE_CURRENT_SOURCE_DIR}/macOS/cube/Resources/VulkanIcon.icns)
+set(cube_RESOURCES ${PROJECT_BINARY_DIR}/staging-json/MoltenVK_icd.json
+ ${CMAKE_CURRENT_LIST_DIR}/Resources/VulkanIcon.icns)
# Have Xcode handle the Storyboard
if(XCODE)
- set(cube_RESOURCES ${cube_RESOURCES} ${CMAKE_CURRENT_SOURCE_DIR}/macOS/cube/Resources/Main.storyboard)
+ set(cube_RESOURCES ${cube_RESOURCES} ${CMAKE_CURRENT_LIST_DIR}/Resources/Main.storyboard)
endif()
-add_executable(vkcube MACOSX_BUNDLE ${cube_SRCS} ${cube_HDRS} ${cube_RESOURCES} cube.vert.inc cube.frag.inc)
+add_executable(vkcube MACOSX_BUNDLE)
+
+target_sources(vkcube PRIVATE
+ main.m
+ AppDelegate.m
+ AppDelegate.h
+ DemoViewController.m
+ DemoViewController.h
+ ${cube_RESOURCES}
+ ../../cube.vert.inc
+ ../../cube.frag.inc
+)
# Handle the Storyboard ourselves
if(NOT XCODE)
@@ -44,7 +48,7 @@ if(NOT XCODE)
--notices
--output-format human-readable-text
--compile ${CMAKE_CURRENT_BINARY_DIR}/vkcube.app/Contents/Resources/Main.storyboardc
- ${CMAKE_CURRENT_SOURCE_DIR}/macOS/cube/Resources/Main.storyboard
+ ${CMAKE_CURRENT_LIST_DIR}/Resources/Main.storyboard
COMMENT "Compiling storyboard")
endif()
@@ -52,7 +56,7 @@ add_dependencies(vkcube MoltenVK_icd-staging-json)
# Include demo source code dir because the MacOS cube's Objective-C source includes the "original" cube application C source code.
# Also include the MoltenVK helper files.
-target_include_directories(vkcube PRIVATE ${CMAKE_CURRENT_SOURCE_DIR} ${MOLTENVK_DIR}/MoltenVK/include)
+target_include_directories(vkcube PRIVATE . ${MOLTENVK_DIR}/MoltenVK/include)
# We do this so vulkaninfo is linked to an individual library and NOT a framework.
target_link_libraries(vkcube Vulkan::Loader "-framework Cocoa -framework QuartzCore")
@@ -60,14 +64,14 @@ target_link_libraries(vkcube Vulkan::Loader "-framework Cocoa -framework QuartzC
# Disable warnings about sprintf
target_compile_options(vkcube PRIVATE -Wno-deprecated-declarations)
-set_target_properties(vkcube PROPERTIES MACOSX_BUNDLE_INFO_PLIST ${CMAKE_CURRENT_SOURCE_DIR}/macOS/cube/Info.plist)
+set_target_properties(vkcube PROPERTIES MACOSX_BUNDLE_INFO_PLIST ${CMAKE_CURRENT_LIST_DIR}/Info.plist)
# The RESOURCE target property cannot be used in conjunction with the MACOSX_PACKAGE_LOCATION property. We need fine-grained
# control over the Resource directory, so we have to specify the destination of all the resource files on a per-destination-
# directory basis. If all the files went into the top-level Resource directory, then we could simply set the RESOURCE property to a
# list of all the resource files.
set_source_files_properties(${cube_RESOURCES} PROPERTIES MACOSX_PACKAGE_LOCATION "Resources")
-set_source_files_properties("${CMAKE_BINARY_DIR}/staging-json/MoltenVK_icd.json"
+set_source_files_properties("${PROJECT_BINARY_DIR}/staging-json/MoltenVK_icd.json"
PROPERTIES
MACOSX_PACKAGE_LOCATION
"Resources/vulkan/icd.d")
diff --git a/cube/macOS/cubepp/cubepp.cmake b/cube/macOS/cubepp/CMakeLists.txt
index e6a3e485..070ea180 100644
--- a/cube/macOS/cubepp/cubepp.cmake
+++ b/cube/macOS/cubepp/CMakeLists.txt
@@ -17,24 +17,26 @@
# VkCube Application Bundle
-set(cubepp_SRCS
- ${CMAKE_CURRENT_SOURCE_DIR}/macOS/cubepp/main.mm
- ${CMAKE_CURRENT_SOURCE_DIR}/macOS/cubepp/AppDelegate.mm
- ${CMAKE_CURRENT_SOURCE_DIR}/macOS/cubepp/DemoViewController.mm)
-
-set(
- cubepp_HDRS ${CMAKE_CURRENT_SOURCE_DIR}/macOS/cubepp/AppDelegate.h ${CMAKE_CURRENT_SOURCE_DIR}/macOS/cubepp/DemoViewController.h
- )
-
-set(cubepp_RESOURCES ${CMAKE_BINARY_DIR}/staging-json/MoltenVK_icd.json
- ${CMAKE_CURRENT_SOURCE_DIR}/macOS/cubepp/Resources/VulkanIcon.icns)
+set(cubepp_RESOURCES ${PROJECT_BINARY_DIR}/staging-json/MoltenVK_icd.json
+ ${CMAKE_CURRENT_LIST_DIR}/Resources/VulkanIcon.icns)
# Have Xcode handle the Storyboard
if(XCODE)
- set(cubepp_RESOURCES ${cubepp_RESOURCES} ${CMAKE_CURRENT_SOURCE_DIR}/macOS/cubepp/Resources/Main.storyboard)
+ set(cubepp_RESOURCES ${cubepp_RESOURCES} ${CMAKE_CURRENT_LIST_DIR}/Resources/Main.storyboard)
endif()
-add_executable(vkcubepp MACOSX_BUNDLE ${cubepp_SRCS} ${cubepp_HDRS} ${cubepp_RESOURCES} cube.vert.inc cube.frag.inc)
+add_executable(vkcubepp MACOSX_BUNDLE)
+
+target_sources(vkcubepp PRIVATE
+ main.mm
+ AppDelegate.mm
+ AppDelegate.h
+ DemoViewController.h
+ DemoViewController.mm
+ ${cubepp_RESOURCES}
+ ../../cube.vert.inc
+ ../../cube.frag.inc
+)
# Handle the Storyboard ourselves
if(NOT XCODE)
@@ -46,7 +48,7 @@ if(NOT XCODE)
--notices
--output-format human-readable-text
--compile ${CMAKE_CURRENT_BINARY_DIR}/vkcubepp.app/Contents/Resources/Main.storyboardc
- ${CMAKE_CURRENT_SOURCE_DIR}/macOS/cubepp/Resources/Main.storyboard
+ ${CMAKE_CURRENT_LIST_DIR}/Resources/Main.storyboard
COMMENT "Compiling storyboard")
endif()
@@ -54,19 +56,19 @@ add_dependencies(vkcubepp MoltenVK_icd-staging-json)
# Include demo source code dir because the MacOS vkcubepp's Objective-C source includes the "original" vkcubepp application C++ source
# code. Also include the MoltenVK helper files.
-target_include_directories(vkcubepp PRIVATE ${CMAKE_CURRENT_SOURCE_DIR} ${MOLTENVK_DIR}/MoltenVK/include)
+target_include_directories(vkcubepp PRIVATE ${CMAKE_CURRENT_LIST_DIR} ${MOLTENVK_DIR}/MoltenVK/include)
# We do this so vulkaninfo is linked to an individual library and NOT a framework.
target_link_libraries(vkcubepp Vulkan::Loader "-framework Cocoa -framework QuartzCore")
-set_target_properties(vkcubepp PROPERTIES MACOSX_BUNDLE_INFO_PLIST ${CMAKE_CURRENT_SOURCE_DIR}/macOS/cubepp/Info.plist)
+set_target_properties(vkcubepp PROPERTIES MACOSX_BUNDLE_INFO_PLIST ${CMAKE_CURRENT_LIST_DIR}/Info.plist)
# The RESOURCE target property cannot be used in conjunction with the MACOSX_PACKAGE_LOCATION property. We need fine-grained
# control over the Resource directory, so we have to specify the destination of all the resource files on a per-destination-
# directory basis. If all the files went into the top-level Resource directory, then we could simply set the RESOURCE property to a
# list of all the resource files.
set_source_files_properties(${cubepp_RESOURCES} PROPERTIES MACOSX_PACKAGE_LOCATION "Resources")
-set_source_files_properties("${CMAKE_BINARY_DIR}/staging-json/MoltenVK_icd.json"
+set_source_files_properties("${PROJECT_BINARY_DIR}/staging-json/MoltenVK_icd.json"
PROPERTIES
MACOSX_PACKAGE_LOCATION
"Resources/vulkan/icd.d")