From 66c0e8ebcd95b444198bbb565411b4d3299f330f Mon Sep 17 00:00:00 2001 From: captain Date: Wed, 7 Oct 2020 00:29:33 +0800 Subject: [PATCH] Build for mac platform #777 Add Main.storyboard --- app/mac/CMakeLists.txt | 8 +- app/mac/Main.storyboard | 719 +++++++++++++++++++++++++++++++ app/mac/resources/mac/Info.plist | 2 + 3 files changed, 726 insertions(+), 3 deletions(-) create mode 100644 app/mac/Main.storyboard diff --git a/app/mac/CMakeLists.txt b/app/mac/CMakeLists.txt index d6e71a0eb..e53e81acf 100644 --- a/app/mac/CMakeLists.txt +++ b/app/mac/CMakeLists.txt @@ -21,13 +21,14 @@ ENDMACRO(ADD_FRAMEWORK) # Get all project files recursively FILE(GLOB_RECURSE HEADER_FILES *.h *.inl) FILE(GLOB_RECURSE SOURCE_FILES *.cpp *.m *.mm) +FILE(GLOB_RECURSE STORYBOARD_FILES *.storyboard) -SET(ALL_FILES ${HEADER_FILES} ${SOURCE_FILES}) +SET(ALL_FILES ${HEADER_FILES} ${SOURCE_FILES} ${STORYBOARD_FILES}) # group source files GROUP_FILES(ALL_FILES ${CMAKE_CURRENT_SOURCE_DIR}) -# iOS platorm resources +# Mac platorm resources SET(MAC_RESOURCE_FILES ${MODULE_PATH}/resources/mac/App.icns ${MODULE_PATH}/resources/data @@ -47,7 +48,7 @@ SET(FRAMEWORKS "${FRAMEWORKS} -ObjC") SET(CMAKE_EXE_LINKER_FLAGS ${FRAMEWORKS}) SET(CMAKE_OSX_ARCHITECTURES "${ARCHS_STANDARD}") -ADD_EXECUTABLE(${MODULE_NAME} MACOSX_BUNDLE ${HEADER_FILES} ${SOURCE_FILES} ${MAC_RESOURCE_FILES} CMakeLists.txt) +ADD_EXECUTABLE(${MODULE_NAME} MACOSX_BUNDLE ${ALL_FILES} ${MAC_RESOURCE_FILES} CMakeLists.txt) # Link Library TARGET_LINK_LIBRARIES(${MODULE_NAME} engine) @@ -60,6 +61,7 @@ SET_TARGET_PROPERTIES(${MODULE_NAME} PROPERTIES XCODE_ATTRIBUTE_TARGETED_DEVICE_ SET_TARGET_PROPERTIES(${MODULE_NAME} PROPERTIES XCODE_ATTRIBUTE_COPY_PHASE_STRIP No) SET_TARGET_PROPERTIES(${MODULE_NAME} PROPERTIES XCODE_ATTRIBUTE_OTHER_CODE_SIGN_FLAGS "--deep") SET_TARGET_PROPERTIES(${MODULE_NAME} PROPERTIES MACOSX_BUNDLE_INFO_PLIST ${CMAKE_CURRENT_SOURCE_DIR}/resources/mac/Info.plist) +SET_TARGET_PROPERTIES(${MODULE_NAME} PROPERTIES RESOURCE ${STORYBOARD_FILES}) # Messages MESSAGE(STATUS "Configure Mac App success!") diff --git a/app/mac/Main.storyboard b/app/mac/Main.storyboard new file mode 100644 index 000000000..fbea02b16 --- /dev/null +++ b/app/mac/Main.storyboard @@ -0,0 +1,719 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + Default + + + + + + + Left to Right + + + + + + + Right to Left + + + + + + + + + + + Default + + + + + + + Left to Right + + + + + + + Right to Left + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/app/mac/resources/mac/Info.plist b/app/mac/resources/mac/Info.plist index 5587e76d9..9b5a009ac 100644 --- a/app/mac/resources/mac/Info.plist +++ b/app/mac/resources/mac/Info.plist @@ -30,6 +30,8 @@ NSHumanReadableCopyright + NSMainStoryboardFile + Main NSPrincipalClass NSApplication NSHighResolutionCapable