From: Matthew Fernandez Date: Sat, 5 Nov 2022 18:57:16 +0000 (-0700) Subject: CMake: only attempt NSIS discovery on Windows X-Git-Tag: 7.0.1~1^2~9 X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=3797d037da4c629df67723f29d21335d93272a3e;p=graphviz CMake: only attempt NSIS discovery on Windows When running CMake with `--warn-uninitialized -Werror=dev`, this prevents the following: CMake Error (dev) at cmake/FindNSIS.cmake:5 (find_program): uninitialized variable 'PROGRAMFILES' Call Stack (most recent call first): cmake/package_info.cmake:30 (find_package) CMakeLists.txt:242 (include) CMake Error (dev) at cmake/FindNSIS.cmake:5 (find_program): uninitialized variable 'ProgramFiles(x86)' Call Stack (most recent call first): cmake/package_info.cmake:30 (find_package) CMakeLists.txt:242 (include) Gitlab: #2291 --- diff --git a/cmake/package_info.cmake b/cmake/package_info.cmake index 070e83441..e1b2a7b17 100644 --- a/cmake/package_info.cmake +++ b/cmake/package_info.cmake @@ -27,7 +27,9 @@ elseif(UNIX) endif() endif() -find_package(NSIS) +if(WIN32) + find_package(NSIS) +endif() if(NSIS_FOUND) set(CPACK_NSIS_MUI_ICON "${CMAKE_SOURCE_DIR}/windows/build/Graphviz.ico") set(CPACK_NSIS_MUI_UNIICON "${CMAKE_SOURCE_DIR}/windows/build/Graphviz.ico")