Change version.h and libpistache.pc install source location to use CMAKE_CURRENT_BINARY_DIR instead of CMAKE_BINARY_DIR
envgap__pistacheio__pistache-559
01 / FAILURE SIGNATURE
As reported upstream
No identifying execution failure has been captured.
Not a benchmark task.
- The project already builds and runs before the fix, so there is nothing to repair.
02 / ENVIRONMENT RECIPE
- Base commit
4c0407e37639b240d3f9d8a376818c3f318f4c17- Manifest
CMakeLists.txt- Reproduce
Awaiting issue-specific recipe- Run under trace
Awaiting a meaningful runtime command
03 / ORIGINAL ISSUE TEXT
pistacheio/pistache #559 · read the original issue
I have developed a Conan recipe for Pistache and ran into a problem in a couple of places in the root `CMakeLists.txt`. For example:
```
# Install version header...
if(PISTACHE_INSTALL)
install (
FILES
${CMAKE_BINARY_DIR}/include/pistache/version.h
DESTINATION
${CMAKE_INSTALL_INCLUDEDIR}/pistache/
)
endif()
```
My Conan recipe `CMakeList.txt` includes the Pistache source directory like `include(pistache)`. When I `make install` using my `CMakeLists.txt` it can't find `version.h` or `libpistache.pc`. The fix is to change `CMAKE_BINARY_DIR` to `CMAKE_CURRENT_BINARY_DIR`, for example:
```
# Install version header...
if(PISTACHE_INSTALL)
install (
FILES
${CMAKE_CURRENT_BINARY_DIR}/include/pistache/version.h
DESTINATION
${CMAKE_INSTALL_INCLUDEDIR}/pistache/
)
endif()
```
This is a more flexible `CMakeLists.txt` for Pistache because it allows it to be included by parent CMake projects.04 / LABELS
Labels from the report text only; not yet run
No supported category has been assigned.
Label rules and the text that matched
[]