From aa00f78883b9ed9bc074f922b6b64d2085b46d0a Mon Sep 17 00:00:00 2001 From: Laurent Rineau Date: Thu, 6 Oct 2011 16:01:16 +0000 Subject: [PATCH] Also support the compilation of CGAL libraries as static libs, with MSVC. --- CGALimageIO/include/CGAL/ImageIO/export.h | 2 +- Core/include/CGAL/CORE/export.h | 2 +- GraphicsView/include/CGAL/Qt/export.h | 2 +- Installation/CMakeLists.txt | 1 + Installation/cmake/modules/CGAL_Common.cmake | 7 +++---- Installation/include/CGAL/export.h | 2 +- 6 files changed, 8 insertions(+), 8 deletions(-) diff --git a/CGALimageIO/include/CGAL/ImageIO/export.h b/CGALimageIO/include/CGAL/ImageIO/export.h index 59d5f3ad73d..65f7013e940 100755 --- a/CGALimageIO/include/CGAL/ImageIO/export.h +++ b/CGALimageIO/include/CGAL/ImageIO/export.h @@ -22,7 +22,7 @@ #include -#if defined(BOOST_MSVC) +#if defined(BOOST_MSVC) && defined(CGAL_BUILD_SHARED_LIB) #if defined(CGAL_ImageIO_EXPORTS) // add by CMake or in cpp files of the dll #define CGAL_IMAGEIO_EXPORT __declspec (dllexport) diff --git a/Core/include/CGAL/CORE/export.h b/Core/include/CGAL/CORE/export.h index d4910851e41..32808f96c81 100755 --- a/Core/include/CGAL/CORE/export.h +++ b/Core/include/CGAL/CORE/export.h @@ -42,7 +42,7 @@ #include -#if defined(BOOST_MSVC) && ( ! defined(CGAL_EXPORTS) ) +#if defined(BOOST_MSVC) && ( ! defined(CGAL_EXPORTS) ) && defined(CGAL_BUILD_SHARED_LIB) #if defined(CGAL_Core_EXPORTS) // add by CMake or in cpp files of the dll #define CGAL_CORE_EXPORT __declspec (dllexport) diff --git a/GraphicsView/include/CGAL/Qt/export.h b/GraphicsView/include/CGAL/Qt/export.h index 791108a5f71..6a5a7e202c1 100755 --- a/GraphicsView/include/CGAL/Qt/export.h +++ b/GraphicsView/include/CGAL/Qt/export.h @@ -21,7 +21,7 @@ #include -#if defined(BOOST_MSVC) +#if defined(BOOST_MSVC) && defined(CGAL_BUILD_SHARED_LIB) #if defined(CGAL_Qt4_EXPORTS) // add by CMake or in cpp files of the dll #define CGAL_QT4_EXPORT __declspec (dllexport) diff --git a/Installation/CMakeLists.txt b/Installation/CMakeLists.txt index 3538ddf4246..803a31d6d6c 100644 --- a/Installation/CMakeLists.txt +++ b/Installation/CMakeLists.txt @@ -483,6 +483,7 @@ add_config_flag( CGAL_USE_LEDA ) add_config_flag( CGAL_USE_MPFI ) add_config_flag( CGAL_USE_RS ) add_config_flag( CGAL_USE_NTL ) +add_config_flag( CGAL_BUILD_SHARED_LIB ) set(CGAL_USE_CORE ${CGAL_USE_GMP}) diff --git a/Installation/cmake/modules/CGAL_Common.cmake b/Installation/cmake/modules/CGAL_Common.cmake index 534c475a2f2..e6a9672047e 100644 --- a/Installation/cmake/modules/CGAL_Common.cmake +++ b/Installation/cmake/modules/CGAL_Common.cmake @@ -29,10 +29,9 @@ if( NOT CGAL_COMMON_FILE_INCLUDED ) set( CMAKE_2_6_3_OR_ABOVE FALSE ) endif() - if ( "${BUILD_SHARED_LIBS}" STREQUAL "" ) - set(BUILD_SHARED_LIBS ON) - endif() - + option(BUILD_SHARED_LIBS "Build shared libraries" ON) + set(CGAL_BUILD_SHARED_LIB ${BUILD_SHARED_LIBS}) + if ( CGAL_BUILDING_LIBS ) if ( BUILD_SHARED_LIBS ) message( STATUS "Building shared libraries" ) diff --git a/Installation/include/CGAL/export.h b/Installation/include/CGAL/export.h index 46561d9bc0f..fb13a88f8cb 100755 --- a/Installation/include/CGAL/export.h +++ b/Installation/include/CGAL/export.h @@ -22,7 +22,7 @@ #include -#if defined(BOOST_MSVC) +#if defined(BOOST_MSVC) && defined(CGAL_BUILD_SHARED_LIB) #if defined(CGAL_EXPORTS) // add by CMake or in cpp files of the dll #define CGAL_EXPORT __declspec (dllexport)