Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add support for usage of Clarabel.cpp via add_subdirectory #46

Open
codeinred opened this issue Jun 6, 2024 · 0 comments
Open

Add support for usage of Clarabel.cpp via add_subdirectory #46

codeinred opened this issue Jun 6, 2024 · 0 comments

Comments

@codeinred
Copy link

A common pattern is to have C++ dependencies provisioned via git submodule. These dependencies can then be included via add_subdirectory, however this fails with Clarabel.cpp because Clarabel.cpp expects to be the top-level project:

if(CMAKE_BUILD_TYPE MATCHES Release)
   set(clarabel_c_build_flags "--release")
   set(clarabel_c_output_directory "${CMAKE_SOURCE_DIR}/rust_wrapper/target/release")
else()
    set(clarabel_c_build_flags "")
    set(clarabel_c_output_directory "${CMAKE_SOURCE_DIR}/rust_wrapper/target/debug")
endif()

If Clarabel.cpp is not the top-level project, it will fail to build, because directories like rust_wrapper won't be found.

codeinred added a commit to codeinred/Clarabel.cpp that referenced this issue Jun 6, 2024
This commit allows Clarabel.cpp to be consumed by other CMake projects
via a call to `add_subdirectory`:

```cmake

add_subdirectory(path/to/clarabel.cpp)
```

Other projects might have Clarabel.cpp as a git submodule, and this
makes it easier to do so.
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

No branches or pull requests

1 participant