-
Notifications
You must be signed in to change notification settings - Fork 1.4k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
## Summary of Changes Following discussion #7525 I added the header `version_enforcer.h` In the general case, it has nothing to check. If the user includes his own fork of `version_enforcer.h` with a given number of CGAL version, then the check happens. ## Release Management * Affected package(s): Installation
- Loading branch information
Showing
2 changed files
with
54 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,53 @@ | ||
// Copyright (c) 2023 GeometryFactory. | ||
// All rights reserved. | ||
// | ||
// This file is part of CGAL (www.cgal.org) | ||
// | ||
// $URL$ | ||
// $Id$ | ||
// SPDX-License-Identifier: LGPL-3.0-or-later OR LicenseRef-Commercial | ||
// | ||
// Author(s) : - | ||
|
||
#ifndef CGAL_VERSION_CHECKER_H | ||
#define CGAL_VERSION_CHECKER_H | ||
|
||
#include <CGAL/version_macros.h> | ||
|
||
// All files including this header are meant to work with a given version of CGAL | ||
// When using forked headers, set the following macro to the version of CGAL | ||
// you want to use. | ||
|
||
//// Set the 3 following macros to the version of CGAL you want to use | ||
//#define CGAL_COMPATIBLE_VERSION_MAJOR 6 | ||
//#define CGAL_COMPATIBLE_VERSION_MINOR 0 | ||
//#define CGAL_COMPATIBLE_VERSION_PATCH 0 | ||
|
||
// Set the following macros to 1 to get a warning/an error | ||
// when using a possibly incompatible version of CGAL | ||
#define CGAL_VERSION_CHECKER_ERROR 0 | ||
#define CGAL_VERSION_CHECKER_WARNING 0 | ||
|
||
#define CGAL_COMPATIBLE_VERSION_STR CGAL_STR(CGAL_COMPATIBLE_VERSION_MAJOR) "." \ | ||
CGAL_STR(CGAL_COMPATIBLE_VERSION_MINOR) "." \ | ||
CGAL_STR(CGAL_COMPATIBLE_VERSION_PATCH) | ||
|
||
|
||
// Check that the version of CGAL used is the one expected | ||
#if CGAL_COMPATIBLE_VERSION_MAJOR != CGAL_VERSION_MAJOR \ | ||
|| CGAL_COMPATIBLE_VERSION_MINOR != CGAL_VERSION_MINOR \ | ||
|| CGAL_COMPATIBLE_VERSION_PATCH != CGAL_VERSION_PATCH | ||
|
||
#if CGAL_VERSION_CHECKER_WARNING || CGAL_VERSION_CHECKER_ERROR | ||
#pragma message("These headers are meant to be used with CGAL " CGAL_COMPATIBLE_VERSION_STR " only."\ | ||
" You are using CGAL version: " CGAL_STR(CGAL_VERSION) ".") | ||
|
||
#ifdef CGAL_VERSION_CHECKER_ERROR | ||
#error "Incompatible version of CGAL" | ||
#endif | ||
|
||
#endif | ||
|
||
#endif | ||
|
||
#endif // CGAL_VERSION_CHECKER_H |