diff --git a/pxr/pxrConfig.cmake.in b/pxr/pxrConfig.cmake.in index c216f6ebe5..91c2b1ca8e 100644 --- a/pxr/pxrConfig.cmake.in +++ b/pxr/pxrConfig.cmake.in @@ -23,30 +23,42 @@ set(PXR_VERSION "@PXR_VERSION@") # running cmake. if(@PXR_ENABLE_PYTHON_SUPPORT@) if(@PXR_USE_PYTHON_3@) - if (NOT DEFINED Python3_EXECUTABLE AND "@Python3_EXECUTABLE@") - set(Python3_EXECUTABLE "@Python3_EXECUTABLE@") + if (NOT DEFINED Python3_EXECUTABLE) + if (NOT [[@Python3_EXECUTABLE@]] STREQUAL "") + set(Python3_EXECUTABLE [[@Python3_EXECUTABLE@]]) + endif() endif() - if (NOT DEFINED Python3_LIBRARY AND "@Python3_LIBRARY@") - set(Python3_LIBRARY "@Python3_LIBRARY@") + if (NOT DEFINED Python3_LIBRARY) + if (NOT [[@Python3_LIBRARY@]] STREQUAL "") + set(Python3_LIBRARY [[@Python3_LIBRARY@]]) + endif() endif() - if (NOT DEFINED Python3_INCLUDE_DIR AND "@Python3_INCLUDE_DIR@") - set(Python3_INCLUDE_DIR "@Python3_INCLUDE_DIR@") + if (NOT DEFINED Python3_INCLUDE_DIR) + if (NOT [[@Python3_INCLUDE_DIR@]] STREQUAL "") + set(Python3_INCLUDE_DIR [[@Python3_INCLUDE_DIR@]]) + endif() endif() find_package(Python3 COMPONENTS Development REQUIRED) else() - if (NOT DEFINED Python2_EXECUTABLE AND "@Python2_EXECUTABLE@") - set(Python2_EXECUTABLE "@Python2_EXECUTABLE@") + if (NOT DEFINED Python2_EXECUTABLE) + if (NOT [[@Python2_EXECUTABLE@]] STREQUAL "") + set(Python2_EXECUTABLE [[@Python2_EXECUTABLE@]]) + endif() endif() - if (NOT DEFINED Python2_LIBRARY AND "@Python2_LIBRARY@") - set(Python2_LIBRARY "@Python2_LIBRARY@") + if (NOT DEFINED Python2_LIBRARY) + if (NOT [[@Python2_LIBRARY@]] STREQUAL "") + set(Python2_LIBRARY [[@Python2_LIBRARY@]]) + endif() endif() - if (NOT DEFINED Python2_INCLUDE_DIR AND "@Python2_INCLUDE_DIR@") - set(Python2_INCLUDE_DIR "@Python2_INCLUDE_DIR@") + if (NOT DEFINED Python2_INCLUDE_DIR) + if (NOT [[@Python2_INCLUDE_DIR@]] STREQUAL "") + set(Python2_INCLUDE_DIR [[@Python2_INCLUDE_DIR@]]) + endif() endif() find_package(Python2 COMPONENTS Development REQUIRED) @@ -60,7 +72,9 @@ endif() # specifying a different MaterialX_DIR when running cmake. if(@PXR_ENABLE_MATERIALX_SUPPORT@) if (NOT DEFINED MaterialX_DIR) - set(MaterialX_DIR "@MaterialX_DIR@") + if (NOT [[@MaterialX_DIR@]] STREQUAL "") + set(MaterialX_DIR [[@MaterialX_DIR@]]) + endif() endif() find_package(MaterialX REQUIRED) endif() @@ -72,7 +86,9 @@ endif() # used instead of OpenExr (refer Packages.cmake) if(@Imath_FOUND@) if (NOT DEFINED Imath_DIR) - set(Imath_DIR "@Imath_DIR@") + if (NOT [[@Imath_DIR@]] STREQUAL "") + set(Imath_DIR [[@Imath_DIR@]]) + endif() endif() find_package(Imath REQUIRED) endif()