From 93ff825eb52533ab5e63a5e8aa30168cda87e86f Mon Sep 17 00:00:00 2001
From: Jaswant Panchumarti <jaswant.panchumarti@kitware.com>
Date: Thu, 7 Nov 2024 11:08:37 -0500
Subject: [PATCH] Expose option to build shared libs in root CMakeLists.txt

- fixes linker errors in windows CI and warnings on linux/mac.
- this line was previously in `vtkMobileDevices.cmake` and it executed on non-mobile devices. It was yanked in vtk/vtk!11510 which caused `BUILD_SHARED_LIBS` to never be set!
---
 CMakeLists.txt | 2 ++
 1 file changed, 2 insertions(+)

diff --git a/CMakeLists.txt b/CMakeLists.txt
index db75f02f9c8..964e18bd366 100644
--- a/CMakeLists.txt
+++ b/CMakeLists.txt
@@ -122,6 +122,8 @@ if (NOT CMAKE_INSTALL_QMLDIR)
     "${CMAKE_INSTALL_LIBDIR}/qml")
 endif ()
 
+# Choose static or shared libraries.
+option(BUILD_SHARED_LIBS "Build VTK with shared libraries." ON)
 set(VTK_BUILD_SHARED_LIBS ${BUILD_SHARED_LIBS})
 set(CMAKE_CXX_VISIBILITY_PRESET "hidden")
 set(CMAKE_VISIBILITY_INLINES_HIDDEN 1)
-- 
GitLab