From 42713bf0f8c5de62fb4f95972a0e86d6e7231937 Mon Sep 17 00:00:00 2001 From: Campbell Barton Date: Sat, 29 Jul 2023 13:47:55 +1000 Subject: [PATCH] Cleanup: quiet uninitialized warnings for finder root directories --- build_files/cmake/Modules/FindAlembic.cmake | 8 ++++++-- build_files/cmake/Modules/FindBlosc.cmake | 8 ++++++-- build_files/cmake/Modules/FindBrotli.cmake | 8 ++++++-- build_files/cmake/Modules/FindClang.cmake | 8 ++++++-- build_files/cmake/Modules/FindClangTidy.cmake | 8 ++++++-- build_files/cmake/Modules/FindEigen3.cmake | 8 ++++++-- build_files/cmake/Modules/FindEmbree.cmake | 8 ++++++-- build_files/cmake/Modules/FindEpoxy.cmake | 7 ++++++- build_files/cmake/Modules/FindFFmpeg.cmake | 8 ++++++-- build_files/cmake/Modules/FindFftw3.cmake | 8 ++++++-- build_files/cmake/Modules/FindGMP.cmake | 8 ++++++-- build_files/cmake/Modules/FindGflags.cmake | 8 ++++++-- build_files/cmake/Modules/FindGlog.cmake | 8 ++++++-- build_files/cmake/Modules/FindHIP.cmake | 8 ++++++-- build_files/cmake/Modules/FindHIPRT.cmake | 8 ++++++-- build_files/cmake/Modules/FindHaru.cmake | 8 ++++++-- build_files/cmake/Modules/FindIcuLinux.cmake | 8 ++++++-- build_files/cmake/Modules/FindJack.cmake | 8 ++++++-- build_files/cmake/Modules/FindJeMalloc.cmake | 8 ++++++-- build_files/cmake/Modules/FindLZO.cmake | 8 ++++++-- build_files/cmake/Modules/FindMoltenVK.cmake | 8 ++++++-- build_files/cmake/Modules/FindNanoVDB.cmake | 8 ++++++-- build_files/cmake/Modules/FindOSL.cmake | 8 ++++++-- build_files/cmake/Modules/FindOpenCOLLADA.cmake | 8 ++++++-- build_files/cmake/Modules/FindOpenColorIO.cmake | 8 ++++++-- build_files/cmake/Modules/FindOpenEXR.cmake | 8 ++++++-- build_files/cmake/Modules/FindOpenImageDenoise.cmake | 8 ++++++-- build_files/cmake/Modules/FindOpenImageIO.cmake | 8 ++++++-- build_files/cmake/Modules/FindOpenJPEG.cmake | 8 ++++++-- build_files/cmake/Modules/FindOpenSubdiv.cmake | 8 ++++++-- build_files/cmake/Modules/FindOpenVDB.cmake | 8 ++++++-- build_files/cmake/Modules/FindOptiX.cmake | 8 ++++++-- build_files/cmake/Modules/FindPCRE.cmake | 8 ++++++-- build_files/cmake/Modules/FindPotrace.cmake | 8 ++++++-- build_files/cmake/Modules/FindPugiXML.cmake | 8 ++++++-- build_files/cmake/Modules/FindPulse.cmake | 8 ++++++-- build_files/cmake/Modules/FindPythonLibsUnix.cmake | 8 ++++++-- build_files/cmake/Modules/FindSDL2.cmake | 8 ++++++-- build_files/cmake/Modules/FindShaderC.cmake | 8 ++++++-- build_files/cmake/Modules/FindSndFile.cmake | 8 ++++++-- build_files/cmake/Modules/FindSpacenav.cmake | 8 ++++++-- build_files/cmake/Modules/FindTBB.cmake | 8 ++++++-- build_files/cmake/Modules/FindUSD.cmake | 8 ++++++-- build_files/cmake/Modules/FindVulkan.cmake | 8 ++++++-- build_files/cmake/Modules/FindWebP.cmake | 8 ++++++-- build_files/cmake/Modules/FindXML2.cmake | 8 ++++++-- build_files/cmake/Modules/FindXR_OpenXR_SDK.cmake | 8 ++++++-- build_files/cmake/Modules/FindZstd.cmake | 8 ++++++-- build_files/cmake/Modules/Findsse2neon.cmake | 8 ++++++-- 49 files changed, 294 insertions(+), 97 deletions(-) diff --git a/build_files/cmake/Modules/FindAlembic.cmake b/build_files/cmake/Modules/FindAlembic.cmake index 9bcf78e5f8d..95a93a8bf8d 100644 --- a/build_files/cmake/Modules/FindAlembic.cmake +++ b/build_files/cmake/Modules/FindAlembic.cmake @@ -13,9 +13,13 @@ # ALEMBIC_FOUND, If false, do not try to use Alembic. # -# If ALEMBIC_ROOT_DIR was defined in the environment, use it. -IF(NOT ALEMBIC_ROOT_DIR AND NOT $ENV{ALEMBIC_ROOT_DIR} STREQUAL "") +# If `ALEMBIC_ROOT_DIR` was defined in the environment, use it. +IF(DEFINED ALEMBIC_ROOT_DIR) + # Pass. +ELSEIF(DEFINED ENV{ALEMBIC_ROOT_DIR}) SET(ALEMBIC_ROOT_DIR $ENV{ALEMBIC_ROOT_DIR}) +ELSE() + SET(ALEMBIC_ROOT_DIR "") ENDIF() SET(_alembic_SEARCH_DIRS diff --git a/build_files/cmake/Modules/FindBlosc.cmake b/build_files/cmake/Modules/FindBlosc.cmake index 45b8bbc2764..b29baff370c 100644 --- a/build_files/cmake/Modules/FindBlosc.cmake +++ b/build_files/cmake/Modules/FindBlosc.cmake @@ -15,9 +15,13 @@ # also defined, but not for general use are # BLOSC_LIBRARY, where to find the Blosc library. -# If BLOSC_ROOT_DIR was defined in the environment, use it. -IF(NOT BLOSC_ROOT_DIR AND NOT $ENV{BLOSC_ROOT_DIR} STREQUAL "") +# If `BLOSC_ROOT_DIR` was defined in the environment, use it. +IF(DEFINED BLOSC_ROOT_DIR) + # Pass. +ELSEIF(DEFINED ENV{BLOSC_ROOT_DIR}) SET(BLOSC_ROOT_DIR $ENV{BLOSC_ROOT_DIR}) +ELSE() + SET(BLOSC_ROOT_DIR "") ENDIF() SET(_blosc_SEARCH_DIRS diff --git a/build_files/cmake/Modules/FindBrotli.cmake b/build_files/cmake/Modules/FindBrotli.cmake index b83b3a30991..034c65140e8 100644 --- a/build_files/cmake/Modules/FindBrotli.cmake +++ b/build_files/cmake/Modules/FindBrotli.cmake @@ -12,9 +12,13 @@ # BROTLI_FOUND, If false, do not try to use Brotli. # -# If BROTLI_ROOT_DIR was defined in the environment, use it. -IF(NOT BROTLI_ROOT_DIR AND NOT $ENV{BROTLI_ROOT_DIR} STREQUAL "") +# If `BROTLI_ROOT_DIR` was defined in the environment, use it. +IF(DEFINED BROTLI_ROOT_DIR) + # Pass. +ELSEIF(DEFINED ENV{BROTLI_ROOT_DIR}) SET(BROTLI_ROOT_DIR $ENV{BROTLI_ROOT_DIR}) +ELSE() + SET(BROTLI_ROOT_DIR "") ENDIF() SET(_BROTLI_SEARCH_DIRS diff --git a/build_files/cmake/Modules/FindClang.cmake b/build_files/cmake/Modules/FindClang.cmake index f0c218ac60d..af26a558c64 100644 --- a/build_files/cmake/Modules/FindClang.cmake +++ b/build_files/cmake/Modules/FindClang.cmake @@ -12,9 +12,13 @@ # This can also be an environment variable. # CLANG_FOUND, If false, do not try to use Clang. -# If CLANG_ROOT_DIR was defined in the environment, use it. -if(NOT CLANG_ROOT_DIR AND NOT $ENV{CLANG_ROOT_DIR} STREQUAL "") +# If `CLANG_ROOT_DIR` was defined in the environment, use it. +if(DEFINED CLANG_ROOT_DIR) + # Pass. +elseif(DEFINED ENV{CLANG_ROOT_DIR}) set(CLANG_ROOT_DIR $ENV{CLANG_ROOT_DIR}) +else() + set(CLANG_ROOT_DIR "") endif() if(NOT LLVM_ROOT_DIR) diff --git a/build_files/cmake/Modules/FindClangTidy.cmake b/build_files/cmake/Modules/FindClangTidy.cmake index 8b995544303..601907da286 100644 --- a/build_files/cmake/Modules/FindClangTidy.cmake +++ b/build_files/cmake/Modules/FindClangTidy.cmake @@ -18,9 +18,13 @@ # # CLANG_TIDY_FOUND, If false, do not try to use Eigen3. -# If CLANG_TIDY_ROOT_DIR was defined in the environment, use it. -if(NOT CLANG_TIDY_ROOT_DIR AND NOT $ENV{CLANG_TIDY_ROOT_DIR} STREQUAL "") +# If `CLANG_TIDY_ROOT_DIR` was defined in the environment, use it. +if(DEFINED CLANG_TIDY_ROOT_DIR) + # Pass. +elseif(DEFINED ENV{CLANG_TIDY_ROOT_DIR}) set(CLANG_TIDY_ROOT_DIR $ENV{CLANG_TIDY_ROOT_DIR}) +else() + set(CLANG_TIDY_ROOT_DIR "") endif() set(_clang_tidy_SEARCH_DIRS diff --git a/build_files/cmake/Modules/FindEigen3.cmake b/build_files/cmake/Modules/FindEigen3.cmake index dc55d6d3e32..9798bfe3759 100644 --- a/build_files/cmake/Modules/FindEigen3.cmake +++ b/build_files/cmake/Modules/FindEigen3.cmake @@ -11,9 +11,13 @@ # This can also be an environment variable. # EIGEN3_FOUND, If false, do not try to use Eigen3. -# If EIGEN3_ROOT_DIR was defined in the environment, use it. -IF(NOT EIGEN3_ROOT_DIR AND NOT $ENV{EIGEN3_ROOT_DIR} STREQUAL "") +# If `EIGEN3_ROOT_DIR` was defined in the environment, use it. +IF(DEFINED EIGEN3_ROOT_DIR) + # Pass. +ELSEIF(DEFINED ENV{EIGEN3_ROOT_DIR}) SET(EIGEN3_ROOT_DIR $ENV{EIGEN3_ROOT_DIR}) +ELSE() + SET(EIGEN3_ROOT_DIR "") ENDIF() SET(_eigen3_SEARCH_DIRS diff --git a/build_files/cmake/Modules/FindEmbree.cmake b/build_files/cmake/Modules/FindEmbree.cmake index 79de132b465..1a1e5d9e320 100644 --- a/build_files/cmake/Modules/FindEmbree.cmake +++ b/build_files/cmake/Modules/FindEmbree.cmake @@ -12,9 +12,13 @@ # This can also be an environment variable. # EMBREEFOUND, If false, do not try to use Embree. -# If EMBREE_ROOT_DIR was defined in the environment, use it. -IF(NOT EMBREE_ROOT_DIR AND NOT $ENV{EMBREE_ROOT_DIR} STREQUAL "") +# If `EMBREE_ROOT_DIR` was defined in the environment, use it. +IF(DEFINED EMBREE_ROOT_DIR) + # Pass. +ELSEIF(DEFINED ENV{EMBREE_ROOT_DIR}) SET(EMBREE_ROOT_DIR $ENV{EMBREE_ROOT_DIR}) +ELSE() + SET(EMBREE_ROOT_DIR "") ENDIF() SET(_embree_SEARCH_DIRS diff --git a/build_files/cmake/Modules/FindEpoxy.cmake b/build_files/cmake/Modules/FindEpoxy.cmake index c4864a4f09c..ae2e5bb532f 100644 --- a/build_files/cmake/Modules/FindEpoxy.cmake +++ b/build_files/cmake/Modules/FindEpoxy.cmake @@ -9,8 +9,13 @@ # This can also be an environment variable. # Epoxy_FOUND, If false, do not try to use epoxy. -IF(NOT EPOXY_ROOT_DIR AND NOT $ENV{EPOXY_ROOT_DIR} STREQUAL "") +# If `EPOXY_ROOT_DIR` was defined in the environment, use it. +IF(DEFINED EPOXY_ROOT_DIR) + # Pass. +ELSEIF(DEFINED ENV{EPOXY_ROOT_DIR}) SET(EPOXY_ROOT_DIR $ENV{EPOXY_ROOT_DIR}) +ELSE() + SET(EPOXY_ROOT_DIR "") ENDIF() FIND_PATH(Epoxy_INCLUDE_DIR diff --git a/build_files/cmake/Modules/FindFFmpeg.cmake b/build_files/cmake/Modules/FindFFmpeg.cmake index f9d18510283..a21512edd9b 100644 --- a/build_files/cmake/Modules/FindFFmpeg.cmake +++ b/build_files/cmake/Modules/FindFFmpeg.cmake @@ -13,9 +13,13 @@ # FFMPEG_FOUND, If false, do not try to use FFmpeg. # FFMPEG__LIBRARY, the given individual component libraries. -# If FFMPEG_ROOT_DIR was defined in the environment, use it. -if(NOT FFMPEG_ROOT_DIR AND NOT $ENV{FFMPEG_ROOT_DIR} STREQUAL "") +# If `FFMPEG_ROOT_DIR` was defined in the environment, use it. +if(DEFINED FFMPEG_ROOT_DIR) + # Pass. +elseif(DEFINED ENV{FFMPEG_ROOT_DIR}) set(FFMPEG_ROOT_DIR $ENV{FFMPEG_ROOT_DIR}) +else() + set(FFMPEG_ROOT_DIR "") endif() set(_ffmpeg_SEARCH_DIRS diff --git a/build_files/cmake/Modules/FindFftw3.cmake b/build_files/cmake/Modules/FindFftw3.cmake index aae05cf9354..ca9effb7349 100644 --- a/build_files/cmake/Modules/FindFftw3.cmake +++ b/build_files/cmake/Modules/FindFftw3.cmake @@ -15,9 +15,13 @@ # also defined, but not for general use are # FFTW3_LIBRARY, where to find the Fftw3 library. -# If FFTW3_ROOT_DIR was defined in the environment, use it. -IF(NOT FFTW3_ROOT_DIR AND NOT $ENV{FFTW3_ROOT_DIR} STREQUAL "") +# If `FFTW3_ROOT_DIR` was defined in the environment, use it. +IF(DEFINED FFTW3_ROOT_DIR) + # Pass. +ELSEIF(DEFINED ENV{FFTW3_ROOT_DIR}) SET(FFTW3_ROOT_DIR $ENV{FFTW3_ROOT_DIR}) +ELSE() + SET(FFTW3_ROOT_DIR "") ENDIF() SET(_fftw3_SEARCH_DIRS diff --git a/build_files/cmake/Modules/FindGMP.cmake b/build_files/cmake/Modules/FindGMP.cmake index 0cbb0e9f63f..eb62f266d1f 100644 --- a/build_files/cmake/Modules/FindGMP.cmake +++ b/build_files/cmake/Modules/FindGMP.cmake @@ -15,9 +15,13 @@ # also defined, but not for general use are # GMP_LIBRARY, where to find the GMP library. -# If GMP_ROOT_DIR was defined in the environment, use it. -IF(NOT GMP_ROOT_DIR AND NOT $ENV{GMP_ROOT_DIR} STREQUAL "") +# If `GMP_ROOT_DIR` was defined in the environment, use it. +IF(DEFINED GMP_ROOT_DIR) + # Pass. +ELSEIF(DEFINED ENV{GMP_ROOT_DIR}) SET(GMP_ROOT_DIR $ENV{GMP_ROOT_DIR}) +ELSE() + SET(GMP_ROOT_DIR "") ENDIF() SET(_gmp_SEARCH_DIRS diff --git a/build_files/cmake/Modules/FindGflags.cmake b/build_files/cmake/Modules/FindGflags.cmake index 773e09dafea..63cb234b25e 100644 --- a/build_files/cmake/Modules/FindGflags.cmake +++ b/build_files/cmake/Modules/FindGflags.cmake @@ -60,9 +60,13 @@ # GFLAGS_LIBRARY: gflags library, not including the libraries of any # dependencies. -# If GFLAGS_ROOT_DIR was defined in the environment, use it. -if(NOT GFLAGS_ROOT_DIR AND NOT $ENV{GFLAGS_ROOT_DIR} STREQUAL "") +# If `GFLAGS_ROOT_DIR` was defined in the environment, use it. +if(DEFINED GFLAGS_ROOT_DIR) + # Pass. +elseif(DEFINED ENV{GFLAGS_ROOT_DIR}) set(GFLAGS_ROOT_DIR $ENV{GFLAGS_ROOT_DIR}) +else() + set(GFLAGS_ROOT_DIR "") endif() if(DEFINED GFLAGS_ROOT_DIR) diff --git a/build_files/cmake/Modules/FindGlog.cmake b/build_files/cmake/Modules/FindGlog.cmake index 0c340332e60..0eec34a129f 100644 --- a/build_files/cmake/Modules/FindGlog.cmake +++ b/build_files/cmake/Modules/FindGlog.cmake @@ -38,9 +38,13 @@ # GLOG_LIBRARY: glog library, not including the libraries of any # dependencies. -# If GLOG_ROOT_DIR was defined in the environment, use it. -if(NOT GLOG_ROOT_DIR AND NOT $ENV{GLOG_ROOT_DIR} STREQUAL "") +# If `GLOG_ROOT_DIR` was defined in the environment, use it. +if(DEFINED GLOG_ROOT_DIR) + # Pass. +elseif(DEFINED ENV{GLOG_ROOT_DIR}) set(GLOG_ROOT_DIR $ENV{GLOG_ROOT_DIR}) +else() + set(GLOG_ROOT_DIR "") endif() if(DEFINED GLOG_ROOT_DIR) diff --git a/build_files/cmake/Modules/FindHIP.cmake b/build_files/cmake/Modules/FindHIP.cmake index 22e4eb3d3cf..a5bd424370b 100644 --- a/build_files/cmake/Modules/FindHIP.cmake +++ b/build_files/cmake/Modules/FindHIP.cmake @@ -7,9 +7,13 @@ # HIP_VERSION, the HIP compiler version # HIP_FOUND, if the HIP toolkit is found. -# If HIP_ROOT_DIR was defined in the environment, use it. -if(NOT HIP_ROOT_DIR AND NOT $ENV{HIP_ROOT_DIR} STREQUAL "") +# If `HIP_ROOT_DIR` was defined in the environment, use it. +if(DEFINED HIP_ROOT_DIR) + # Pass. +elseif(DEFINED ENV{HIP_ROOT_DIR}) set(HIP_ROOT_DIR $ENV{HIP_ROOT_DIR}) +else() + set(HIP_ROOT_DIR "") endif() set(_hip_SEARCH_DIRS diff --git a/build_files/cmake/Modules/FindHIPRT.cmake b/build_files/cmake/Modules/FindHIPRT.cmake index ca6ae7bfe54..abc3baca98a 100644 --- a/build_files/cmake/Modules/FindHIPRT.cmake +++ b/build_files/cmake/Modules/FindHIPRT.cmake @@ -7,9 +7,13 @@ # HIPRT_BITCODE, bitcode file with ray-tracing functionality # HIPRT_FOUND, if SDK found -# If HIPRT_ROOT_DIR was defined in the environment, use it. -if(NOT HIPRT_ROOT_DIR AND NOT $ENV{HIPRT_ROOT_DIR} STREQUAL "") +# If `HIPRT_ROOT_DIR` was defined in the environment, use it. +if(DEFINED HIPRT_ROOT_DIR) + # Pass. +elseif(DEFINED ENV{HIPRT_ROOT_DIR}) set(HIPRT_ROOT_DIR $ENV{HIPRT_ROOT_DIR}) +else() + set(HIPRT_ROOT_DIR "") endif() set(_hiprt_SEARCH_DIRS diff --git a/build_files/cmake/Modules/FindHaru.cmake b/build_files/cmake/Modules/FindHaru.cmake index 289a88c1ba1..d2509ad1395 100644 --- a/build_files/cmake/Modules/FindHaru.cmake +++ b/build_files/cmake/Modules/FindHaru.cmake @@ -15,9 +15,13 @@ # also defined, but not for general use are # HARU_LIBRARY, where to find the Haru library. -# If HARU_ROOT_DIR was defined in the environment, use it. -if(NOT HARU_ROOT_DIR AND NOT $ENV{HARU_ROOT_DIR} STREQUAL "") +# If `HARU_ROOT_DIR` was defined in the environment, use it. +if(DEFINED HARU_ROOT_DIR) + # Pass. +elseif(DEFINED ENV{HARU_ROOT_DIR}) set(HARU_ROOT_DIR $ENV{HARU_ROOT_DIR}) +else() + set(HARU_ROOT_DIR "") endif() set(_haru_SEARCH_DIRS diff --git a/build_files/cmake/Modules/FindIcuLinux.cmake b/build_files/cmake/Modules/FindIcuLinux.cmake index 2909a6c89dc..147ba7d072a 100644 --- a/build_files/cmake/Modules/FindIcuLinux.cmake +++ b/build_files/cmake/Modules/FindIcuLinux.cmake @@ -13,9 +13,13 @@ # also defined, but not for general use are # ICU_LIBRARY_xxx, where to find the icu libraries. -# If ICU_ROOT_DIR was defined in the environment, use it. -IF(NOT ICU_ROOT_DIR AND NOT $ENV{ICU_ROOT_DIR} STREQUAL "") +# If `ICU_ROOT_DIR` was defined in the environment, use it. +IF(DEFINED ICU_ROOT_DIR) + # Pass. +ELSEIF(DEFINED ENV{ICU_ROOT_DIR}) SET(ICU_ROOT_DIR $ENV{ICU_ROOT_DIR}) +ELSE() + SET(ICU_ROOT_DIR "") ENDIF() if(Boost_USE_STATIC_LIBS) diff --git a/build_files/cmake/Modules/FindJack.cmake b/build_files/cmake/Modules/FindJack.cmake index d9c523ba56d..3e5520f04fd 100644 --- a/build_files/cmake/Modules/FindJack.cmake +++ b/build_files/cmake/Modules/FindJack.cmake @@ -15,9 +15,13 @@ # also defined, but not for general use are # JACK_LIBRARY, where to find the JACK library. -# If JACK_ROOT_DIR was defined in the environment, use it. -IF(NOT JACK_ROOT_DIR AND NOT $ENV{JACK_ROOT_DIR} STREQUAL "") +# If `JACK_ROOT_DIR` was defined in the environment, use it. +IF(DEFINED JACK_ROOT_DIR) + # Pass. +ELSEIF(DEFINED ENV{JACK_ROOT_DIR}) SET(JACK_ROOT_DIR $ENV{JACK_ROOT_DIR}) +ELSE() + SET(JACK_ROOT_DIR "") ENDIF() SET(_jack_SEARCH_DIRS diff --git a/build_files/cmake/Modules/FindJeMalloc.cmake b/build_files/cmake/Modules/FindJeMalloc.cmake index 02ae9365e8f..59667defcdc 100644 --- a/build_files/cmake/Modules/FindJeMalloc.cmake +++ b/build_files/cmake/Modules/FindJeMalloc.cmake @@ -15,9 +15,13 @@ # also defined, but not for general use are # JEMALLOC_LIBRARY, where to find the JeMalloc library. -# If JEMALLOC_ROOT_DIR was defined in the environment, use it. -IF(NOT JEMALLOC_ROOT_DIR AND NOT $ENV{JEMALLOC_ROOT_DIR} STREQUAL "") +# If `JEMALLOC_ROOT_DIR` was defined in the environment, use it. +IF(DEFINED JEMALLOC_ROOT_DIR) + # Pass. +ELSEIF(DEFINED ENV{JEMALLOC_ROOT_DIR}) SET(JEMALLOC_ROOT_DIR $ENV{JEMALLOC_ROOT_DIR}) +ELSE() + SET(JEMALLOC_ROOT_DIR "") ENDIF() SET(_jemalloc_SEARCH_DIRS diff --git a/build_files/cmake/Modules/FindLZO.cmake b/build_files/cmake/Modules/FindLZO.cmake index 23e7ae19d3d..37585f8b86b 100644 --- a/build_files/cmake/Modules/FindLZO.cmake +++ b/build_files/cmake/Modules/FindLZO.cmake @@ -15,9 +15,13 @@ # also defined, but not for general use are # LZO_LIBRARY, where to find the LZO library. -# If LZO_ROOT_DIR was defined in the environment, use it. -IF(NOT LZO_ROOT_DIR AND NOT $ENV{LZO_ROOT_DIR} STREQUAL "") +# If `LZO_ROOT_DIR` was defined in the environment, use it. +IF(DEFINED LZO_ROOT_DIR) + # Pass. +ELSEIF(DEFINED ENV{LZO_ROOT_DIR}) SET(LZO_ROOT_DIR $ENV{LZO_ROOT_DIR}) +ELSE() + SET(LZO_ROOT_DIR "") ENDIF() SET(_lzo_SEARCH_DIRS diff --git a/build_files/cmake/Modules/FindMoltenVK.cmake b/build_files/cmake/Modules/FindMoltenVK.cmake index 313fd989a52..38e5604ec25 100644 --- a/build_files/cmake/Modules/FindMoltenVK.cmake +++ b/build_files/cmake/Modules/FindMoltenVK.cmake @@ -13,9 +13,13 @@ # MOLTENVK_FOUND, If false, do not try to use MoltenVK. # -# If MOLTENVK_ROOT_DIR was defined in the environment, use it. -IF(NOT MOLTENVK_ROOT_DIR AND NOT $ENV{MOLTENVK_ROOT_DIR} STREQUAL "") +# If `MOLTENVK_ROOT_DIR` was defined in the environment, use it. +IF(DEFINED MOLTENVK_ROOT_DIR) + # Pass. +ELSEIF(DEFINED ENV{MOLTENVK_ROOT_DIR}) SET(MOLTENVK_ROOT_DIR $ENV{MOLTENVK_ROOT_DIR}) +ELSE() + SET(MOLTENVK_ROOT_DIR "") ENDIF() SET(_moltenvk_SEARCH_DIRS diff --git a/build_files/cmake/Modules/FindNanoVDB.cmake b/build_files/cmake/Modules/FindNanoVDB.cmake index 773e4ae58bd..f55356a5ff5 100644 --- a/build_files/cmake/Modules/FindNanoVDB.cmake +++ b/build_files/cmake/Modules/FindNanoVDB.cmake @@ -11,9 +11,13 @@ # This can also be an environment variable. # NANOVDB_FOUND, If false, do not try to use NanoVDB. -# If NANOVDB_ROOT_DIR was defined in the environment, use it. -IF(NOT NANOVDB_ROOT_DIR AND NOT $ENV{NANOVDB_ROOT_DIR} STREQUAL "") +# If `NANOVDB_ROOT_DIR` was defined in the environment, use it. +IF(DEFINED NANOVDB_ROOT_DIR) + # Pass. +ELSEIF(DEFINED ENV{NANOVDB_ROOT_DIR}) SET(NANOVDB_ROOT_DIR $ENV{NANOVDB_ROOT_DIR}) +ELSE() + SET(NANOVDB_ROOT_DIR "") ENDIF() SET(_nanovdb_SEARCH_DIRS diff --git a/build_files/cmake/Modules/FindOSL.cmake b/build_files/cmake/Modules/FindOSL.cmake index f51c617946c..df1482fac2d 100644 --- a/build_files/cmake/Modules/FindOSL.cmake +++ b/build_files/cmake/Modules/FindOSL.cmake @@ -15,9 +15,13 @@ # OSL_LIBRARY_VERSION_MAJOR, OSL_LIBRARY_VERSION_MINOR, the major # and minor versions of OSL library if found. -# If OSL_ROOT_DIR was defined in the environment, use it. -IF(NOT OSL_ROOT_DIR AND NOT $ENV{OSL_ROOT_DIR} STREQUAL "") +# If `OSL_ROOT_DIR` was defined in the environment, use it. +IF(DEFINED OSL_ROOT_DIR) + # Pass. +ELSEIF(DEFINED ENV{OSL_ROOT_DIR}) SET(OSL_ROOT_DIR $ENV{OSL_ROOT_DIR}) +ELSE() + SET(OSL_ROOT_DIR "") ENDIF() SET(_osl_FIND_COMPONENTS diff --git a/build_files/cmake/Modules/FindOpenCOLLADA.cmake b/build_files/cmake/Modules/FindOpenCOLLADA.cmake index bbc3e0a095e..fb522fdc64f 100644 --- a/build_files/cmake/Modules/FindOpenCOLLADA.cmake +++ b/build_files/cmake/Modules/FindOpenCOLLADA.cmake @@ -20,9 +20,13 @@ # Where '/opt/opencollada' is the base dir: # /opt/opencollada/COLLADABaseUtils/include/COLLADABUPlatform.h -# If OPENCOLLADA_ROOT_DIR was defined in the environment, use it. -IF(NOT OPENCOLLADA_ROOT_DIR AND NOT $ENV{OPENCOLLADA_ROOT_DIR} STREQUAL "") +# If `OPENCOLLADA_ROOT_DIR` was defined in the environment, use it. +IF(DEFINED OPENCOLLADA_ROOT_DIR) + # Pass. +ELSEIF(DEFINED ENV{OPENCOLLADA_ROOT_DIR}) SET(OPENCOLLADA_ROOT_DIR $ENV{OPENCOLLADA_ROOT_DIR}) +ELSE() + SET(OPENCOLLADA_ROOT_DIR "") ENDIF() SET(_opencollada_FIND_INCLUDES diff --git a/build_files/cmake/Modules/FindOpenColorIO.cmake b/build_files/cmake/Modules/FindOpenColorIO.cmake index ab0a33a8cc9..492d723ce60 100644 --- a/build_files/cmake/Modules/FindOpenColorIO.cmake +++ b/build_files/cmake/Modules/FindOpenColorIO.cmake @@ -15,9 +15,13 @@ # also defined, but not for general use are # OPENCOLORIO_LIBRARY, where to find the OpenColorIO library. -# If OPENCOLORIO_ROOT_DIR was defined in the environment, use it. -IF(NOT OPENCOLORIO_ROOT_DIR AND NOT $ENV{OPENCOLORIO_ROOT_DIR} STREQUAL "") +# If `OPENCOLORIO_ROOT_DIR` was defined in the environment, use it. +IF(DEFINED OPENCOLORIO_ROOT_DIR) + # Pass. +ELSEIF(DEFINED ENV{OPENCOLORIO_ROOT_DIR}) SET(OPENCOLORIO_ROOT_DIR $ENV{OPENCOLORIO_ROOT_DIR}) +ELSE() + SET(OPENCOLORIO_ROOT_DIR "") ENDIF() SET(_opencolorio_FIND_COMPONENTS diff --git a/build_files/cmake/Modules/FindOpenEXR.cmake b/build_files/cmake/Modules/FindOpenEXR.cmake index 60fd64621f1..3e53e3c1ab7 100644 --- a/build_files/cmake/Modules/FindOpenEXR.cmake +++ b/build_files/cmake/Modules/FindOpenEXR.cmake @@ -22,9 +22,13 @@ # also defined, but not for general use are # OPENEXR_LIBRARY, where to find the OpenEXR library. -# If OPENEXR_ROOT_DIR was defined in the environment, use it. -IF(NOT OPENEXR_ROOT_DIR AND NOT $ENV{OPENEXR_ROOT_DIR} STREQUAL "") +# If `OPENEXR_ROOT_DIR` was defined in the environment, use it. +IF(DEFINED OPENEXR_ROOT_DIR) + # Pass. +ELSEIF(DEFINED ENV{OPENEXR_ROOT_DIR}) SET(OPENEXR_ROOT_DIR $ENV{OPENEXR_ROOT_DIR}) +ELSE() + SET(OPENEXR_ROOT_DIR "") ENDIF() # Old versions (before 2.0?) do not have any version string, diff --git a/build_files/cmake/Modules/FindOpenImageDenoise.cmake b/build_files/cmake/Modules/FindOpenImageDenoise.cmake index 9b8479e6416..5b439920036 100644 --- a/build_files/cmake/Modules/FindOpenImageDenoise.cmake +++ b/build_files/cmake/Modules/FindOpenImageDenoise.cmake @@ -15,9 +15,13 @@ # also defined, but not for general use are # OPENIMAGEDENOISE_LIBRARY, where to find the OpenImageDenoise library. -# If OPENIMAGEDENOISE_ROOT_DIR was defined in the environment, use it. -IF(NOT OPENIMAGEDENOISE_ROOT_DIR AND NOT $ENV{OPENIMAGEDENOISE_ROOT_DIR} STREQUAL "") +# If `OPENIMAGEDENOISE_ROOT_DIR` was defined in the environment, use it. +IF(DEFINED OPENIMAGEDENOISE_ROOT_DIR) + # Pass. +ELSEIF(DEFINED ENV{OPENIMAGEDENOISE_ROOT_DIR}) SET(OPENIMAGEDENOISE_ROOT_DIR $ENV{OPENIMAGEDENOISE_ROOT_DIR}) +ELSE() + SET(OPENIMAGEDENOISE_ROOT_DIR "") ENDIF() SET(_openimagedenoise_SEARCH_DIRS diff --git a/build_files/cmake/Modules/FindOpenImageIO.cmake b/build_files/cmake/Modules/FindOpenImageIO.cmake index 367343bc3c5..1bddfb02d36 100644 --- a/build_files/cmake/Modules/FindOpenImageIO.cmake +++ b/build_files/cmake/Modules/FindOpenImageIO.cmake @@ -17,9 +17,13 @@ # also defined, but not for general use are # OPENIMAGEIO_LIBRARY, where to find the OpenImageIO library. -# If OPENIMAGEIO_ROOT_DIR was defined in the environment, use it. -IF(NOT OPENIMAGEIO_ROOT_DIR AND NOT $ENV{OPENIMAGEIO_ROOT_DIR} STREQUAL "") +# If `OPENIMAGEIO_ROOT_DIR` was defined in the environment, use it. +IF(DEFINED OPENIMAGEIO_ROOT_DIR) + # Pass. +ELSEIF(DEFINED ENV{OPENIMAGEIO_ROOT_DIR}) SET(OPENIMAGEIO_ROOT_DIR $ENV{OPENIMAGEIO_ROOT_DIR}) +ELSE() + SET(OPENIMAGEIO_ROOT_DIR "") ENDIF() SET(_openimageio_SEARCH_DIRS diff --git a/build_files/cmake/Modules/FindOpenJPEG.cmake b/build_files/cmake/Modules/FindOpenJPEG.cmake index 4f457b2ed40..9c6ce3c73d7 100644 --- a/build_files/cmake/Modules/FindOpenJPEG.cmake +++ b/build_files/cmake/Modules/FindOpenJPEG.cmake @@ -15,9 +15,13 @@ # also defined, but not for general use are # OPENJPEG_LIBRARY, where to find the OpenJPEG library. -# If OPENJPEG_ROOT_DIR was defined in the environment, use it. -IF(NOT OPENJPEG_ROOT_DIR AND NOT $ENV{OPENJPEG_ROOT_DIR} STREQUAL "") +# If `OPENJPEG_ROOT_DIR` was defined in the environment, use it. +IF(DEFINED OPENJPEG_ROOT_DIR) + # Pass. +ELSEIF(DEFINED ENV{OPENJPEG_ROOT_DIR}) SET(OPENJPEG_ROOT_DIR $ENV{OPENJPEG_ROOT_DIR}) +ELSE() + SET(OPENJPEG_ROOT_DIR "") ENDIF() SET(_openjpeg_SEARCH_DIRS diff --git a/build_files/cmake/Modules/FindOpenSubdiv.cmake b/build_files/cmake/Modules/FindOpenSubdiv.cmake index 13adac351a0..490941a5a68 100644 --- a/build_files/cmake/Modules/FindOpenSubdiv.cmake +++ b/build_files/cmake/Modules/FindOpenSubdiv.cmake @@ -12,9 +12,13 @@ # This can also be an environment variable. # OPENSUBDIV_FOUND, if false, do not try to use OpenSubdiv. -# If OPENSUBDIV_ROOT_DIR was defined in the environment, use it. -IF(NOT OPENSUBDIV_ROOT_DIR AND NOT $ENV{OPENSUBDIV_ROOT_DIR} STREQUAL "") +# If `OPENSUBDIV_ROOT_DIR` was defined in the environment, use it. +IF(DEFINED OPENSUBDIV_ROOT_DIR) + # Pass. +ELSEIF(DEFINED ENV{OPENSUBDIV_ROOT_DIR}) SET(OPENSUBDIV_ROOT_DIR $ENV{OPENSUBDIV_ROOT_DIR}) +ELSE() + SET(OPENSUBDIV_ROOT_DIR "") ENDIF() SET(_opensubdiv_FIND_COMPONENTS diff --git a/build_files/cmake/Modules/FindOpenVDB.cmake b/build_files/cmake/Modules/FindOpenVDB.cmake index 2fa97a0a1dd..caa4287ddfd 100644 --- a/build_files/cmake/Modules/FindOpenVDB.cmake +++ b/build_files/cmake/Modules/FindOpenVDB.cmake @@ -15,9 +15,13 @@ # also defined, but not for general use are # OPENVDB_LIBRARY, where to find the OPENVDB library. -# If OPENVDB_ROOT_DIR was defined in the environment, use it. -IF(NOT OPENVDB_ROOT_DIR AND NOT $ENV{OPENVDB_ROOT_DIR} STREQUAL "") +# If `OPENVDB_ROOT_DIR` was defined in the environment, use it. +IF(DEFINED OPENVDB_ROOT_DIR) + # Pass. +ELSEIF(DEFINED ENV{OPENVDB_ROOT_DIR}) SET(OPENVDB_ROOT_DIR $ENV{OPENVDB_ROOT_DIR}) +ELSE() + SET(OPENVDB_ROOT_DIR "") ENDIF() SET(_openvdb_SEARCH_DIRS diff --git a/build_files/cmake/Modules/FindOptiX.cmake b/build_files/cmake/Modules/FindOptiX.cmake index d184f16ff57..a8457659698 100644 --- a/build_files/cmake/Modules/FindOptiX.cmake +++ b/build_files/cmake/Modules/FindOptiX.cmake @@ -11,9 +11,13 @@ # This can also be an environment variable. # OPTIX_FOUND, If false, do not try to use OptiX. -# If OPTIX_ROOT_DIR was defined in the environment, use it. -IF(NOT OPTIX_ROOT_DIR AND NOT $ENV{OPTIX_ROOT_DIR} STREQUAL "") +# If `OPTIX_ROOT_DIR` was defined in the environment, use it. +IF(DEFINED OPTIX_ROOT_DIR) + # Pass. +ELSEIF(DEFINED ENV{OPTIX_ROOT_DIR}) SET(OPTIX_ROOT_DIR $ENV{OPTIX_ROOT_DIR}) +ELSE() + SET(OPTIX_ROOT_DIR "") ENDIF() SET(_optix_SEARCH_DIRS diff --git a/build_files/cmake/Modules/FindPCRE.cmake b/build_files/cmake/Modules/FindPCRE.cmake index 718bd7fd337..5003344ef44 100644 --- a/build_files/cmake/Modules/FindPCRE.cmake +++ b/build_files/cmake/Modules/FindPCRE.cmake @@ -15,9 +15,13 @@ # also defined, but not for general use are # PCRE_LIBRARY, where to find the PCRE library. -# If PCRE_ROOT_DIR was defined in the environment, use it. -IF(NOT PCRE_ROOT_DIR AND NOT $ENV{PCRE_ROOT_DIR} STREQUAL "") +# If `PCRE_ROOT_DIR` was defined in the environment, use it. +IF(DEFINED PCRE_ROOT_DIR) + # Pass. +ELSEIF(DEFINED ENV{PCRE_ROOT_DIR}) SET(PCRE_ROOT_DIR $ENV{PCRE_ROOT_DIR}) +ELSE() + SET(PCRE_ROOT_DIR "") ENDIF() SET(_pcre_SEARCH_DIRS diff --git a/build_files/cmake/Modules/FindPotrace.cmake b/build_files/cmake/Modules/FindPotrace.cmake index 89110bc5af9..534564a0451 100644 --- a/build_files/cmake/Modules/FindPotrace.cmake +++ b/build_files/cmake/Modules/FindPotrace.cmake @@ -15,9 +15,13 @@ # also defined, but not for general use are # POTRACE_LIBRARY, where to find the POTRACE library. -# If POTRACE_ROOT_DIR was defined in the environment, use it. -IF(NOT POTRACE_ROOT_DIR AND NOT $ENV{POTRACE_ROOT_DIR} STREQUAL "") +# If `POTRACE_ROOT_DIR` was defined in the environment, use it. +IF(DEFINED POTRACE_ROOT_DIR) + # Pass. +ELSEIF(DEFINED ENV{POTRACE_ROOT_DIR}) SET(POTRACE_ROOT_DIR $ENV{POTRACE_ROOT_DIR}) +ELSE() + SET(POTRACE_ROOT_DIR "") ENDIF() SET(_potrace_SEARCH_DIRS diff --git a/build_files/cmake/Modules/FindPugiXML.cmake b/build_files/cmake/Modules/FindPugiXML.cmake index 42d2008691f..54df2c2761b 100644 --- a/build_files/cmake/Modules/FindPugiXML.cmake +++ b/build_files/cmake/Modules/FindPugiXML.cmake @@ -15,9 +15,13 @@ # also defined, but not for general use are # PUGIXML_LIBRARY, where to find the PugiXML library. -# If PUGIXML_ROOT_DIR was defined in the environment, use it. -IF(NOT PUGIXML_ROOT_DIR AND NOT $ENV{PUGIXML_ROOT_DIR} STREQUAL "") +# If `PUGIXML_ROOT_DIR` was defined in the environment, use it. +IF(DEFINED PUGIXML_ROOT_DIR) + # Pass. +ELSEIF(DEFINED ENV{PUGIXML_ROOT_DIR}) SET(PUGIXML_ROOT_DIR $ENV{PUGIXML_ROOT_DIR}) +ELSE() + SET(PUGIXML_ROOT_DIR "") ENDIF() SET(_pugixml_SEARCH_DIRS diff --git a/build_files/cmake/Modules/FindPulse.cmake b/build_files/cmake/Modules/FindPulse.cmake index 17792f226b7..12837f4b85c 100644 --- a/build_files/cmake/Modules/FindPulse.cmake +++ b/build_files/cmake/Modules/FindPulse.cmake @@ -15,9 +15,13 @@ # also defined, but not for general use are # LIBPULSE_LIBRARY, where to find the PulseAudio library. -# If LIBPULSE_ROOT_DIR was defined in the environment, use it. -IF(NOT LIBPULSE_ROOT_DIR AND NOT $ENV{LIBPULSE_ROOT_DIR} STREQUAL "") +# If `LIBPULSE_ROOT_DIR` was defined in the environment, use it. +IF(DEFINED LIBPULSE_ROOT_DIR) + # Pass. +ELSEIF(DEFINED ENV{LIBPULSE_ROOT_DIR}) SET(LIBPULSE_ROOT_DIR $ENV{LIBPULSE_ROOT_DIR}) +ELSE() + SET(LIBPULSE_ROOT_DIR "") ENDIF() SET(_pulse_SEARCH_DIRS diff --git a/build_files/cmake/Modules/FindPythonLibsUnix.cmake b/build_files/cmake/Modules/FindPythonLibsUnix.cmake index 0f2baabbefb..74958bda67e 100644 --- a/build_files/cmake/Modules/FindPythonLibsUnix.cmake +++ b/build_files/cmake/Modules/FindPythonLibsUnix.cmake @@ -27,9 +27,13 @@ # also defined, but not for general use are # PYTHON_LIBRARY, where to find the python library. -# If PYTHON_ROOT_DIR was defined in the environment, use it. -IF(NOT PYTHON_ROOT_DIR AND NOT $ENV{PYTHON_ROOT_DIR} STREQUAL "") +# If `PYTHON_ROOT_DIR` was defined in the environment, use it. +IF(DEFINED PYTHON_ROOT_DIR) + # Pass. +ELSEIF(DEFINED ENV{PYTHON_ROOT_DIR}) SET(PYTHON_ROOT_DIR $ENV{PYTHON_ROOT_DIR}) +ELSE() + SET(PYTHON_ROOT_DIR "") ENDIF() SET(_PYTHON_VERSION_SUPPORTED 3.10) diff --git a/build_files/cmake/Modules/FindSDL2.cmake b/build_files/cmake/Modules/FindSDL2.cmake index 8315064e66c..b5ba9465df3 100644 --- a/build_files/cmake/Modules/FindSDL2.cmake +++ b/build_files/cmake/Modules/FindSDL2.cmake @@ -14,9 +14,13 @@ # also defined, but not for general use are # SDL2_LIBRARY, where to find the SDL library. -# If SDL2_ROOT_DIR was defined in the environment, use it. -IF(NOT SDL2_ROOT_DIR AND NOT $ENV{SDL2_ROOT_DIR} STREQUAL "") +# If `SDL2_ROOT_DIR` was defined in the environment, use it. +IF(DEFINED SDL2_ROOT_DIR) + # Pass. +ELSEIF(DEFINED ENV{SDL2_ROOT_DIR}) SET(SDL2_ROOT_DIR $ENV{SDL2_ROOT_DIR}) +ELSE() + SET(SDL2_ROOT_DIR "") ENDIF() SET(_sdl2_SEARCH_DIRS diff --git a/build_files/cmake/Modules/FindShaderC.cmake b/build_files/cmake/Modules/FindShaderC.cmake index 16c4fb9102c..423df16f106 100644 --- a/build_files/cmake/Modules/FindShaderC.cmake +++ b/build_files/cmake/Modules/FindShaderC.cmake @@ -13,9 +13,13 @@ # SHADERC_FOUND, If false, do not try to use ShaderC. # -# If SHADERC_ROOT_DIR was defined in the environment, use it. -IF(NOT SHADERC_ROOT_DIR AND NOT $ENV{SHADERC_ROOT_DIR} STREQUAL "") +# If `SHADERC_ROOT_DIR` was defined in the environment, use it. +IF(DEFINED SHADERC_ROOT_DIR) + # Pass. +ELSEIF(DEFINED ENV{SHADERC_ROOT_DIR}) SET(SHADERC_ROOT_DIR $ENV{SHADERC_ROOT_DIR}) +ELSE() + SET(SHADERC_ROOT_DIR "") ENDIF() SET(_shaderc_SEARCH_DIRS diff --git a/build_files/cmake/Modules/FindSndFile.cmake b/build_files/cmake/Modules/FindSndFile.cmake index b4f334d9395..6077b41c745 100644 --- a/build_files/cmake/Modules/FindSndFile.cmake +++ b/build_files/cmake/Modules/FindSndFile.cmake @@ -15,9 +15,13 @@ # also defined, but not for general use are # LIBSNDFILE_LIBRARY, where to find the SndFile library. -# If LIBSNDFILE_ROOT_DIR was defined in the environment, use it. -IF(NOT LIBSNDFILE_ROOT_DIR AND NOT $ENV{LIBSNDFILE_ROOT_DIR} STREQUAL "") +# If `LIBSNDFILE_ROOT_DIR` was defined in the environment, use it. +IF(DEFINED LIBSNDFILE_ROOT_DIR) + # Pass. +ELSEIF(DEFINED ENV{LIBSNDFILE_ROOT_DIR}) SET(LIBSNDFILE_ROOT_DIR $ENV{LIBSNDFILE_ROOT_DIR}) +ELSE() + SET(LIBSNDFILE_ROOT_DIR "") ENDIF() SET(_sndfile_SEARCH_DIRS diff --git a/build_files/cmake/Modules/FindSpacenav.cmake b/build_files/cmake/Modules/FindSpacenav.cmake index 3959d2d3729..8676c516482 100644 --- a/build_files/cmake/Modules/FindSpacenav.cmake +++ b/build_files/cmake/Modules/FindSpacenav.cmake @@ -15,9 +15,13 @@ # also defined, but not for general use are # SPACENAV_LIBRARY, where to find the Spacenav library. -# If SPACENAV_ROOT_DIR was defined in the environment, use it. -IF(NOT SPACENAV_ROOT_DIR AND NOT $ENV{SPACENAV_ROOT_DIR} STREQUAL "") +# If `SPACENAV_ROOT_DIR` was defined in the environment, use it. +IF(DEFINED SPACENAV_ROOT_DIR) + # Pass. +ELSEIF(DEFINED ENV{SPACENAV_ROOT_DIR}) SET(SPACENAV_ROOT_DIR $ENV{SPACENAV_ROOT_DIR}) +ELSE() + SET(SPACENAV_ROOT_DIR "") ENDIF() SET(_spacenav_SEARCH_DIRS diff --git a/build_files/cmake/Modules/FindTBB.cmake b/build_files/cmake/Modules/FindTBB.cmake index 58b5a242567..5180393e351 100644 --- a/build_files/cmake/Modules/FindTBB.cmake +++ b/build_files/cmake/Modules/FindTBB.cmake @@ -15,9 +15,13 @@ # also defined, but not for general use are # TBB_LIBRARY, where to find the TBB library. -# If TBB_ROOT_DIR was defined in the environment, use it. -IF(NOT TBB_ROOT_DIR AND NOT $ENV{TBB_ROOT_DIR} STREQUAL "") +# If `TBB_ROOT_DIR` was defined in the environment, use it. +IF(DEFINED TBB_ROOT_DIR) + # Pass. +ELSEIF(DEFINED ENV{TBB_ROOT_DIR}) SET(TBB_ROOT_DIR $ENV{TBB_ROOT_DIR}) +ELSE() + SET(TBB_ROOT_DIR "") ENDIF() SET(_tbb_SEARCH_DIRS diff --git a/build_files/cmake/Modules/FindUSD.cmake b/build_files/cmake/Modules/FindUSD.cmake index 5a1733e9c4a..d17210632a4 100644 --- a/build_files/cmake/Modules/FindUSD.cmake +++ b/build_files/cmake/Modules/FindUSD.cmake @@ -13,9 +13,13 @@ # USD_FOUND, If false, do not try to use USD. # -# If USD_ROOT_DIR was defined in the environment, use it. -IF(NOT USD_ROOT_DIR AND NOT $ENV{USD_ROOT_DIR} STREQUAL "") +# If `USD_ROOT_DIR` was defined in the environment, use it. +IF(DEFINED USD_ROOT_DIR) + # Pass. +ELSEIF(DEFINED ENV{USD_ROOT_DIR}) SET(USD_ROOT_DIR $ENV{USD_ROOT_DIR}) +ELSE() + SET(USD_ROOT_DIR "") ENDIF() SET(_usd_SEARCH_DIRS diff --git a/build_files/cmake/Modules/FindVulkan.cmake b/build_files/cmake/Modules/FindVulkan.cmake index bd22d4580ce..135d4627978 100644 --- a/build_files/cmake/Modules/FindVulkan.cmake +++ b/build_files/cmake/Modules/FindVulkan.cmake @@ -13,9 +13,13 @@ # VULKAN_FOUND, If false, do not try to use Vulkan. # -# If VULKAN_ROOT_DIR was defined in the environment, use it. -IF(NOT VULKAN_ROOT_DIR AND NOT $ENV{VULKAN_ROOT_DIR} STREQUAL "") +# If `VULKAN_ROOT_DIR` was defined in the environment, use it. +IF(DEFINED VULKAN_ROOT_DIR) + # Pass. +ELSEIF(DEFINED ENV{VULKAN_ROOT_DIR}) SET(VULKAN_ROOT_DIR $ENV{VULKAN_ROOT_DIR}) +ELSE() + SET(VULKAN_ROOT_DIR "") ENDIF() SET(_vulkan_SEARCH_DIRS diff --git a/build_files/cmake/Modules/FindWebP.cmake b/build_files/cmake/Modules/FindWebP.cmake index 613aad3ec37..6ba346b85b3 100644 --- a/build_files/cmake/Modules/FindWebP.cmake +++ b/build_files/cmake/Modules/FindWebP.cmake @@ -14,9 +14,13 @@ # also defined, but not for general use are # WEBP_LIBRARY, where to find the WEBP library. -# If WEBP_ROOT_DIR was defined in the environment, use it. -IF(NOT WEBP_ROOT_DIR AND NOT $ENV{WEBP_ROOT_DIR} STREQUAL "") +# If `WEBP_ROOT_DIR` was defined in the environment, use it. +IF(DEFINED WEBP_ROOT_DIR) + # Pass. +ELSEIF(DEFINED ENV{WEBP_ROOT_DIR}) SET(WEBP_ROOT_DIR $ENV{WEBP_ROOT_DIR}) +ELSE() + SET(WEBP_ROOT_DIR "") ENDIF() SET(_webp_SEARCH_DIRS diff --git a/build_files/cmake/Modules/FindXML2.cmake b/build_files/cmake/Modules/FindXML2.cmake index 54eeab7cec9..4b936fc7ee9 100644 --- a/build_files/cmake/Modules/FindXML2.cmake +++ b/build_files/cmake/Modules/FindXML2.cmake @@ -15,9 +15,13 @@ # also defined, but not for general use are # XML2_LIBRARY, where to find the XML2 library. -# If XML2_ROOT_DIR was defined in the environment, use it. -IF(NOT XML2_ROOT_DIR AND NOT $ENV{XML2_ROOT_DIR} STREQUAL "") +# If `XML2_ROOT_DIR` was defined in the environment, use it. +IF(DEFINED XML2_ROOT_DIR) + # Pass. +ELSEIF(DEFINED ENV{XML2_ROOT_DIR}) SET(XML2_ROOT_DIR $ENV{XML2_ROOT_DIR}) +ELSE() + SET(XML2_ROOT_DIR "") ENDIF() SET(_xml2_SEARCH_DIRS diff --git a/build_files/cmake/Modules/FindXR_OpenXR_SDK.cmake b/build_files/cmake/Modules/FindXR_OpenXR_SDK.cmake index 9e46323c652..835aca95ad0 100644 --- a/build_files/cmake/Modules/FindXR_OpenXR_SDK.cmake +++ b/build_files/cmake/Modules/FindXR_OpenXR_SDK.cmake @@ -23,9 +23,13 @@ # also defined, but not for general use are # XR_OPENXR_SDK_LOADER_LIBRARY, where to find the OpenXR-SDK loader library. -# If XR_OPENXR_SDK_ROOT_DIR was defined in the environment, use it. -IF(NOT XR_OPENXR_SDK_ROOT_DIR AND NOT $ENV{XR_OPENXR_SDK_ROOT_DIR} STREQUAL "") +# If `XR_OPENXR_SDK_ROOT_DIR` was defined in the environment, use it. +IF(DEFINED XR_OPENXR_SDK_ROOT_DIR) + # Pass. +ELSEIF(DEFINED ENV{XR_OPENXR_SDK_ROOT_DIR}) SET(XR_OPENXR_SDK_ROOT_DIR $ENV{XR_OPENXR_SDK_ROOT_DIR}) +ELSE() + SET(XR_OPENXR_SDK_ROOT_DIR "") ENDIF() SET(_xr_openxr_sdk_SEARCH_DIRS diff --git a/build_files/cmake/Modules/FindZstd.cmake b/build_files/cmake/Modules/FindZstd.cmake index 5e73b7b5a15..53beb112b10 100644 --- a/build_files/cmake/Modules/FindZstd.cmake +++ b/build_files/cmake/Modules/FindZstd.cmake @@ -15,9 +15,13 @@ # also defined, but not for general use are # ZSTD_LIBRARY, where to find the Zstd library. -# If ZSTD_ROOT_DIR was defined in the environment, use it. -IF(NOT ZSTD_ROOT_DIR AND NOT $ENV{ZSTD_ROOT_DIR} STREQUAL "") +# If `ZSTD_ROOT_DIR` was defined in the environment, use it. +IF(DEFINED ZSTD_ROOT_DIR) + # Pass. +ELSEIF(DEFINED ENV{ZSTD_ROOT_DIR}) SET(ZSTD_ROOT_DIR $ENV{ZSTD_ROOT_DIR}) +ELSE() + SET(ZSTD_ROOT_DIR "") ENDIF() SET(_zstd_SEARCH_DIRS diff --git a/build_files/cmake/Modules/Findsse2neon.cmake b/build_files/cmake/Modules/Findsse2neon.cmake index fdb67019538..ae5ee3acedd 100644 --- a/build_files/cmake/Modules/Findsse2neon.cmake +++ b/build_files/cmake/Modules/Findsse2neon.cmake @@ -11,9 +11,13 @@ # This can also be an environment variable. # SSE2NEON_FOUND, If false, do not try to use sse2neon. -# If SSE2NEON_ROOT_DIR was defined in the environment, use it. -IF(NOT SSE2NEON_ROOT_DIR AND NOT $ENV{SSE2NEON_ROOT_DIR} STREQUAL "") +# If `SSE2NEON_ROOT_DIR` was defined in the environment, use it. +IF(DEFINED SSE2NEON_ROOT_DIR) + # Pass. +ELSEIF(DEFINED ENV{SSE2NEON_ROOT_DIR}) SET(SSE2NEON_ROOT_DIR $ENV{SSE2NEON_ROOT_DIR}) +ELSE() + SET(SSE2NEON_ROOT_DIR "") ENDIF() SET(_sse2neon_SEARCH_DIRS