--- CMakeLists.txt.orig 2024-09-26 01:10:44.000000000 +0200 +++ CMakeLists.txt 2024-10-17 09:21:40.000000000 +0200 @@ -300,6 +300,10 @@ message(WARNING "ENABLE_OPT set but SPIR-V tools not found! Disabling SPIR-V optimization.") endif() set(ENABLE_OPT OFF) + else() + message(STATUS "XDEBUG Using external SPIRV-Tools") + message(STATUS "XDEBUG\n ENABLE_OPT=${ENABLE_OPT}\n ENABLE_HLSL=${ENABLE_HLSL}\n ENABLE_SPIRV=${ENABLE_SPIRV} + ENABLE_GLSLANG_BINARIES=${ENABLE_GLSLANG_BINARIES}\n GLSLANG_TESTS=${GLSLANG_TESTS}\n PROJECT_IS_TOP_LEVEL=${PROJECT_IS_TOP_LEVEL}") endif() else() if(ENABLE_OPT) @@ -397,4 +401,34 @@ DESTINATION "${CMAKE_INSTALL_LIBDIR}/cmake/${PROJECT_NAME}" ) + + # Generate a pkg-config file, so that software projects which use + # pkg-config to locate dependencies can find glslang + + # This template is filled-in by CMake's `configure_file(... @ONLY)`. + # The `@...@` are substituted by CMake's configure_file(), either + # from variables set in CMakeLists.txt or by CMake itself. + # (Based on: https://www.scivision.dev/cmake-generate-pkg-config/) + file(WRITE "${CMAKE_CURRENT_BINARY_DIR}/${PROJECT_NAME}.pc.in" [=[ +prefix="@CMAKE_INSTALL_PREFIX@" +exec_prefix="${prefix}" +libdir="${prefix}/lib" +includedir="${prefix}/@CMAKE_INSTALL_INCLUDEDIR@" + +Name: @PROJECT_NAME@ +Description: official reference compiler front end for the OpenGL ES and OpenGL shading languages +Version: @PROJECT_VERSION@ +Cflags: -I"${includedir}" +Libs: -L"${libdir}" -l@PROJECT_NAME@ + ]=]) + configure_file( + "${CMAKE_CURRENT_BINARY_DIR}/${PROJECT_NAME}.pc.in" + "${CMAKE_CURRENT_BINARY_DIR}/${PROJECT_NAME}.pc" + @ONLY) + install( + FILES + "${CMAKE_CURRENT_BINARY_DIR}/${PROJECT_NAME}.pc" + DESTINATION + "${CMAKE_INSTALL_LIBDIR}/pkgconfig" + ) endif(GLSLANG_ENABLE_INSTALL)