when building SITK using superbuild on windows10-64 I keep ending up with dynamic libs no matter what I do. I tried editing all cmakelists files to set shared libs to 0 but that did not do anuting. I added a line in the top most cmakelists.txt file (set BUILD_SHARED_LIBS 0) which should have applied that key in a global manner, still did not work. Not sure how to force a static libs buil.
@blowekamp is the best person to help with this. But he might be on vacation right now. Maybe @zivy or @dchen can help.
Hello jsemeda!
What are you trying to build? A C++ library to use in a project or a wrapped language? Specifics with your goals would help assist you. Also what source code are you using? Did you download a distribution? use git and are on main, or tagged release?
With most wrapped languages the module is loaded at run type, so the wrapped language module must be a shared library. However the SimpleITK core libraries default to being static.
You should not be editing the CMakeLists.txt files.
You can use the CMake GUI to modify configuration settings. Here is a guide:
Thanks for the reply. I downloaded the code with git to build a C++ static linked libraries for SimpleITK core libs. Not using wrapped languages. I did follow the windows build instructions from the docs.
I use cmake-gui, I did uncheck the build shared libs box. I used the SuperBuild, loading the cmakelists.cmake from that folder. All this did not make any difference and still getting DLLs.
I’ve done a Windows build, using cmake-gui for a Superbuild, and I did not create any DLL files.
Here’s what my cmake-gui config looked like:
And here are the .lib files that the build created:
PS C:\sitk-build\SimpleITK-build\lib\Release> ls
Directory: C:\sitk-build\SimpleITK-build\lib\Release
Mode LastWriteTime Length Name
-a---- 9/8/2026 3:04 PM 180282 SimpleITKBasicFilters0.lib
-a---- 9/8/2026 4:30 PM 128526 SimpleITKBasicFilters1.lib
-a---- 9/8/2026 3:04 PM 173991758 SimpleITKCommon.lib
-a---- 9/8/2026 3:07 PM 103769440 SimpleITKIO.lib
-a---- 9/8/2026 3:12 PM 88093262 SimpleITKRegistration.lib
-a---- 9/8/2026 3:12 PM 6912002 SimpleITK_ITKAnisotropicSmoothing.lib
-a---- 9/8/2026 3:12 PM 9427528 SimpleITK_ITKAntiAlias.lib
-a---- 9/8/2026 3:13 PM 29436022 SimpleITK_ITKBiasCorrection.lib
-a---- 9/8/2026 3:16 PM 117310886 SimpleITK_ITKBinaryMathematicalMorphology.lib
-a---- 9/8/2026 3:16 PM 28302336 SimpleITK_ITKClassifiers.lib
-a---- 9/8/2026 3:16 PM 7955022 SimpleITK_ITKColormap.lib
-a---- 9/8/2026 3:09 PM 154091314 SimpleITK_ITKCommon.lib
-a---- 9/8/2026 3:17 PM 61187066 SimpleITK_ITKConnectedComponents.lib
-a---- 9/8/2026 3:19 PM 94579080 SimpleITK_ITKConvolution.lib
-a---- 9/8/2026 3:19 PM 12548460 SimpleITK_ITKCurvatureFlow.lib
-a---- 9/8/2026 3:22 PM 137266582 SimpleITK_ITKDeconvolution.lib
-a---- 9/8/2026 3:23 PM 39336978 SimpleITK_ITKDenoising.lib
-a---- 9/8/2026 3:24 PM 39633826 SimpleITK_ITKDisplacementField.lib
-a---- 9/8/2026 3:25 PM 47532516 SimpleITK_ITKDistanceMap.lib
-a---- 9/8/2026 3:26 PM 24754614 SimpleITK_ITKFastMarching.lib
-a---- 9/8/2026 3:26 PM 21281652 SimpleITK_ITKFFT.lib
-a---- 9/8/2026 3:27 PM 33456188 SimpleITK_ITKImageCompare.lib
-a---- 9/8/2026 3:28 PM 28436062 SimpleITK_ITKImageCompose.lib
-a---- 9/8/2026 3:30 PM 91187382 SimpleITK_ITKImageFeature.lib
-a---- 9/8/2026 3:31 PM 57538998 SimpleITK_ITKImageFilterBase.lib
-a---- 9/8/2026 3:31 PM 2133980 SimpleITK_ITKImageFunction.lib
-a---- 9/8/2026 3:33 PM 105380470 SimpleITK_ITKImageFusion.lib
-a---- 9/8/2026 3:33 PM 31706680 SimpleITK_ITKImageGradient.lib
-a---- 9/8/2026 3:40 PM 346680630 SimpleITK_ITKImageGrid.lib
-a---- 9/8/2026 3:50 PM 561793588 SimpleITK_ITKImageIntensity.lib
-a---- 9/8/2026 3:50 PM 25116444 SimpleITK_ITKImageLabel.lib
-a---- 9/8/2026 3:51 PM 50067204 SimpleITK_ITKImageNoise.lib
-a---- 9/8/2026 3:52 PM 20302886 SimpleITK_ITKImageSources.lib
-a---- 9/8/2026 3:55 PM 213442348 SimpleITK_ITKImageStatistics.lib
-a---- 9/8/2026 4:01 PM 254199156 SimpleITK_ITKLabelMap.lib
-a---- 9/8/2026 4:02 PM 31961708 SimpleITK_ITKLabelVoting.lib
-a---- 9/8/2026 4:04 PM 66593158 SimpleITK_ITKLevelSets.lib
-a---- 9/8/2026 4:15 PM 484812652 SimpleITK_ITKMathematicalMorphology.lib
-a---- 9/8/2026 4:17 PM 17905788 SimpleITK_ITKPath.lib
-a---- 9/8/2026 4:17 PM 77100054 SimpleITK_ITKPDEDeformableRegistration.lib
-a---- 9/8/2026 4:18 PM 36786204 SimpleITK_ITKRegionGrowing.lib
-a---- 9/8/2026 4:20 PM 64577966 SimpleITK_ITKRegistrationCommon.lib
-a---- 9/8/2026 4:21 PM 59443074 SimpleITK_ITKReview.lib
-a---- 9/8/2026 4:23 PM 110245250 SimpleITK_ITKSmoothing.lib
-a---- 9/8/2026 4:24 PM 36509212 SimpleITK_ITKSuperPixel.lib
-a---- 9/8/2026 4:27 PM 170009458 SimpleITK_ITKThresholding.lib
-a---- 9/8/2026 4:27 PM 16482344 SimpleITK_ITKTransform.lib
-a---- 9/8/2026 4:29 PM 67539620 SimpleITK_ITKWatersheds.lib
-a---- 9/8/2026 4:29 PM 10819524 SimpleITK_LabelErodeDilate.lib
-a---- 9/8/2026 4:30 PM 21101586 SimpleITK_SimpleITKFilters.lib
Thanks for the reply, but this created dynamic release libs not static release ones like I was looking for. I tried adding /MT to the release flags and /MTd to the debug flags but this did not change anything, still getting dynamic release libs
