[Insight-developers] shared_libraries forced to OFF on win32 + MSVC ??

Alexandre GOUAILLARD agouaillard at gmail.com
Wed May 11 05:34:06 EDT 2011


dear all,

we were investigating today some linking errors on GDCM, just to
realize it seems that BUILD_SHARED_LIBS is forced to OFF on win32 +
MSVC, even if you choose to set it to on with ccmake, and if the
CMakeCaches shows it as ON.
in CMake/ITKPlatformSpecificChecks.cmake
line 52
"""
if(WIN32)
   if(CMAKE_COMPILER_IS_GNUCXX)
 ...
   else(CMAKE_COMPILER_IS_GNUCXX)
 ...
   set(BUILD_SHARED_LIBS OFF)   <<===== HERE
  endif(CMAKE_COMPILER_IS_GNUCXX)
endif(WIN32)
"""

Now, is there any reason for that? There is an ITK_BUILD_SHARED_LIBS
symbol that is getting defined, but a lot of the modules and
especially the submodules still use the main cmake's BUILD_SHARED_LIBS
symbol.

The bad news is that of course, setting things right and turning share
libs on makes the build explode (353 errors and counting). There will
be a lot of EXPORT and dependency checking to be done. But that s
another story.

Are we missing anything?

alex, drew and XR


More information about the Insight-developers mailing list