You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@celix.apache.org by pe...@apache.org on 2023/08/25 01:54:22 UTC

[celix] branch hotfix/clion-integration created (now cf69e331)

This is an automated email from the ASF dual-hosted git repository.

pengzheng pushed a change to branch hotfix/clion-integration
in repository https://gitbox.apache.org/repos/asf/celix.git


      at cf69e331 Make CLion's CMake Preset Integration work with Conan.

This branch includes the following new commits:

     new cf69e331 Make CLion's CMake Preset Integration work with Conan.

The 1 revisions listed above as "new" are entirely new to this
repository and will be described in separate emails.  The revisions
listed as "add" were already present in the repository and have only
been added to this reference.



[celix] 01/01: Make CLion's CMake Preset Integration work with Conan.

Posted by pe...@apache.org.
This is an automated email from the ASF dual-hosted git repository.

pengzheng pushed a commit to branch hotfix/clion-integration
in repository https://gitbox.apache.org/repos/asf/celix.git

commit cf69e331ea8e48e49776e135722aaa771c71933f
Author: PengZheng <ho...@gmail.com>
AuthorDate: Fri Aug 25 09:54:11 2023 +0800

    Make CLion's CMake Preset Integration work with Conan.
    
    https://youtrack.jetbrains.com/issue/CPP-34818
---
 conanfile.py                               | 11 +++++------
 documents/building/dev_celix_with_clion.md |  8 ++++----
 2 files changed, 9 insertions(+), 10 deletions(-)

diff --git a/conanfile.py b/conanfile.py
index 55f42b1f..e5e81efb 100644
--- a/conanfile.py
+++ b/conanfile.py
@@ -108,7 +108,7 @@ class CelixConan(ConanFile):
         "celix_err_buffer_size": ["ANY"],
     }
     default_options = {
-        "celix_err_buffer_size": 512,
+        "celix_err_buffer_size": "512",
     }
 
     for comp in _celix_defaults.keys():
@@ -414,7 +414,7 @@ class CelixConan(ConanFile):
             lst = [x.ref.name for x in self.requires.values()]
             if "mdnsresponder" in lst:
                 tc.cache_variables["BUILD_ERROR_INJECTOR_MDNSRESPONDER"] = "ON"
-        tc.cache_variables["CELIX_ERR_BUFFER_SIZE"] = self.options.celix_err_buffer_size
+        tc.cache_variables["CELIX_ERR_BUFFER_SIZE"] = str(self.options.celix_err_buffer_size)
         # tc.cache_variables["CMAKE_PROJECT_Celix_INCLUDE"] = os.path.join(self.build_folder, "conan_paths.cmake")
         # the following is workaround for https://github.com/conan-io/conan/issues/7192
         if self.settings.os == "Linux":
@@ -422,10 +422,9 @@ class CelixConan(ConanFile):
         elif self.settings.os == "Macos":
             tc.cache_variables["CMAKE_EXE_LINKER_FLAGS"] = "-Wl,-undefined -Wl,dynamic_lookup"
         v = Version(self.version)
-        tc.cache_variables["CELIX_MAJOR"] = v.major.value
-        tc.cache_variables["CELIX_MINOR"] = v.minor.value
-        tc.cache_variables["CELIX_MICRO"] = v.patch.value
-        tc.user_presets_path = False
+        tc.cache_variables["CELIX_MAJOR"] = str(v.major.value)
+        tc.cache_variables["CELIX_MINOR"] = str(v.minor.value)
+        tc.cache_variables["CELIX_MICRO"] = str(v.patch.value)
         tc.generate()
 
     def _configure_cmake(self):
diff --git a/documents/building/dev_celix_with_clion.md b/documents/building/dev_celix_with_clion.md
index 8c091731..45457be4 100644
--- a/documents/building/dev_celix_with_clion.md
+++ b/documents/building/dev_celix_with_clion.md
@@ -45,12 +45,12 @@ conan profile new default --detect
 conan profile new debug --detect
 conan profile update settings.build_type=Debug debug
 
-#generate and configure cmake-build-debug directory
+# Generate and configure cmake-build-debug directory
+# If CLion's CMake Preset Integration has been enabled, then CLion will load available CMake profiles 
+# from the CMakeUserPresets.json file at the project root, which is generated by `conan install`.
 conan install . celix/2.3.0 -pr:b default -pr:h debug -if cmake-build-debug/ -o celix:enable_testing=True -o celix:enable_address_sanitizer=True -o celix:build_all=True -b missing
 
-# optional build
-# If you want to skip building, which may take long, you can copy the the exact CMAKE command `conan install` shows into CLion
-# and let CLion perform build directory configuration and build.
+#optional build
 conan build . -bf cmake-build-debug/
 
 #optional setup run env and run tests