Video2ARKit/CMakeLists.txt

66 lines
2.6 KiB
CMake

# CMake project for the facialPerformanceNode Maya Plugin
cmake_minimum_required(VERSION 3.15)
project(FacialPerformanceNode)
set(CMAKE_MODULE_PATH ${CMAKE_MODULE_PATH} "${CMAKE_SOURCE_DIR}/cmake/modules/")
# --- USER CONFIGURATION: Set these paths ---
# Set the path to your Maya installation directory
set(MAYA_LOCATION "C:/Program Files/Autodesk/Maya2023" CACHE PATH "Path to Maya installation")
# Set the path to your OpenCV installation (where the OpenCVConfig.cmake is)
set(OpenCV_DIR "C:/path/to/opencv/build" CACHE PATH "Path to OpenCV build directory")
# Set the path to your MediaPipe installation (this is more complex and may require custom FindMediaPipe.cmake)
# For now, we'll define placeholder include/library paths.
set(MEDIAPIPE_INCLUDE_DIR "C:/path/to/mediapipe" CACHE PATH "Path to MediaPipe source/include")
set(MEDIAPIPE_LIBRARY "C:/path/to/mediapipe/build/lib/mediapipe.lib" CACHE FILEPATH "Path to MediaPipe library")
# --- END USER CONFIGURATION ---
# Set the name of our plugin
set(PLUGIN_NAME "facialPerformanceNode")
# Standard C++ settings
set(CMAKE_CXX_STANDARD 17)
set(CMAKE_CXX_STANDARD_REQUIRED ON)
# Find Maya
# Add Maya's module path to CMake's search paths
list(APPEND CMAKE_MODULE_PATH "${MAYA_LOCATION}/cmake")
# Define the plugin target
add_library(${PLUGIN_NAME} MODULE ${PLUGIN_SOURCES})
# Link against Maya's libraries
target_link_libraries(${PLUGIN_NAME} ${MAYA_LIBRARIES})
# Link against our custom dependencies
target_link_libraries(${PLUGIN_NAME} ${OpenCV_LIBS})
target_link_libraries(${PLUGIN_NAME} ${MEDIAPIPE_LIBRARY})
# Set the output extension for Maya plugins (.mll on Windows)
if(WIN32)
set_target_properties(${PLUGIN_NAME} PROPERTIES SUFFIX ".mll")
endif()
# Define preprocessor definitions required by Maya
target_compile_definitions(${PLUGIN_NAME} PRIVATE
NT_PLUGIN # For Windows
REQUIRE_IOSTREAM
)
# Instructions for the user:
# 1. Install CMake (https://cmake.org/download/)
# 2. Set the three paths at the top of this file (MAYA_LOCATION, OpenCV_DIR, MEDIAPIPE paths).
# 3. Create a 'build' directory inside this project folder.
# 4. Open a command prompt or terminal in the 'build' directory.
# 5. Run CMake to generate the project files for your compiler:
# For Visual Studio: cmake -G "Visual Studio 16 2019" ..
# For Makefiles: cmake ..
# 6. Compile the project:
# For Visual Studio: cmake --build . --config Release
# For Makefiles: make
# 7. The compiled facialPerformanceNode.mll will be in the 'build/Release' directory.
# 8. Copy the .mll file to your Maya plug-ins directory (e.g., C:/Users/YourUser/Documents/maya/2023/plug-ins).