From b0c0afcb73c107fddddaf6d78047b732f2e0188e Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Lukas=20B=C3=B6ger?= Date: Thu, 27 May 2021 23:02:57 +0100 Subject: [PATCH] prefer configure_file over manual file(WRITE ...) --- CMakeLists.txt | 10 +--------- include/chibi/install.h.in | 5 +++++ 2 files changed, 6 insertions(+), 9 deletions(-) create mode 100644 include/chibi/install.h.in diff --git a/CMakeLists.txt b/CMakeLists.txt index 05313969..e2430869 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -260,15 +260,7 @@ set(default_module_path #"${CMAKE_INSTALL_PREFIX}/${thePrefix}${pathsep}${CMAKE_INSTALL_PREFIX}/bin" ) -file(MAKE_DIRECTORY ${CMAKE_CURRENT_BINARY_DIR}/include/chibi) - -file(WRITE - ${CMAKE_CURRENT_BINARY_DIR}/include/chibi/install.h - "#define sexp_so_extension \"${CMAKE_SHARED_LIBRARY_SUFFIX}\" -#define sexp_default_module_path \"${default_module_path}\" -#define sexp_platform \"${platform}\" -#define sexp_version \"\" -#define sexp_release_name \"${release}\"") +configure_file(include/chibi/install.h.in include/chibi/install.h) # # Testing diff --git a/include/chibi/install.h.in b/include/chibi/install.h.in new file mode 100644 index 00000000..a9ca5229 --- /dev/null +++ b/include/chibi/install.h.in @@ -0,0 +1,5 @@ +#define sexp_so_extension "@CMAKE_SHARED_LIBRARY_SUFFIX@" +#define sexp_default_module_path "@default_module_path@" +#define sexp_platform "@platform@" +#define sexp_version "@CMAKE_PROJECT_VERSION@" +#define sexp_release_name "@release@"