diff --git a/CMakeLists.txt b/CMakeLists.txt index 8c7760395..633bcd89e 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -34,6 +34,12 @@ message(VERBOSE "* ${PROJECT_NAME} v${PROJECT_VERSION} (${CMAKE_BUILD_TYPE})") message(VERBOSE "* Copyright (c) 2017-2022 Michele Caini ") message(VERBOSE "*") +# +# CMake stuff +# + +list(INSERT CMAKE_MODULE_PATH 0 ${CMAKE_CURRENT_SOURCE_DIR}/cmake/modules) + # # Compiler stuff # @@ -218,8 +224,12 @@ endif() # Install pkg-config file # +include(JoinPaths) + set(EnTT_PKGCONFIG ${CMAKE_CURRENT_BINARY_DIR}/entt.pc) +join_paths(EnTT_PKGCONFIG_INCLUDEDIR "\${prefix}" "${CMAKE_INSTALL_INCLUDEDIR}") + configure_file( ${EnTT_SOURCE_DIR}/cmake/in/entt.pc.in ${EnTT_PKGCONFIG} diff --git a/cmake/in/entt.pc.in b/cmake/in/entt.pc.in index d751ed06b..c4df5198c 100644 --- a/cmake/in/entt.pc.in +++ b/cmake/in/entt.pc.in @@ -1,5 +1,5 @@ prefix=@CMAKE_INSTALL_PREFIX@ -includedir=${prefix}/@CMAKE_INSTALL_INCLUDEDIR@ +includedir=@EnTT_PKGCONFIG_INCLUDEDIR@ Name: EnTT Description: Gaming meets modern C++