Hello, i want to setup ITK using cmake and Visual studio 2019 Community edition. I want to install ITK so that I can create code that can be compiled and create exe that contain all the needed libraries and be able to execute the exe file in each computer that may not have ITK installed. How can I do it?
When configuring ITK, make sure that BUILD_SHARED_LIBS is OFF. It should be OFF by default. Then compile your program normally - the executable should be big because it has needed parts of ITK embedded in it.
Normally, multiple configurations are compiled. I usually compile Debug and RelWithDebInfo. Static libraries work with all configurations.
Visual Studio’s limitation is that you cannot run Debug version of computers without Visual Studio installed on them, so you should compile in Release or RelWithDebInfo mode if you want to redistribute your program.
This means that as long as a PC has Visual Studio installed, it doesn’t matter whether the code that uses itk and itk itself are compiled in debug or release mode.
Use RelWithDebInfo configuration. It should have some debug symbols (some will be optimized away). But if there is no debugger on the target computer, why do debug symbols matter to you?