Skip to content

Conversation

@hovhannest
Copy link
Contributor

The path for compile_commands.json is hardcoded to CMAKE_BINARY_DIR. In case of building it as a standalone project the CMAKE_CURRENT_BINARY_DIR and CMAKE_BINARY_DIR are the same, but in case of building with CPM, or other ways where it is in some subdirectory, it will create the compile_commands.json in the CMAKE_BINARY_DIR, and try to copy it from CMAKE_CURRENT_BINARY_DIR, and it will fail.

https://github.com/Kitware/CMake/blob/572f3105c1a011854c29d7764d5c89312c0c8932/Source/cmGlobalNinjaGenerator.cxx#L1219

@hovhannest
Copy link
Contributor Author

hovhannest commented Nov 16, 2023

We can use CPM like this

CPMAddPackage(
NAME aspl
GITHUB_REPOSITORY gavv/libASPL
GIT_TAG v3.0.0
VERSION 3.0.0
SOURCE_DIR ${CMAKE_CURRENT_SOURCE_DIR}/aspl
)

@gavv gavv merged commit 61ea640 into gavv:main May 3, 2024
@gavv
Copy link
Owner

gavv commented May 3, 2024

Thanks!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants