From b6f567e260c510cfe9e6e9b56babde1acf36d69f Mon Sep 17 00:00:00 2001 From: Laurent Rineau Date: Thu, 23 Jul 2009 15:02:02 +0000 Subject: [PATCH] add a new cmake variable in CGALConfig.cmake, so that one can detect if CGAL_ImageIO is build with ZLIB support. Use that variable in examples/Mesh_3/. --- CGALimageIO/src/CGALimageIO/CMakeLists.txt | 1 + Installation/cmake/modules/CGALConfig_binary.cmake.in | 1 + Installation/cmake/modules/CGALConfig_install.cmake.fhs.in | 1 + .../cmake/modules/CGALConfig_install.cmake.source.in | 1 + Mesh_3/examples/Mesh_3/CMakeLists.txt | 6 +++++- 5 files changed, 9 insertions(+), 1 deletion(-) diff --git a/CGALimageIO/src/CGALimageIO/CMakeLists.txt b/CGALimageIO/src/CGALimageIO/CMakeLists.txt index a1f7dcb3a6b..d48a50b929e 100644 --- a/CGALimageIO/src/CGALimageIO/CMakeLists.txt +++ b/CGALimageIO/src/CGALimageIO/CMakeLists.txt @@ -38,6 +38,7 @@ if(OPENGL_FOUND) cache_set(CGAL_ImageIO_3RD_PARTY_INCLUDE_DIRS ${CGAL_ImageIO_3RD_PARTY_INCLUDE_DIRS} ${ZLIB_INCLUDE_DIR} ) cache_set(CGAL_ImageIO_3RD_PARTY_LIBRARIES ${CGAL_ImageIO_3RD_PARTY_LIBRARIES} ${ZLIB_LIBRARY} ) cache_set(CGAL_ImageIO_3RD_PARTY_DEFINITIONS "-DCGAL_USE_ZLIB") + cache_set(CGAL_ImageIO_USE_ZLIB "ON") endif(ZLIB_FOUND) set( CGAL_ImageIO_BASENAME CGAL_ImageIO ) diff --git a/Installation/cmake/modules/CGALConfig_binary.cmake.in b/Installation/cmake/modules/CGALConfig_binary.cmake.in index d9deaaec1c6..3d64e7ce2d7 100644 --- a/Installation/cmake/modules/CGALConfig_binary.cmake.in +++ b/Installation/cmake/modules/CGALConfig_binary.cmake.in @@ -60,6 +60,7 @@ set(CGAL_ImageIO_3RD_PARTY_INCLUDE_DIRS "@CGAL_ImageIO_3RD_PARTY_INCLUDE_DIRS@ set(CGAL_ImageIO_3RD_PARTY_DEFINITIONS "@CGAL_ImageIO_3RD_PARTY_DEFINITIONS@" ) set(CGAL_ImageIO_3RD_PARTY_LIBRARIES_DIRS "@CGAL_ImageIO_3RD_PARTY_LIBRARIES_DIRS@" ) set(CGAL_ImageIO_3RD_PARTY_LIBRARIES "@CGAL_ImageIO_3RD_PARTY_LIBRARIES@" ) +set(CGAL_ImageIO_USE_ZLIB "@CGAL_ImageIO_USE_ZLIB@" ) set(CGAL_PDB_3RD_PARTY_INCLUDE_DIRS "@CGAL_PDB_3RD_PARTY_INCLUDE_DIRS@" ) set(CGAL_PDB_3RD_PARTY_DEFINITIONS "@CGAL_PDB_3RD_PARTY_DEFINITIONS@" ) diff --git a/Installation/cmake/modules/CGALConfig_install.cmake.fhs.in b/Installation/cmake/modules/CGALConfig_install.cmake.fhs.in index a20baf1216d..4a993539d5d 100644 --- a/Installation/cmake/modules/CGALConfig_install.cmake.fhs.in +++ b/Installation/cmake/modules/CGALConfig_install.cmake.fhs.in @@ -62,6 +62,7 @@ set(CGAL_ImageIO_3RD_PARTY_INCLUDE_DIRS "@CGAL_ImageIO_3RD_PARTY_INCLUDE_DIRS@ set(CGAL_ImageIO_3RD_PARTY_DEFINITIONS "@CGAL_ImageIO_3RD_PARTY_DEFINITIONS@" ) set(CGAL_ImageIO_3RD_PARTY_LIBRARIES_DIRS "@CGAL_ImageIO_3RD_PARTY_LIBRARIES_DIRS@" ) set(CGAL_ImageIO_3RD_PARTY_LIBRARIES "@CGAL_ImageIO_3RD_PARTY_LIBRARIES@" ) +set(CGAL_ImageIO_USE_ZLIB "@CGAL_ImageIO_USE_ZLIB@" ) set(CGAL_PDB_3RD_PARTY_INCLUDE_DIRS "@CGAL_PDB_3RD_PARTY_INCLUDE_DIRS@" ) set(CGAL_PDB_3RD_PARTY_DEFINITIONS "@CGAL_PDB_3RD_PARTY_DEFINITIONS@" ) diff --git a/Installation/cmake/modules/CGALConfig_install.cmake.source.in b/Installation/cmake/modules/CGALConfig_install.cmake.source.in index 9772b706633..b642e7e48e5 100644 --- a/Installation/cmake/modules/CGALConfig_install.cmake.source.in +++ b/Installation/cmake/modules/CGALConfig_install.cmake.source.in @@ -60,6 +60,7 @@ set(CGAL_ImageIO_3RD_PARTY_INCLUDE_DIRS "@CGAL_ImageIO_3RD_PARTY_INCLUDE_DIRS@ set(CGAL_ImageIO_3RD_PARTY_DEFINITIONS "@CGAL_ImageIO_3RD_PARTY_DEFINITIONS@" ) set(CGAL_ImageIO_3RD_PARTY_LIBRARIES_DIRS "@CGAL_ImageIO_3RD_PARTY_LIBRARIES_DIRS@" ) set(CGAL_ImageIO_3RD_PARTY_LIBRARIES "@CGAL_ImageIO_3RD_PARTY_LIBRARIES@" ) +set(CGAL_ImageIO_USE_ZLIB "@CGAL_ImageIO_USE_ZLIB@" ) set(CGAL_PDB_3RD_PARTY_INCLUDE_DIRS "@CGAL_PDB_3RD_PARTY_INCLUDE_DIRS@" ) set(CGAL_PDB_3RD_PARTY_DEFINITIONS "@CGAL_PDB_3RD_PARTY_DEFINITIONS@" ) diff --git a/Mesh_3/examples/Mesh_3/CMakeLists.txt b/Mesh_3/examples/Mesh_3/CMakeLists.txt index 6927e091093..5dc81b48a10 100644 --- a/Mesh_3/examples/Mesh_3/CMakeLists.txt +++ b/Mesh_3/examples/Mesh_3/CMakeLists.txt @@ -25,7 +25,11 @@ if ( CGAL_FOUND ) # Compilable examples create_single_source_cgal_program( "mesh_implicit_sphere.cpp" ) # create_single_source_cgal_program( "mesh_implicit_domains.cpp" "implicit_functions.cpp" ) - create_single_source_cgal_program( "mesh_3D_image.cpp" ) + if( CGAL_ImageIO_USE_ZLIB ) + create_single_source_cgal_program( "mesh_3D_image.cpp" ) + else() + message( STATUS "NOTICE: The example mesh_3D_image.cpp needs CGAL_ImageIO to be configured with ZLIB support, and will not be compiled." ) + endif() create_single_source_cgal_program( "mesh_polyhedral_domain.cpp" ) # create_single_source_cgal_program( "mesh_polyhedral_implicit_function.cpp" ) # create_single_source_cgal_program( "mesh_polyhedral_surface_tolerance_region.cpp" )