使用不正确数量的参数调用的项目 (PROJECT) [CMake] [MAYA 2020]

project (PROJECT) called with incorrect number of arguments [CMake] [MAYA 2020]

如您所见,我的 CMakeLists.txt 内容是: 我应该补充一点,我的 MAYA 版本是 2020,但我的 devkit 是 2020 hotfix 1 会不会是问题所在?

不知道为什么Autodesk或者其他公司的文档不全。 他们只是解释事情一般不详细

cmake_minimum_required(VERSION 2.8)
project()

set(PROJECT_NAME test)


include($ENV{DEVKIT_LOCATION}/cmake/pluginEntry.cmake)



set(RESOURCES_FILES myResource.xpm)

set(MEL_FILES 
    test.mel)

set(SOURCE_FILES
        test.cpp
        ${MEL_FILES}
    )

set(LIBRARIES
    OpenMaya Foundation
    )

build_plugin()

当我想在 CMake 中生成时,我得到了这些错误:

CMake Error at CMakeLists.txt:2 (project):
  project PROJECT called with incorrect number of arguments


    CMake Warning (dev) at M:/Autodesk_Maya_2020_DEVKIT_Windows_Hotfix_1/devkitBase/cmake/pluginEntry.cmake:204 (add_library):
      ADD_LIBRARY called with SHARED option but the target platform does not
      support dynamic linking.  Building a STATIC library instead.  This may lead
      to problems.
    Call Stack (most recent call first):
      CMakeLists.txt:25 (build_plugin)
    This warning is for project developers.  Use -Wno-dev to suppress it.

    CMake Error: Error required internal CMake variable not set, cmake may not be built correctly.
    Missing variable is:
    CMAKE_FIND_LIBRARY_PREFIXES
    CMake Error: Error required internal CMake variable not set, cmake may not be built correctly.
    Missing variable is:
    CMAKE_FIND_LIBRARY_SUFFIXES
    CMake Error: Error required internal CMake variable not set, cmake may not be built correctly.
    Missing variable is:
    CMAKE_FIND_LIBRARY_PREFIXES
    CMake Error: Error required internal CMake variable not set, cmake may not be built correctly.
    Missing variable is:
    CMAKE_FIND_LIBRARY_SUFFIXES
    CMake Error: The following variables are used in this project, but they are set to NOTFOUND.
    Please set them or make sure they are set and tested correctly in the CMake files:
    Foundation_PATH
        linked by target "test" in directory C:/Users/amink/Desktop/API Project
    OpenMaya_PATH
        linked by target "test" in directory C:/Users/amink/Desktop/API Project

project() 不应该是空的 project(test) 解决了我的问题

 cmake_minimum_required(VERSION 2.8)
    project(test)

    set(PROJECT_NAME test)


    include($ENV{DEVKIT_LOCATION}/cmake/pluginEntry.cmake)



    set(RESOURCES_FILES myResource.xpm)

    set(MEL_FILES 
        test.mel)

    set(SOURCE_FILES
            test.cpp
            ${MEL_FILES}
        )

    set(LIBRARIES
        OpenMaya Foundation
        )

    build_plugin()