From a497528c5919e712077d77956f055405e82bae5e Mon Sep 17 00:00:00 2001 From: Manuel Kraemer Date: Mon, 28 Apr 2014 10:21:39 -0700 Subject: [PATCH] Adding a NO_MAYA flag to CMakeLists to disable all Autodesk Maya dependencies in the build --- CMakeLists.txt | 28 ++++++++++++++++------------ examples/CMakeLists.txt | 2 +- 2 files changed, 17 insertions(+), 13 deletions(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index b0929a47..df315b3e 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -294,7 +294,9 @@ if (NOT NO_GCD AND APPLE) set(GCD_FOUND 1) endif() +if (NOT NO_MAYA) find_package(Maya 201200) +endif() # Warn about missing dependencies that will cause parts of OpenSubdiv to be # disabled. Also, add preprocessor defines that can be used in the source @@ -409,18 +411,20 @@ else() ) endif() -if(MAYA_FOUND) - add_definitions( - -DOPENSUBDIV_HAS_MAYA - ) -else() - message(WARNING - "Maya was not found : the OpenSubdiv mayaViwer plugin will not be " - "available. If you do have Maya installed and see this message, " - "please add your Maya path to FindMaya.cmake in " - "${PROJECT_SOURCE_DIR}/cmake or set it through the MAYA_LOCATION " - "cmake command line argument or environment variable." - ) +if (NOT NO_MAYA) + if(MAYA_FOUND) + add_definitions( + -DOPENSUBDIV_HAS_MAYA + ) + else() + message(WARNING + "Maya was not found : the OpenSubdiv mayaViwer plugin will not be " + "available. If you do have Maya installed and see this message, " + "please add your Maya path to FindMaya.cmake in " + "${PROJECT_SOURCE_DIR}/cmake or set it through the MAYA_LOCATION " + "cmake command line argument or environment variable." + ) + endif() endif() # Link examples & regressions dynamically against Osd diff --git a/examples/CMakeLists.txt b/examples/CMakeLists.txt index 82955602..a2192c8d 100644 --- a/examples/CMakeLists.txt +++ b/examples/CMakeLists.txt @@ -79,7 +79,7 @@ if(DXSDK_FOUND) endif() -if(MAYA_FOUND) +if(MAYA_FOUND AND (NOT NO_MAYA)) add_subdirectory(osdPolySmooth) # manuelk: the following plugins are disabled until further notice