Repository: conan-io/conan-center-index

Issue:
[request] boost-ext-ut/1.1.9
### Package Details
  * Package Name/Version: boost-ext-ut/1.1.9
  * Changelog: https://github.com/boost-ext/ut/compare/v1.1.8...v1.1.9


The above mentioned version is newly released by the upstream project and not yet available as a recipe. Please add this version.
https://github.com/boost-ext/ut/issues/490
I requested this new version be released because 1.1.8 didn't have some fixes that were needed newer msvc versions. Like the ability to disable modules.


Discussion:
Also note the new version no longer supports c++17. So the description on the conan website could use updated to remove that.

https://github.com/boost-ext/ut/commit/68994966266a01b885d0245ca39b0c54e8f9f0d4
Also this recipe is listed as header-only. 
There is a https://github.com/boost-ext/ut/blob/master/CMakeLists.txt
I'm afraid if it's only a header-only recipe it won't give access to these cmake options.

```cmake
if(NOT DEFINED CMAKE_CXX_STANDARD)
  set(CMAKE_CXX_STANDARD
      20
      CACHE STRING "Default value for CXX_STANDARD property of targets."
  )
  option(CMAKE_CXX_STANDARD_REQUIRED "Default value for CXX_STANDARD_REQUIRED property of targets." YES)
  option(CMAKE_CXX_EXTENSIONS "Default value for CXX_EXTENSIONS property of targets." NO)
endif()

option(BOOST_UT_ENABLE_MEMCHECK "Run the unit tests and examples under valgrind if it is found" OFF)
option(BOOST_UT_ENABLE_COVERAGE "Run coverage" OFF)
option(BOOST_UT_ENABLE_SANITIZERS "Run static analysis" OFF)
option(BOOST_UT_BUILD_BENCHMARKS "Build the benchmarks" ${MASTER_PROJECT}) #should be off unless is detected as CMAKE_CURRENT_SOURCE_DIR STREQUAL CMAKE_SOURCE_DIR
option(BOOST_UT_BUILD_EXAMPLES "Build the examples" ${MASTER_PROJECT})
option(BOOST_UT_BUILD_TESTS "Build the tests" ${MASTER_PROJECT})
option(BOOST_UT_DISABLE_MODULE "Disable ut module" OFF) #this one is important to be on if #include it as a header.
```
@Sebanisu Thanks for the info! I maintain that package and will have it updated shortly.

Resolving patch:
diff --git a/recipes/boost-ext-ut/all/conanfile.py b/recipes/boost-ext-ut/all/conanfile.py
--- a/recipes/boost-ext-ut/all/conanfile.py
+++ b/recipes/boost-ext-ut/all/conanfile.py
@@ -1,24 +1,27 @@
-from conans import ConanFile, tools
-from conans.errors import ConanInvalidConfiguration
 import os
+from conans import CMake, ConanFile, tools
+from conans.errors import ConanInvalidConfiguration
 
 required_conan_version = ">=1.43.0"
 
 
 class UTConan(ConanFile):
     name = "boost-ext-ut"
-    description = ("C++17/20 single header/single module, "
+    description = ("C++20 single header/single module, "
                    "macro-free micro Unit Testing Framework")
-    topics = ("conan", "UT", "header-only", "unit-test", "tdd", "bdd")
+    topics = ("ut", "header-only", "unit-test", "test", "tdd", "bdd")
     url = "https://github.com/conan-io/conan-center-index"
     homepage = "https://boost-ext.github.io/ut/"
     license = "BSL-1.0"
     settings = "os", "compiler", "arch", "build_type"
     no_copy_source = True
+    options = { "disable_module": [True, False], }
+    default_options = { "disable_module": False, }
+    _cmake = None
 
     @property
     def _minimum_cpp_standard(self):
-        return 17 if self.settings.compiler in ["clang", "gcc"] else 20
+        return 17 if self.settings.compiler in ["clang", "gcc"] and tools.Version(self.version) <= "1.1.8" else 20
 
     @property
     def _minimum_compilers_version(self):
@@ -30,13 +33,16 @@ def _minimum_compilers_version(self):
             "Visual Studio": "16",
         }
 
-    @property
-    def _source_subfolder(self):
-        return "source_subfolder"
+    def export_sources(self):
+        for patch in self.conan_data.get("patches", {}).get(self.version, []):
+            self.copy(patch["patch_file"])
 
-    def configure(self):
+    def validate(self):
         if self.settings.compiler.get_safe("cppstd"):
             tools.check_min_cppstd(self, self._minimum_cpp_standard)
+        if tools.Version(self.version) <= "1.1.8" and self.settings.compiler in ["msvc", "Visual Studio"]:
+            raise ConanInvalidConfiguration("{} version 1.1.8 may not be built with MSVC. "
+                                            "Please use at least version 1.1.9 with MSVC.")
         min_version = self._minimum_compilers_version.get(
             str(self.settings.compiler))
         if not min_version:
@@ -52,17 +58,43 @@ def configure(self):
                         self.settings.compiler,
                         self.settings.compiler.version))
 
+    def config_options(self):
+        if tools.Version(self.version) <= "1.1.8":
+            del self.options.disable_module
+
+    def configure(self):
+        if self.settings.compiler in ["msvc", "Visual Studio"]:
+            if "disable_module" in self.options.values:
+                self.options.disable_module = True
+
     def source(self):
-        tools.get(**self.conan_data["sources"][self.version])
-        os.rename("ut-" + self.version, self._source_subfolder)
-        tools.download("https://www.boost.org/LICENSE_1_0.txt", "LICENSE",
-                       sha256="c9bff75738922193e67fa726fa225535870d2aa1059f914"
-                       "52c411736284ad566")
+        tools.get(**self.conan_data["sources"][self.version], strip_root=True)
+        for patch in self.conan_data.get("patches", {}).get(self.version, []):
+            tools.patch(**patch)
+
+    def _configure_cmake(self):
+        if self._cmake:
+            return self._cmake
+        self._cmake = CMake(self)
+        self._cmake.definitions["BOOST_UT_BUILD_BENCHMARKS"] = False
+        self._cmake.definitions["BOOST_UT_BUILD_EXAMPLES"] = False
+        self._cmake.definitions["BOOST_UT_BUILD_TESTS"] = False
+        self._cmake.definitions["PROJECT_DISABLE_VERSION_SUFFIX"] = True
+        disable_module = self.options.get_safe("disable_module")
+        if disable_module:
+            self._cmake.definitions["BOOST_UT_DISABLE_MODULE"] = disable_module
+        self._cmake.configure()
+        return self._cmake
+    
+    def build(self):
+        cmake = self._configure_cmake()
+        cmake.build()
 
     def package(self):
-        self.copy("LICENSE", dst="licenses")
-        self.copy(os.path.join("include", "boost", "ut.hpp"),
-                  src=self._source_subfolder)
+        self.copy("LICENSE*", dst="licenses")
+        cmake = self._configure_cmake()
+        cmake.install()
+        tools.rmdir(os.path.join(self.package_folder, "lib", "cmake"))
 
     def package_id(self):
         self.info.header_only()
@@ -77,3 +109,9 @@ def package_info(self):
         self.cpp_info.filenames["cmake_find_package_multi"] = "ut"
         self.cpp_info.components["ut"].names["cmake_find_package"] = "ut"
         self.cpp_info.components["ut"].names["cmake_find_package_multi"] = "ut"
+
+        if tools.Version(self.version) > "1.1.8":
+            self.cpp_info.components["ut"].includedirs = [os.path.join("include", "ut-" + self.version, "include")]
+
+        if self.options.get_safe("disable_module"):
+            self.cpp_info.components["ut"].defines = ["BOOST_UT_DISABLE_MODULE=1"]


Test patch:
diff --git a/recipes/boost-ext-ut/all/test_package/conanfile.py b/recipes/boost-ext-ut/all/test_package/conanfile.py
--- a/recipes/boost-ext-ut/all/test_package/conanfile.py
+++ b/recipes/boost-ext-ut/all/test_package/conanfile.py
@@ -1,5 +1,5 @@
-from conans import ConanFile, CMake, tools
 import os
+from conans import ConanFile, CMake, tools
 
 
 class TestPackageConan(ConanFile):
@@ -12,6 +12,6 @@ def build(self):
         cmake.build()
 
     def test(self):
-        if not tools.cross_building(self.settings):
+        if not tools.cross_building(self):
             bin_path = os.path.join("bin", "test_package")
             self.run(bin_path, run_environment=True)