cda-tum / mqt-qcec

MQT QCEC - A tool for Quantum Circuit Equivalence Checking
https://mqt.readthedocs.io/projects/qcec
MIT License
90 stars 21 forks source link

Recommendation use `FetchContent` instead of git module directly #302

Closed LecrisUT closed 7 months ago

LecrisUT commented 1 year ago
FetchContent_Declare(mqt-core
            GIT_REPOSITORY https://github.com/cda-tum/mqt-core
            GIT_TAG 1.11.1
            FIND_PACKAGE_ARGS REQUIRED
            )

This allows the user to switch between:

Note that the full syntax is only available in Cmake 3.24, but you can make a simple compatibility: example

Please link upstream to this issue as well

burgholzer commented 1 year ago

Many thanks for the suggestion! That seems like a convenient solution. Would I still keep the mqt-core submodule in that kind of setup?

Just out of curiosity: Let's say I want to try a development version of mqt-core (no git tag available). In the current setup, that is as easy changing the submodule commit. How would that work with FetchContent_Declare?

LecrisUT commented 1 year ago

Would I still keep the mqt-core submodule in that kind of setup?

Yes, I do recommend to keep the submodule as well. That would help with offline installations

Just out of curiosity: Let's say I want to try a development version of mqt-core (no git tag available). In the current setup, that is as easy changing the submodule commit. How would that work with FetchContent_Declare?

My workflow is to declare -DFETCHCONTENT_SOURCE_DIR_<uppercaseName>=/path/to/local/git/repo in these cases an point it to my local git repo (not the submodule).

burgholzer commented 7 months ago

Given that all of our core tools now rely on FetchContent over directly using the submodules, I believe this can be closed for now 🎉 Thanks @LecrisUT for the suggestion!