diff --git a/Installation/CMakeLists.txt b/Installation/CMakeLists.txt index 547b0745e2e..21a8e1624a3 100644 --- a/Installation/CMakeLists.txt +++ b/Installation/CMakeLists.txt @@ -35,6 +35,7 @@ endif() option(ENABLE_HEADER_ONLY "Enable the header only version of CGAL" OFF ) if (ENABLE_HEADER_ONLY) + set(ENABLE_HEADER_ONLY TRUE CACHE BOOL "Enable cgal header only" FORCE) add_definitions(-DCGAL_HEADER_ONLY) endif (ENABLE_HEADER_ONLY) diff --git a/Installation/cmake/modules/CGAL_Macros.cmake b/Installation/cmake/modules/CGAL_Macros.cmake index 28c810eb5a8..53d14abce17 100644 --- a/Installation/cmake/modules/CGAL_Macros.cmake +++ b/Installation/cmake/modules/CGAL_Macros.cmake @@ -456,6 +456,7 @@ if( NOT CGAL_MACROS_FILE_INCLUDED ) endforeach() + file( APPEND ${CMAKE_BINARY_DIR}/CGALConfig.cmake "set(ENABLE_HEADER_ONLY \"${ENABLE_HEADER_ONLY}\" CACHE BOOL \"Enable cgal header only\" FORCE)\n") endmacro() macro ( fetch_env_var VAR ) diff --git a/Installation/cmake/modules/UseCGAL.cmake b/Installation/cmake/modules/UseCGAL.cmake index a3e5236a3e3..2d0cb958a0f 100644 --- a/Installation/cmake/modules/UseCGAL.cmake +++ b/Installation/cmake/modules/UseCGAL.cmake @@ -56,5 +56,8 @@ if(NOT USE_CGAL_FILE_INCLUDED) link_directories ( ${CGAL_LIBRARIES_DIR} ${CGAL_3RD_PARTY_LIBRARIES_DIRS} ) link_libraries ( ${CGAL_LIBRARIES} ${CGAL_3RD_PARTY_LIBRARIES} ) + if (ENABLE_HEADER_ONLY) + add_definitions(-DCGAL_HEADER_ONLY) + endif() endif()