diff --git a/CMakeLists.txt b/CMakeLists.txt index 6fb54ada..2fdfd731 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -28,6 +28,17 @@ if (WIN32) ) endif () + +# ======================================================================== +# Windows build style control +# ======================================================================== + +if ( WIN32 ) + if ( NOT DEFINED OPENMESH_BUILD_SHARED ) + set( OPENMESH_BUILD_SHARED false CACHE BOOL "Build as shared library? (!!!Experimental Feature!!!) " ) + endif() +endif() + # ======================================================================== # Add bundle targets here # ======================================================================== diff --git a/src/OpenMesh/Core/CMakeLists.txt b/src/OpenMesh/Core/CMakeLists.txt index 4a1a83da..637ba8e8 100644 --- a/src/OpenMesh/Core/CMakeLists.txt +++ b/src/OpenMesh/Core/CMakeLists.txt @@ -36,8 +36,15 @@ endif() if (WIN32) - # OpenMesh has no dll exports so we have to build a static library on windows - acg_add_library (OpenMeshCore STATIC ${sources} ${headers}) + + if ( OPENMESH_BUILD_SHARED ) + # Experimental Feature!!!! + acg_add_library (OpenMeshCore SHARED ${sources} ${headers}) + else() + # OpenMesh has no dll exports so we have to build a static library on windows + acg_add_library (OpenMeshCore STATIC ${sources} ${headers}) + endif() + else () acg_add_library (OpenMeshCore SHAREDANDSTATIC ${sources} ${headers}) set_target_properties (OpenMeshCore PROPERTIES VERSION ${OPENMESH_VERSION_MAJOR}.${OPENMESH_VERSION_MINOR} diff --git a/src/OpenMesh/Tools/CMakeLists.txt b/src/OpenMesh/Tools/CMakeLists.txt index 4d2241ae..0f125c8e 100644 --- a/src/OpenMesh/Tools/CMakeLists.txt +++ b/src/OpenMesh/Tools/CMakeLists.txt @@ -36,8 +36,15 @@ endif() if (WIN32) - # OpenMesh has no dll exports so we have to build a static library on windows - acg_add_library (OpenMeshTools STATIC ${sources} ${headers}) + + if ( OPENMESH_BUILD_SHARED ) + # Experimental Feature!!!! + acg_add_library (OpenMeshTools SHARED ${sources} ${headers}) + else() + # OpenMesh has no dll exports so we have to build a static library on windows + acg_add_library (OpenMeshCore STATIC ${sources} ${headers}) + endif() + else () acg_add_library (OpenMeshTools SHAREDANDSTATIC ${sources} ${headers}) set_target_properties (OpenMeshTools PROPERTIES VERSION ${OPENMESH_VERSION_MAJOR}.${OPENMESH_VERSION_MINOR}