You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
CMake: grunk/version.hpp is not found when grunk is used via FetchContent/add_subdirectory #306
The CMake build cannot be used for static builds, for Emscripten, or via FetchContent/add_subdirectory without workarounds.
Update: item 1 (static / BUILD_SHARED_LIBS) is withdrawn. A grunk::state must only be driven by one runtime, so two copies of grunk's code operating on one state are not allowed, and static linking is therefore deliberately not supported. Only item 2 remains.
1. Hard-coded SHARED: add_library(grunk SHARED ...), grunk_recipe and the plugin library are always shared ... (withdrawn, see above)
2. grunk/version.hpp is not found when grunk is a sub-project. It is generated into grunk's own binary dir (${CMAKE_CURRENT_BINARY_DIR} of grunk/), but the include directories use $<BUILD_INTERFACE:${CMAKE_BINARY_DIR}>. In a standalone build both are the same; with FetchContent_MakeAvailable(grunk) the compile fails:
grunk/recipe.hpp:15:10: fatal error: grunk/version.hpp: No such file or directory
${PROJECT_BINARY_DIR} would be correct. In addition grunk/grunk.hpp includes the bare "version.hpp", which needs <build>/grunk on the include path too.
Workaround we use: include_directories(${FETCHCONTENT_BASE_DIR}/grunk-build) before FetchContent_MakeAvailable(grunk), and for WebAssembly a hand-written target.
Environment: grunk main (8af34a7, 0.5.0), parametric 0.3.5, sol2 3.5.0, Lua 5.4.8, GCC 15.3 (conda-forge), Linux x86-64; WebAssembly: Emscripten 3.1.58.
(Found while building a prototype GUI/viewer on top of grunk.)
changed the title [-]CMake: libraries are hard-coded SHARED and grunk/version.hpp is not found when used via FetchContent/add_subdirectory[/-][+]CMake: grunk/version.hpp is not found when grunk is used via FetchContent/add_subdirectory[/+]on Oct 2, 2026
Activity
closes #306 with a no-fix: grunk needs to be linked dynamically. Adds…
[-]CMake: libraries are hard-coded SHARED and grunk/version.hpp is not found when used via FetchContent/add_subdirectory[/-][+]CMake: grunk/version.hpp is not found when grunk is used via FetchContent/add_subdirectory[/+]