--- CMakeLists.txt.orig	2023-04-13 21:53:27.000000000 +0800
+++ CMakeLists.txt	2023-07-11 16:04:40.000000000 +0800
@@ -8,7 +8,7 @@
   LANGUAGES NONE)
 
 if (CMAKE_INSTALL_PREFIX_INITIALIZED_TO_DEFAULT)
-  set (CMAKE_INSTALL_PREFIX "${CMAKE_BINARY_DIR}/installed" CACHE PATH "..." FORCE)
+  set (CMAKE_INSTALL_PREFIX "@PREFIX@" CACHE PATH "..." FORCE)
   message("-- Setting default install prefix to ${CMAKE_INSTALL_PREFIX}.")
   message("   Override with -DCMAKE_INSTALL_PREFIX=<path>.")
 endif ()
@@ -69,8 +69,8 @@
 
 # The following is needed for external projects using *nix make when
 # parent project builds GFTL as a subproject.
-set (top_dir "GFTL-${GFTL_VERSION_MAJOR}.${GFTL_VERSION_MINOR}")
-set (GFTL_TOP_DIR "${CMAKE_INSTALL_PREFIX}/${top_dir}" CACHE PATH "")
+set (top_dir "GFTL")
+set (GFTL_TOP_DIR "${CMAKE_INSTALL_PREFIX}/include/${top_dir}" CACHE PATH "")
 
 include(CMakePackageConfigHelpers)
 configure_package_config_file(cmake/GFTLConfig.cmake.in GFTLConfig.cmake
@@ -83,21 +83,20 @@
 
 install (
   FILES  ${CMAKE_CURRENT_BINARY_DIR}/GFTLConfig.cmake ${CMAKE_CURRENT_BINARY_DIR}/GFTLConfig-version.cmake
-  DESTINATION ${top_dir}/cmake
+  DESTINATION "${CMAKE_INSTALL_PREFIX}/lib/cmake"
   )
 
 configure_file(cmake/GFTL.mk.in ${CMAKE_CURRENT_BINARY_DIR}/GFTL.mk @ONLY)
 install (
   FILES ${CMAKE_CURRENT_BINARY_DIR}/GFTL.mk 
-  DESTINATION "${top_dir}/include"
+  DESTINATION "${GFTL_TOP_DIR}"
   )
 
 install(EXPORT GFTL FILE GFTLTargets.cmake
   NAMESPACE GFTL::
-  DESTINATION "${top_dir}/cmake"
+  DESTINATION "${CMAKE_INSTALL_PREFIX}/lib/cmake"
   )
 export(EXPORT GFTL
   FILE "${CMAKE_CURRENT_BINARY_DIR}/GFTLTargets.cmake"
   NAMESPACE GFTL::
   )
-

--- cmake/GFTL.mk.in.orig	2023-04-13 21:53:27.000000000 +0800
+++ cmake/GFTL.mk.in	2023-07-11 15:35:40.000000000 +0800
@@ -1,12 +1,10 @@
 # Include file for external  projects using Unix Make instead of cmake.
 
 GFTL_INSTALL_PREFIX := @CMAKE_INSTALL_PREFIX@
-GFTL_VERSION := @GFTL_VERSION_MAJOR@.@GFTL_VERSION_MINOR@
-GFTL_TOP_DIR = $(GFTL_INSTALL_PREFIX)/GFTL-$(GFTL_VERSION)
+GFTL_TOP_DIR = $(GFTL_INSTALL_PREFIX)/include/GFTL
 
-GFTL_INCLUDE_DIR   := $(GFTL_TOP_DIR)/include/v1
-GFTL_V1_INCLUDE_DIR := $(GFTL_TOP_DIR)/include/v1
-GFTL_V2_INCLUDE_DIR := $(GFTL_TOP_DIR)/include/v2
+GFTL_INCLUDE_DIR    := $(GFTL_TOP_DIR)/v1
+GFTL_V1_INCLUDE_DIR := $(GFTL_TOP_DIR)/v1
+GFTL_V2_INCLUDE_DIR := $(GFTL_TOP_DIR)/v2
 
 GFTL_LIBRARIES := # none
-

--- include/v1/CMakeLists.txt.orig	2023-04-13 21:53:27.000000000 +0800
+++ include/v1/CMakeLists.txt	2023-07-11 15:43:26.000000000 +0800
@@ -4,12 +4,11 @@
 add_library (GFTL::gftl-v1 ALIAS gftl-v1)
 add_library (GFTL::gftl ALIAS gftl)
 
-
-set (dest "GFTL-${GFTL_VERSION_MAJOR}.${GFTL_VERSION_MINOR}")
+set (dest "include/GFTL")
 
 target_include_directories (gftl-v1 INTERFACE
   $<BUILD_INTERFACE:${CMAKE_CURRENT_BINARY_DIR}> # for headers when building
-  $<INSTALL_INTERFACE:${dest}/include/v1>           # for client in install mode
+  $<INSTALL_INTERFACE:${dest}/v1>                # for client in install mode
   )
 
 find_program (M4 m4)
@@ -23,6 +22,4 @@
 add_custom_target (force-generation-of-includes ALL)
 add_dependencies (force-generation-of-includes gftl-v1)
 
-install (TARGETS gftl-v1 gftl EXPORT GFTL DESTINATION "${dest}/include/v1")
-
-
+install (TARGETS gftl-v1 gftl EXPORT GFTL DESTINATION "${dest}/v1")

--- include/v2/CMakeLists.txt.orig	2023-04-13 21:53:27.000000000 +0800
+++ include/v2/CMakeLists.txt	2023-07-11 15:44:41.000000000 +0800
@@ -1,12 +1,12 @@
 add_library (gftl-v2 INTERFACE)
 add_library (GFTL::gftl-v2 ALIAS gftl-v2)
 
-set (dest "GFTL-${GFTL_VERSION_MAJOR}.${GFTL_VERSION_MINOR}")
+set (dest "include/GFTL")
 
 target_include_directories (gftl-v2 INTERFACE
   $<BUILD_INTERFACE:${CMAKE_CURRENT_BINARY_DIR}> # for headers when building
   $<BUILD_INTERFACE:${CMAKE_CURRENT_SOURCE_DIR}>
-  $<INSTALL_INTERFACE:${dest}/include/v2>           # for client in install mode
+  $<INSTALL_INTERFACE:${dest}/v2>                # for client in install mode
   )
 
 # Union of parameters across all supported
@@ -27,10 +27,10 @@
 add_subdirectory(parameters)
 
 foreach (template ptr pair vector deque queue stack set map ordered_map algorithms)
-  install (DIRECTORY ${CMAKE_CURRENT_SOURCE_DIR}/${template} DESTINATION "${dest}/include/v2"
+  install (DIRECTORY ${CMAKE_CURRENT_SOURCE_DIR}/${template} DESTINATION "${dest}/v2"
     PATTERN CMakeLists.txt EXCLUDE
     PATTERN *~ EXCLUDE
     )
 endforeach ()
 
-install (TARGETS gftl-v2 EXPORT GFTL DESTINATION "${dest}/include/v2")
+install (TARGETS gftl-v2 EXPORT GFTL DESTINATION "${dest}/v2")

--- include/v2/shared/CMakeLists.txt.orig	2023-04-13 21:53:27.000000000 +0800
+++ include/v2/shared/CMakeLists.txt	2023-07-11 16:42:19.000000000 +0800
@@ -1,4 +1,4 @@
-install (DIRECTORY ${CMAKE_CURRENT_SOURCE_DIR}/ DESTINATION "${dest}/include/v2/shared"
+install (DIRECTORY ${CMAKE_CURRENT_SOURCE_DIR}/ DESTINATION "${dest}/v2/shared"
   PATTERN *.inc
   PATTERN CMakeLists.txt EXCLUDE
   )

--- include/v1/types/CMakeLists.txt.orig	2023-04-13 21:53:27.000000000 +0800
+++ include/v1/types/CMakeLists.txt	2023-07-11 17:06:19.000000000 +0800
@@ -62,7 +62,7 @@
   )
 add_dependencies (gftl-v1 generate-type-incs)
 
-install (DIRECTORY ${CMAKE_CURRENT_BINARY_DIR}/ DESTINATION "${dest}/include/v1/types"
+install (DIRECTORY ${CMAKE_CURRENT_BINARY_DIR}/ DESTINATION "${dest}/v1/types"
   FILES_MATCHING PATTERN "*.inc"
   PATTERN CMakeFiles EXCLUDE
   PATTERN "*Foo*" EXCLUDE

--- include/v1/templates/CMakeLists.txt.orig	2023-04-13 21:53:27.000000000 +0800
+++ include/v1/templates/CMakeLists.txt	2023-07-11 17:06:46.000000000 +0800
@@ -45,7 +45,7 @@
 
 file (COPY DIRECTORY . DESTINATION . FILES_MATCHING PATTERN "*.inc")
 
-install (DIRECTORY ${CMAKE_CURRENT_BINARY_DIR}/ DESTINATION "${dest}/include/v1/templates"
+install (DIRECTORY ${CMAKE_CURRENT_BINARY_DIR}/ DESTINATION "${dest}/v1/templates"
   FILES_MATCHING PATTERN "*.inc"
   PATTERN CMakeFiles EXCLUDE
   )

--- include/v2/examples/CMakeLists.txt.orig	2023-04-13 21:53:27.000000000 +0800
+++ include/v2/examples/CMakeLists.txt	2023-07-11 17:05:49.000000000 +0800
@@ -57,7 +57,7 @@
 
 endforeach()
 
-install (DIRECTORY ${CMAKE_CURRENT_BINARY_DIR}/ DESTINATION "${dest}/include/examples"
+install (DIRECTORY ${CMAKE_CURRENT_BINARY_DIR}/ DESTINATION "${dest}/examples"
   FILES_MATCHING PATTERN "*.inc"
   PATTERN CMakeFiles EXCLUDE
   )

--- include/v2/generated/CMakeLists.txt.orig	2023-04-13 21:53:27.000000000 +0800
+++ include/v2/generated/CMakeLists.txt	2023-07-11 17:04:51.000000000 +0800
@@ -37,7 +37,7 @@
 add_custom_target(m4_generated_includes ALL DEPENDS ${generated_incs})
 add_dependencies(gftl m4_generated_includes)
 
-install (DIRECTORY ${CMAKE_CURRENT_BINARY_DIR}/ DESTINATION "${dest}/include/generated"
+install (DIRECTORY ${CMAKE_CURRENT_BINARY_DIR}/ DESTINATION "${dest}/generated"
   FILES_MATCHING PATTERN "*.inc"
   PATTERN CMakeFiles EXCLUDE
   )

--- include/v2/parameters/CMakeLists.txt.orig	2023-04-13 21:53:27.000000000 +0800
+++ include/v2/parameters/CMakeLists.txt	2023-07-11 17:03:48.000000000 +0800
@@ -120,12 +120,11 @@
 
 add_subdirectory(tests EXCLUDE_FROM_ALL)
 
-
 add_custom_target(m4_type_includes ALL DEPENDS ${type_incs})
 add_dependencies(gftl-v2 m4_type_includes)
 
 foreach (parameter ${template_parameters})
-  install (DIRECTORY ${CMAKE_CURRENT_BINARY_DIR}/${parameter} DESTINATION "${dest}/include/v2/parameters"
+  install (DIRECTORY ${CMAKE_CURRENT_BINARY_DIR}/${parameter} DESTINATION "${dest}/v2/parameters"
     FILES_MATCHING PATTERN "*.inc"
     PATTERN CMakeFiles EXCLUDE
     )
