diff --git a/CMakeLists.txt b/CMakeLists.txt index 6fb54ada0e2000cdebf7218d894e559e8abab7a9..2fdfd731ffaa61ce0fef440492d289528727ce9c 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 4a1a83da9935582940f125a003092f1454f1789d..637ba8e846bcb070d49d6361bc73ca46c66874a4 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 4d2241ae38871a2031db8f8cb0bd27f8cb712cab..0f125c8e275c04646faa1df20a6f37d06e12d8b2 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}