未发现CocosBuildSet

$ mkdir ios-build && cd ios-build
cmake … -GXcode -DCMAKE_SYSTEM_NAME=iOS -DCMAKE_OSX_SYSROOT=iphoneos
– The C compiler identification is AppleClang 12.0.0.12000032
– The CXX compiler identification is AppleClang 12.0.0.12000032
– Check for working C compiler: /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/clang
– Check for working C compiler: /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/clang - works
– Detecting C compiler ABI info
– Detecting C compiler ABI info - done
– Detecting C compile features
– Detecting C compile features - done
– Check for working CXX compiler: /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/clang++
– Check for working CXX compiler: /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/clang++ - works
– Detecting CXX compiler ABI info
– Detecting CXX compiler ABI info - done
– Detecting CXX compile features
– Detecting CXX compile features - done
CMake Error at CMakeLists.txt:17 (include):
include could not find load file:

CocosBuildSet

CMake Error at CMakeLists.txt:19 (add_subdirectory):
add_subdirectory given source
“/Users/shaocongcong/Documents/gamework/ym-woool/project/…/…/…/program/cocos2d-x-4.0//cocos”
which is not an existing directory.

CMake Error at CMakeLists.txt:32 (cocos_mark_multi_resources):
Unknown CMake command “cocos_mark_multi_resources”.

– Configuring incomplete, errors occurred!
See also “/Users/shaocongcong/Documents/gamework/ym-woool/project/ios-build/CMakeFiles/CMakeOutput.log”.

我的环境变量设置的是:

Add environment variable COCOS_CONSOLE_ROOT for cocos2d-x

export COCOS_CONSOLE_ROOT="/Users/shaocongcong/Documents/gamework/cocos2d-x-4.0/tools/cocos2d-console/bin"

export PATH=$COCOS_CONSOLE_ROOT:$PATH

Add environment variable COCOS_X_ROOT for cocos2d-x

export COCOS_X_ROOT="/Users/shaocongcong/Documents/gamework"

export PATH=$COCOS_X_ROOT:$PATH

Add environment variable COCOS_TEMPLATES_ROOT for cocos2d-x

export COCOS_TEMPLATES_ROOT="/Users/shaocongcong/Documents/gamework/cocos2d-x-4.0/templates"

export PATH=$COCOS_TEMPLATES_ROOT:$PATH

楼主解决了吗?