From 49e5aefa8028ad3095c221d56e9ddef66a814d88 Mon Sep 17 00:00:00 2001 From: Henner Zeller Date: Sat, 16 Nov 2024 20:50:59 -0800 Subject: [PATCH] Generate and install a version header alongside manifold headers. --- CMakeLists.txt | 14 ++++++++++++++ version.h.in | 19 +++++++++++++++++++ 2 files changed, 33 insertions(+) create mode 100644 version.h.in diff --git a/CMakeLists.txt b/CMakeLists.txt index 268a4d3a4..daa2e482f 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -421,6 +421,20 @@ install( DESTINATION ${CMAKE_INSTALL_INCLUDEDIR}/manifold ) +configure_file( + version.h.in + ${CMAKE_CURRENT_BINARY_DIR}/include/manifold/version.h + @ONLY +) +set_source_files_properties( + include/manifold/version.h + PROPERTIES GENERATED TRUE +) +install( + FILES ${CMAKE_CURRENT_BINARY_DIR}/include/manifold/version.h + DESTINATION ${CMAKE_INSTALL_INCLUDEDIR}/manifold +) + # PkgConfig file if(MANIFOLD_CROSS_SECTION) set(TEMPLATE_OPTIONAL_CLIPPER "Clipper2") diff --git a/version.h.in b/version.h.in new file mode 100644 index 000000000..256ae36db --- /dev/null +++ b/version.h.in @@ -0,0 +1,19 @@ +// Copyright 2024 The Manifold Authors. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +#pragma once + +#define MANIFOLD_VERSION_MAJOR @MANIFOLD_VERSION_MAJOR@ +#define MANIFOLD_VERSION_MINOR @MANIFOLD_VERSION_MINOR@ +#define MANIFOLD_VERSION_PATH @MANIFOLD_VERSION_PATCH@