Skip to content

Commit

Permalink
Generate and install a version header alongside manifold headers.
Browse files Browse the repository at this point in the history
  • Loading branch information
hzeller committed Nov 17, 2024
1 parent 7de71d4 commit 00383a9
Show file tree
Hide file tree
Showing 2 changed files with 32 additions and 0 deletions.
9 changes: 9 additions & 0 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -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")
Expand Down
23 changes: 23 additions & 0 deletions version.h.in
Original file line number Diff line number Diff line change
@@ -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_

0 comments on commit 00383a9

Please sign in to comment.