unable to build static libs

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.

1 Like

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:

2 Likes

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.