Skip to Content.
Sympa Menu

cgal-discuss - [cgal-discuss] Bug report + patch regarding CMake modules

Subject: CGAL users discussion list

List archive

[cgal-discuss] Bug report + patch regarding CMake modules


Chronological Thread 
  • From: Anthony Truchet <>
  • To:
  • Subject: [cgal-discuss] Bug report + patch regarding CMake modules
  • Date: Fri, 08 Mar 2013 14:33:36 +0100

Hello all,

I am using CGAL in another project build with CMake also.
The point is that I have to tweak slightly the compilation options and that CGAL's CMake kept on overwritting my CMAKE_CXX_FLAGS how ever I set the CGAL_DONT_OVERRIDE_CMAKE_FLAGS option.

Please find a patch proposal attached.

Best regards,
--
Anthony Truchet
http://www.logilab.fr/

PS : I submitted this here because I could find any way to submit a patch or pull request on the Forge...
# HG changeset patch
# User Anthony Truchet <>
# Date 1362748785 -3600
# Node ID aa7d3f00c6020281c801660173bf2009ba00f128
# Parent  63b5ad88878a82e142ee9ee85ca3372c570d98f9
Patch for making CGAL_DONT_OVERRIDE_CMAKE_FLAGS effective.

diff --git a/cmake/modules/CGAL_SetupFlags.cmake b/cmake/modules/CGAL_SetupFlags.cmake
--- a/cmake/modules/CGAL_SetupFlags.cmake
+++ b/cmake/modules/CGAL_SetupFlags.cmake
@@ -6,31 +6,38 @@ if ( NOT CGAL_SETUP_FLAGS_INCLUDED )
 # override the flags used to build the libraries
 #
 set( CGAL_DONT_OVERRIDE_CMAKE_FLAGS_DESCRIPTION
-     "Set this to TRUE if you want to define or modify any of CMAKE_*_FLAGS. When this is FALSE, all the CMAKE_*_FLAGS flags are overriden with the values used when building the CGAL libs. For CGAL_*_flags (used for ADDITIONAL flags) , there is no need to set this to TRUE." 
+     "Set this to TRUE if you want to define or modify any of CMAKE_*_FLAGS. When this is FALSE, all the CMAKE_*_FLAGS flags are overriden with the values used when building the CGAL libs. For CGAL_*_flags (used for ADDITIONAL flags) , there is no need to set this to TRUE."
    )
 
-option( CGAL_DONT_OVERRIDE_CMAKE_FLAGS 
-        ${CGAL_DONT_OVERRIDE_CMAKE_FLAGS_DESCRIPTION}
-        FALSE 
-      )
+if(CGAL_DONT_OVERRIDE_CMAKE_FLAGS)
+  option( CGAL_DONT_OVERRIDE_CMAKE_FLAGS
+    ${CGAL_DONT_OVERRIDE_CMAKE_FLAGS_DESCRIPTION}
+    ${CGAL_DONT_OVERRIDE_CMAKE_FLAGS}
+    )
+else(CGAL_DONT_OVERRIDE_CMAKE_FLAGS)
+  option( CGAL_DONT_OVERRIDE_CMAKE_FLAGS
+    ${CGAL_DONT_OVERRIDE_CMAKE_FLAGS_DESCRIPTION}
+    FALSE
+    )
+endif(CGAL_DONT_OVERRIDE_CMAKE_FLAGS)
 
 if ( CGAL_CONFIG_LOADED AND NOT CGAL_DONT_OVERRIDE_CMAKE_FLAGS )
 
   typed_cache_set ( STRING "Build type: Release or Debug" CMAKE_BUILD_TYPE "${CGAL_BUILD_TYPE_INIT}" )
 
   string( TOUPPER "${CMAKE_BUILD_TYPE}" CGAL_BUILD_TYPE_UPPER )
-  
+
   if ( CGAL_BUILD_SHARED_LIBS )
     set( CGAL_LINKER_FLAGS_TYPE SHARED )
   else()
     set( CGAL_LINKER_FLAGS_TYPE MODULE )
   endif()
-  
+
   typed_cache_set ( STRING "C++ compiler flags for both Release and Debug"   CMAKE_CXX_FLAGS                                 "${CGAL_CXX_FLAGS_INIT}"                                                       )
   typed_cache_set ( STRING "C++ compiler flags for ${CGAL_BUILD_TYPE_UPPER}" CMAKE_CXX_FLAGS_${CGAL_BUILD_TYPE_UPPER}        "${CGAL_CXX_FLAGS_${CGAL_BUILD_TYPE_UPPER}_INIT}"                              )
   typed_cache_set ( STRING "Linker flags for both Release and Debug"         CMAKE_EXE_LINKER_FLAGS                          "${CGAL_${CGAL_LINKER_FLAGS_TYPE}_LINKER_FLAGS_INIT}"                          )
   typed_cache_set ( STRING "Linker flags for ${CGAL_BUILD_TYPE_UPPER}"       CMAKE_EXE_LINKER_FLAGS_${CGAL_BUILD_TYPE_UPPER} "${CGAL_${CGAL_LINKER_FLAGS_TYPE}_LINKER_FLAGS_${CGAL_BUILD_TYPE_UPPER}_INIT}" )
-  
+
 endif()
 
 typed_cache_set( BOOL ${CGAL_DONT_OVERRIDE_CMAKE_FLAGS_DESCRIPTION} CGAL_DONT_OVERRIDE_CMAKE_FLAGS TRUE )


  • [cgal-discuss] Bug report + patch regarding CMake modules, Anthony Truchet, 03/08/2013

Archive powered by MHonArc 2.6.18.

Top of Page