проект (PROJECT) вызван с неверным количеством аргументов [CMake] [MAYA 2020] - PullRequest
0 голосов
/ 17 марта 2020

Как вы можете видеть, мой контент CMakeLists.txt: я должен добавить это, что моя версия MAYA 2020, но мой devkit 2020 исправление 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

1 Ответ

0 голосов
/ 17 марта 2020

проект () не должен быть пустым проект (тест) решил мою проблему

 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()
...