From 00383a9b251bd3d09b1b5aba29a2734f5b19ab7e 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 | 9 +++++++++ version.h.in | 23 +++++++++++++++++++++++ 2 files changed, 32 insertions(+) create mode 100644 version.h.in diff --git a/CMakeLists.txt b/CMakeLists.txt index 268a4d3a4..397d26d5f 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -421,6 +421,15 @@ 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..520fcba19 --- /dev/null +++ b/version.h.in @@ -0,0 +1,23 @@ +// 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 +#ifndef MANIFOLD_VERSION_H_ +#define MANIFOLD_VERSION_H_ + +#define MANIFOLD_VERSION_MAJOR @MANIFOLD_VERSION_MAJOR@ +#define MANIFOLD_VERSION_MINOR @MANIFOLD_VERSION_MINOR@ +#define MANIFOLD_VERSION_PATH @MANIFOLD_VERSION_PATCH@ + +#endif // MANIFOLD_VERSION_H_