Conan CMake-Build-Definition hinzufügen
English
Deutsch
Beim Erstellen einer Bibliothek mit Conan ist dies die Standard-conanfile.py-Definition für das Bauen mit CMake
conan_cmake_example.py
cmake = CMake(self)
cmake.configure(source_folder="hello")
cmake.build()Definitionen können einfach wie folgt hinzugefügt werden:
conan_cmake_definition.py
cmake.definitions["MY_FLAG"] = "1"Dies generiert -DMY_FLAG=1 beim Aufruf von CMake
Vollständiges Beispiel:
conan_cmake_full.py
cmake = CMake(self)
cmake.definitions["USE_SYSTEM_CPR"] = "1
cmake.configure(source_folder="elasticlient")"
cmake.build()Beachten, dass alle cmake.definitions-Aufrufe vor dem Aufruf von cmake.configure() hinzugefügt werden müssen
If this post helped you, please consider buying me a coffee or donating via PayPal to support research & publishing of new posts on TechOverflow