make minja packagable by setting target in cmake#62
Conversation
|
Thanks for your pull request! It looks like this may be your first contribution to a Google open source project. Before we can look at your pull request, you'll need to sign a Contributor License Agreement (CLA). View this failed invocation of the CLA check for more information. For the most up to date status, view the checks section at the bottom of the pull request. |
|
CI fails in reading files, for example However, I have no idea how test can get these files in CI |
|
Can confirm your branch runs great locally 👌. CI needs a HuggingFace key and I haven't sorted out a setup that prevents leaking it yet, sorry about this. Looks like |
|
I missed testing install with test option. It turns out that googletest having So I put a line to disable this option. |
|
Also, as well as instruction |
|
Thanks a lot @jhlee525, merged!! |
* make minja packagable by setting target in cmake * preventing gtest install * Add cmake instruct in README
Functionality of the minja library works well, and I think it's a great library. But it lacks proper CMake packaging, which makes it difficult to integrate smoothly within other CMake-based projects.
This PR introduces the following changes:
Install Command
The
installcommand has been added so that running runningmake installwill let you put the header files into$CMAKE_INSTALL_PREFIX/include/minja.FetchContent Integration
A CMake target has been defined to support users who want to include minja using
FetchContent. This means other C++ projects to can import minja like this:FetchContent_Declare(minja URL "minja-url") FetchContent_MakeAvailable(minja)Currently, minja's CMake configuration requires a Python interpreter. For users who only need the header files, two options have been added: MINJA_TEST_ENABLED and MINJA_EXAMPLE_ENABLED. By disabling these options, users can skip unnecessary CMake steps and avoid the Python dependency when it is not needed.