Repository: conan-io/conan

Issue:
Cmake build helper + Intel Fortran
This is similar to #2747, but there isn't as elegant a workaround, so I thought it was worth opening an issue. 

Intel fortran doesn't understand the verbosity command, and it causes the build to fail. 
The workaround I came up with is this:



        cmake = CMake(self, parallel=False)
        command_line = cmake.command_line
        command_line.replace("/verbosity:%s" % cmake.msbuild_verbosity, "", 1)
        self.run('cmake "%s" %s' % (self.source_folder, command_line))
        self.run('cmake --build . %s' % cmake.build_config)`

Unlike #2747, no value that I pass to the msbuild_verbosity argument in the CMake constructor will prevent the command from being issued. It would be nice if there was some way to just remove the "/verbosity: ... " command from being issued at all. 

Discussion:

Patch:
diff --git a/conans/client/build/cmake.py b/conans/client/build/cmake.py
index d11e398f3..d1d039e4e 100644
--- a/conans/client/build/cmake.py
+++ b/conans/client/build/cmake.py
@@ -23,7 +23,7 @@ class CMake(object):
 
     def __init__(self, conanfile, generator=None, cmake_system_name=True,
                  parallel=True, build_type=None, toolset=None, make_program=None,
-                 set_cmake_flags=False, msbuild_verbosity=None, cmake_program=None,
+                 set_cmake_flags=False, msbuild_verbosity="minimal", cmake_program=None,
                  generator_platform=None):
         """
         :param conanfile: Conanfile instance
@@ -69,8 +69,7 @@ class CMake(object):
         self.definitions = builder.get_definitions()
         self.toolset = toolset or get_toolset(self._settings)
         self.build_dir = None
-        self.msbuild_verbosity = (os.getenv("CONAN_MSBUILD_VERBOSITY") or msbuild_verbosity or
-                                  "minimal")
+        self.msbuild_verbosity = os.getenv("CONAN_MSBUILD_VERBOSITY") or msbuild_verbosity
 
     @property
     def build_folder(self):
diff --git a/conans/client/conf/config_installer.py b/conans/client/conf/config_installer.py
index 091f9718a..b9f33730c 100644
--- a/conans/client/conf/config_installer.py
+++ b/conans/client/conf/config_installer.py
@@ -90,9 +90,13 @@ def _process_folder(config, folder, cache, output):
                 output.info("Defining remotes from remotes.txt")
                 _handle_remotes(cache, os.path.join(root, f))
             elif f in ("registry.txt", "registry.json"):
-                os.remove(cache.registry_path)
-                shutil.copy(os.path.join(root, f), cache.cache_folder)
-                migrate_registry_file(cache, output)
+                try:
+                    os.remove(cache.registry_path)
+                except OSError:
+                    pass
+                finally:
+                    shutil.copy(os.path.join(root, f), cache.cache_folder)
+                    migrate_registry_file(cache, output)
             elif f == "remotes.json":
                 # Fix for Conan 2.0
                 raise ConanException("remotes.json install is not supported yet. Use 'remotes.txt'")
diff --git a/conans/client/generators/cmake_common.py b/conans/client/generators/cmake_common.py
index d4e9b3094..a2c4ad7b4 100644
--- a/conans/client/generators/cmake_common.py
+++ b/conans/client/generators/cmake_common.py
@@ -115,30 +115,34 @@ _target_template = """
                                   CONAN_PACKAGE_TARGETS_{uname}_DEBUG "{deps}" "debug" {pkg_name})
     conan_package_library_targets("${{CONAN_LIBS_{uname}_RELEASE}}" "${{CONAN_LIB_DIRS_{uname}_RELEASE}}"
                                   CONAN_PACKAGE_TARGETS_{uname}_RELEASE "{deps}" "release" {pkg_name})
+    conan_package_library_targets("${{CONAN_LIBS_{uname}_RELWITHDEBINFO}}" "${{CONAN_LIB_DIRS_{uname}_RELWITHDEBINFO}}"
+                                  CONAN_PACKAGE_TARGETS_{uname}_RELWITHDEBINFO "{deps}" "relwithdebinfo" {pkg_name})
+    conan_package_library_targets("${{CONAN_LIBS_{uname}_MINSIZEREL}}" "${{CONAN_LIB_DIRS_{uname}_MINSIZEREL}}"
+                                  CONAN_PACKAGE_TARGETS_{uname}_MINSIZEREL "{deps}" "minsizerel" {pkg_name})
 
     add_library({name} INTERFACE IMPORTED)
 
     # Property INTERFACE_LINK_FLAGS do not work, necessary to add to INTERFACE_LINK_LIBRARIES
     set_property(TARGET {name} PROPERTY INTERFACE_LINK_LIBRARIES ${{CONAN_PACKAGE_TARGETS_{uname}}} ${{CONAN_SHARED_LINKER_FLAGS_{uname}_LIST}} ${{CONAN_EXE_LINKER_FLAGS_{uname}_LIST}}
                                                                  $<$<CONFIG:Release>:${{CONAN_PACKAGE_TARGETS_{uname}_RELEASE}} ${{CONAN_SHARED_LINKER_FLAGS_{uname}_RELEASE_LIST}} ${{CONAN_EXE_LINKER_FLAGS_{uname}_RELEASE_LIST}}>
-                                                                 $<$<CONFIG:RelWithDebInfo>:${{CONAN_PACKAGE_TARGETS_{uname}_RELEASE}} ${{CONAN_SHARED_LINKER_FLAGS_{uname}_RELEASE_LIST}} ${{CONAN_EXE_LINKER_FLAGS_{uname}_RELEASE_LIST}}>
-                                                                 $<$<CONFIG:MinSizeRel>:${{CONAN_PACKAGE_TARGETS_{uname}_RELEASE}} ${{CONAN_SHARED_LINKER_FLAGS_{uname}_RELEASE_LIST}} ${{CONAN_EXE_LINKER_FLAGS_{uname}_RELEASE_LIST}}>
+                                                                 $<$<CONFIG:RelWithDebInfo>:${{CONAN_PACKAGE_TARGETS_{uname}_RELWITHDEBINFO}} ${{CONAN_SHARED_LINKER_FLAGS_{uname}_RELWITHDEBINFO_LIST}} ${{CONAN_EXE_LINKER_FLAGS_{uname}_RELWITHDEBINFO_LIST}}>
+                                                                 $<$<CONFIG:MinSizeRel>:${{CONAN_PACKAGE_TARGETS_{uname}_MINSIZEREL}} ${{CONAN_SHARED_LINKER_FLAGS_{uname}_MINSIZEREL_LIST}} ${{CONAN_EXE_LINKER_FLAGS_{uname}_MINSIZEREL_LIST}}>
                                                                  $<$<CONFIG:Debug>:${{CONAN_PACKAGE_TARGETS_{uname}_DEBUG}} ${{CONAN_SHARED_LINKER_FLAGS_{uname}_DEBUG_LIST}} ${{CONAN_EXE_LINKER_FLAGS_{uname}_DEBUG_LIST}}>
                                                                  {deps})
     set_property(TARGET {name} PROPERTY INTERFACE_INCLUDE_DIRECTORIES ${{CONAN_INCLUDE_DIRS_{uname}}}
                                                                       $<$<CONFIG:Release>:${{CONAN_INCLUDE_DIRS_{uname}_RELEASE}}>
-                                                                      $<$<CONFIG:RelWithDebInfo>:${{CONAN_INCLUDE_DIRS_{uname}_RELEASE}}>
-                                                                      $<$<CONFIG:MinSizeRel>:${{CONAN_INCLUDE_DIRS_{uname}_RELEASE}}>
+                                                                      $<$<CONFIG:RelWithDebInfo>:${{CONAN_INCLUDE_DIRS_{uname}_RELWITHDEBINFO}}>
+                                                                      $<$<CONFIG:MinSizeRel>:${{CONAN_INCLUDE_DIRS_{uname}_MINSIZEREL}}>
                                                                       $<$<CONFIG:Debug>:${{CONAN_INCLUDE_DIRS_{uname}_DEBUG}}>)
     set_property(TARGET {name} PROPERTY INTERFACE_COMPILE_DEFINITIONS ${{CONAN_COMPILE_DEFINITIONS_{uname}}}
                                                                       $<$<CONFIG:Release>:${{CONAN_COMPILE_DEFINITIONS_{uname}_RELEASE}}>
-                                                                      $<$<CONFIG:RelWithDebInfo>:${{CONAN_COMPILE_DEFINITIONS_{uname}_RELEASE}}>
-                                                                      $<$<CONFIG:MinSizeRel>:${{CONAN_COMPILE_DEFINITIONS_{uname}_RELEASE}}>
+                                                                      $<$<CONFIG:RelWithDebInfo>:${{CONAN_COMPILE_DEFINITIONS_{uname}_RELWITHDEBINFO}}>
+                                                                      $<$<CONFIG:MinSizeRel>:${{CONAN_COMPILE_DEFINITIONS_{uname}_MINSIZEREL}}>
                                                                       $<$<CONFIG:Debug>:${{CONAN_COMPILE_DEFINITIONS_{uname}_DEBUG}}>)
     set_property(TARGET {name} PROPERTY INTERFACE_COMPILE_OPTIONS ${{CONAN_C_FLAGS_{uname}_LIST}} ${{CONAN_CXX_FLAGS_{uname}_LIST}}
                                                                   $<$<CONFIG:Release>:${{CONAN_C_FLAGS_{uname}_RELEASE_LIST}} ${{CONAN_CXX_FLAGS_{uname}_RELEASE_LIST}}>
-                                                                  $<$<CONFIG:RelWithDebInfo>:${{CONAN_C_FLAGS_{uname}_RELEASE_LIST}} ${{CONAN_CXX_FLAGS_{uname}_RELEASE_LIST}}>
-                                                                  $<$<CONFIG:MinSizeRel>:${{CONAN_C_FLAGS_{uname}_RELEASE_LIST}} ${{CONAN_CXX_FLAGS_{uname}_RELEASE_LIST}}>
+                                                                  $<$<CONFIG:RelWithDebInfo>:${{CONAN_C_FLAGS_{uname}_RELWITHDEBINFO_LIST}} ${{CONAN_CXX_FLAGS_{uname}_RELWITHDEBINFO_LIST}}>
+                                                                  $<$<CONFIG:MinSizeRel>:${{CONAN_C_FLAGS_{uname}_MINSIZEREL_LIST}} ${{CONAN_CXX_FLAGS_{uname}_MINSIZEREL_LIST}}>
                                                                   $<$<CONFIG:Debug>:${{CONAN_C_FLAGS_{uname}_DEBUG_LIST}}  ${{CONAN_CXX_FLAGS_{uname}_DEBUG_LIST}}>)
 """
 
@@ -487,14 +491,14 @@ macro(conan_global_flags)
     if(CONAN_SYSTEM_INCLUDES)
         include_directories(SYSTEM ${CONAN_INCLUDE_DIRS}
                                    "$<$<CONFIG:Release>:${CONAN_INCLUDE_DIRS_RELEASE}>"
-                                   "$<$<CONFIG:RelWithDebInfo>:${CONAN_INCLUDE_DIRS_RELEASE}>"
-                                   "$<$<CONFIG:MinSizeRel>:${CONAN_INCLUDE_DIRS_RELEASE}>"
+                                   "$<$<CONFIG:RelWithDebInfo>:${CONAN_INCLUDE_DIRS_RELWITHDEBINFO}>"
+                                   "$<$<CONFIG:MinSizeRel>:${CONAN_INCLUDE_DIRS_MINSIZEREL}>"
                                    "$<$<CONFIG:Debug>:${CONAN_INCLUDE_DIRS_DEBUG}>")
     else()
         include_directories(${CONAN_INCLUDE_DIRS}
                             "$<$<CONFIG:Release>:${CONAN_INCLUDE_DIRS_RELEASE}>"
-                            "$<$<CONFIG:RelWithDebInfo>:${CONAN_INCLUDE_DIRS_RELEASE}>"
-                            "$<$<CONFIG:MinSizeRel>:${CONAN_INCLUDE_DIRS_RELEASE}>"
+                            "$<$<CONFIG:RelWithDebInfo>:${CONAN_INCLUDE_DIRS_RELWITHDEBINFO}>"
+                            "$<$<CONFIG:MinSizeRel>:${CONAN_INCLUDE_DIRS_MINSIZEREL}>"
                             "$<$<CONFIG:Debug>:${CONAN_INCLUDE_DIRS_DEBUG}>")
     endif()
 
@@ -504,12 +508,16 @@ macro(conan_global_flags)
                                   CONAN_LIBS_DEBUG)
     conan_find_libraries_abs_path("${CONAN_LIBS_RELEASE}" "${CONAN_LIB_DIRS_RELEASE}"
                                   CONAN_LIBS_RELEASE)
+    conan_find_libraries_abs_path("${CONAN_LIBS_RELWITHDEBINFO}" "${CONAN_LIB_DIRS_RELWITHDEBINFO}"
+                                  CONAN_LIBS_RELWITHDEBINFO)
+    conan_find_libraries_abs_path("${CONAN_LIBS_MINSIZEREL}" "${CONAN_LIB_DIRS_MINSIZEREL}"
+                                  CONAN_LIBS_MINSIZEREL)
 
     add_compile_options(${CONAN_DEFINES}
                         "$<$<CONFIG:Debug>:${CONAN_DEFINES_DEBUG}>"
                         "$<$<CONFIG:Release>:${CONAN_DEFINES_RELEASE}>"
-                        "$<$<CONFIG:RelWithDebInfo>:${CONAN_DEFINES_RELEASE}>"
-                        "$<$<CONFIG:MinSizeRel>:${CONAN_DEFINES_RELEASE}>")
+                        "$<$<CONFIG:RelWithDebInfo>:${CONAN_DEFINES_RELWITHDEBINFO}>"
+                        "$<$<CONFIG:MinSizeRel>:${CONAN_DEFINES_MINSIZEREL}>")
 
     conan_set_flags("")
     conan_set_flags("_RELEASE")
@@ -671,6 +679,14 @@ else()
     message(FATAL_ERROR "No conanbuildinfo_debug.cmake, please install the Debug conf first")
 endif()
 
+if(EXISTS ${CMAKE_CURRENT_LIST_DIR}/conanbuildinfo_minsizerel.cmake)
+    include(${CMAKE_CURRENT_LIST_DIR}/conanbuildinfo_minsizerel.cmake)
+endif()
+
+if(EXISTS ${CMAKE_CURRENT_LIST_DIR}/conanbuildinfo_relwithdebinfo.cmake)
+    include(${CMAKE_CURRENT_LIST_DIR}/conanbuildinfo_relwithdebinfo.cmake)
+endif()
+
 macro(conan_set_vs_runtime)
     # This conan_set_vs_runtime is MORE opinionated than the regular one. It will
     # Leave the defaults MD (MDd) or replace them with MT (MTd) but taking into account the
@@ -694,12 +710,19 @@ endmacro()
 
 macro(conan_set_find_paths)
     if(CMAKE_BUILD_TYPE)
+        MESSAGE("BUILD TYPE: ${CMAKE_BUILD_TYPE}")
         if(${CMAKE_BUILD_TYPE} MATCHES "Debug")
             set(CMAKE_PREFIX_PATH ${CONAN_CMAKE_MODULE_PATH_DEBUG} ${CMAKE_PREFIX_PATH})
             set(CMAKE_MODULE_PATH ${CONAN_CMAKE_MODULE_PATH_DEBUG} ${CMAKE_MODULE_PATH})
-        else()
+        elseif(${CMAKE_BUILD_TYPE} MATCHES "Release")
             set(CMAKE_PREFIX_PATH ${CONAN_CMAKE_MODULE_PATH_RELEASE} ${CMAKE_PREFIX_PATH})
             set(CMAKE_MODULE_PATH ${CONAN_CMAKE_MODULE_PATH_RELEASE} ${CMAKE_MODULE_PATH})
+        elseif(${CMAKE_BUILD_TYPE} MATCHES "RelWithDebInfo")
+            set(CMAKE_PREFIX_PATH ${CONAN_CMAKE_MODULE_PATH_RELWITHDEBINFO} ${CMAKE_PREFIX_PATH})
+            set(CMAKE_MODULE_PATH ${CONAN_CMAKE_MODULE_PATH_RELWITHDEBINFO} ${CMAKE_MODULE_PATH})
+        elseif(${CMAKE_BUILD_TYPE} MATCHES "MinSizeRel")
+            set(CMAKE_PREFIX_PATH ${CONAN_CMAKE_MODULE_PATH_MINSIZEREL} ${CMAKE_PREFIX_PATH})
+            set(CMAKE_MODULE_PATH ${CONAN_CMAKE_MODULE_PATH_MINSIZEREL} ${CMAKE_MODULE_PATH})
         endif()
     endif()
 endmacro()


Test patch:
diff --git a/conans/test/functional/generators/cmake_multi_test.py b/conans/test/functional/generators/cmake_multi_test.py
index a918c192e..65a8bfd60 100644
--- a/conans/test/functional/generators/cmake_multi_test.py
+++ b/conans/test/functional/generators/cmake_multi_test.py
@@ -152,7 +152,10 @@ class HelloConan(ConanFile):
 
         client.save({"conanfile.py": conanfile,
                      "Debug/FindHello.cmake": 'message(STATUS "FIND HELLO DEBUG!")',
-                     "Release/FindHello.cmake": 'message(STATUS "FIND HELLO RELEASE!")'})
+                     "Release/FindHello.cmake": 'message(STATUS "FIND HELLO RELEASE!")',
+                     "RelWithDebInfo/FindHello.cmake": 'message(STATUS "FIND HELLO RELWITHDEBINFO!")',
+                     "MinSizeRel/FindHello.cmake": 'message(STATUS "FIND HELLO MINSIZEREL!")'
+                     })
         client.run("export . lasote/testing")
         cmake = """set(CMAKE_CXX_COMPILER_WORKS 1)
 project(MyHello CXX)
@@ -172,6 +175,8 @@ class HelloConan(ConanFile):
 
         client.run("install . --build=missing ")
         client.run("install . -s build_type=Debug --build=missing ")
+        client.run("install . -s build_type=RelWithDebInfo --build=missing ")
+        client.run("install . -s build_type=MinSizeRel --build=missing ")
 
         with remove_from_path("sh"):
             generator = "MinGW Makefiles" if platform.system() == "Windows" else "Unix Makefiles"
@@ -186,6 +191,16 @@ class HelloConan(ConanFile):
             self.assertIn("FIND HELLO RELEASE!", client.user_io.out)
             self.assertNotIn("FIND HELLO DEBUG!", client.user_io.out)
 
+            client.init_dynamic_vars()  # to reset output
+            client.runner('cmake . -G "%s" -DCMAKE_BUILD_TYPE=RelWithDebInfo' % generator,
+                          cwd=client.current_folder)
+            self.assertIn("FIND HELLO RELWITHDEBINFO!", client.user_io.out)
+
+            client.init_dynamic_vars()  # to reset output
+            client.runner('cmake . -G "%s" -DCMAKE_BUILD_TYPE=MinSizeRel' % generator,
+                          cwd=client.current_folder)
+            self.assertIn("FIND HELLO MINSIZEREL!", client.user_io.out)
+
     @unittest.skipUnless(platform.system() in ["Windows", "Darwin"], "Exclude Linux")
     def cmake_multi_test(self):
         client = TestClient()
@@ -206,16 +221,20 @@ class HelloConan(ConanFile):
             release_install = ''
 
         # better in one test instead of two, because install time is amortized
-        for cmake_file in (cmake, cmake_targets, ):
+        for cmake_file in (cmake_targets, cmake):
             client.save({"conanfile.txt": conanfile,
                          "CMakeLists.txt": cmake_file,
                          "main.cpp": main}, clean_first=True)
             client.run('install . -s build_type=Debug %s --build=missing' % debug_install)
             client.run('install . -s build_type=Release %s --build=missing' % release_install)
+            client.run('install . -s build_type=RelWithDebInfo %s --build=missing' % release_install)
+            client.run('install . -s build_type=MinSizeRel %s --build=missing' % release_install)
 
             client.runner('cmake . -G "%s"' % generator, cwd=client.current_folder)
             self.assertNotIn("WARN: Unknown compiler '", client.user_io.out)
             self.assertNotIn("', skipping the version check...", client.user_io.out)
+
+            # Debug
             client.runner('cmake --build . --config Debug', cwd=client.current_folder)
             hello_comand = os.sep.join([".", "Debug", "say_hello"])
             client.runner(hello_comand, cwd=client.current_folder)
@@ -224,6 +243,8 @@ class HelloConan(ConanFile):
             self.assertIn("Hello0Def:Debug Hello1Def:Debug", client.user_io.out)
             self.assertIn("Hello Debug Hello1", client.user_io.out)
             self.assertIn("Hello Debug Hello0", client.user_io.out)
+
+            # Release
             client.runner('cmake --build . --config Release', cwd=client.current_folder)
             hello_comand = os.sep.join([".", "Release", "say_hello"])
             client.runner(hello_comand, cwd=client.current_folder)
@@ -237,6 +258,26 @@ class HelloConan(ConanFile):
             else:
                 self.assertIn("Conan: Using cmake global configuration", client.user_io.out)
 
+            # RelWithDebInfo
+            client.runner('cmake --build . --config RelWithDebInfo', cwd=client.current_folder)
+            hello_comand = os.sep.join([".", "RelWithDebInfo", "say_hello"])
+            client.runner(hello_comand, cwd=client.current_folder)
+
+            self.assertIn("Hello0:RelWithDebInfo Hello1:RelWithDebInfo", client.user_io.out)
+            self.assertIn("Hello0Def:RelWithDebInfo Hello1Def:RelWithDebInfo", client.user_io.out)
+            self.assertIn("Hello Release Hello1", client.user_io.out)
+            self.assertIn("Hello Release Hello0", client.user_io.out)
+
+            # MinSizeRel
+            client.runner('cmake --build . --config MinSizeRel', cwd=client.current_folder)
+            hello_comand = os.sep.join([".", "MinSizeRel", "say_hello"])
+            client.runner(hello_comand, cwd=client.current_folder)
+
+            self.assertIn("Hello0:MinSizeRel Hello1:MinSizeRel", client.user_io.out)
+            self.assertIn("Hello0Def:MinSizeRel Hello1Def:MinSizeRel", client.user_io.out)
+            self.assertIn("Hello Release Hello1", client.user_io.out)
+            self.assertIn("Hello Release Hello0", client.user_io.out)
+
 
 class CMakeMultiSyntaxTest(unittest.TestCase):
 
diff --git a/conans/test/unittests/client/build/cmake_test.py b/conans/test/unittests/client/build/cmake_test.py
index 2eb23489e..2081a93ad 100644
--- a/conans/test/unittests/client/build/cmake_test.py
+++ b/conans/test/unittests/client/build/cmake_test.py
@@ -1333,6 +1333,10 @@ build_type: [ Release]
         cmake.build()
         self.assertIn("/verbosity:quiet", conan_file.command)
 
+        cmake = CMake(conan_file, msbuild_verbosity=None)
+        cmake.build()
+        self.assertNotIn("/verbosity", conan_file.command)
+
         with tools.environment_append({"CONAN_MSBUILD_VERBOSITY": "detailed"}):
             cmake = CMake(conan_file)
             cmake.build()
diff --git a/conans/test/unittests/client/conf/config_installer/__init__.py b/conans/test/unittests/client/conf/config_installer/__init__.py
new file mode 100644
index 000000000..e69de29bb
diff --git a/conans/test/unittests/client/conf/config_installer/test_process_folder.py b/conans/test/unittests/client/conf/config_installer/test_process_folder.py
new file mode 100644
index 000000000..0ad1e2b04
--- /dev/null
+++ b/conans/test/unittests/client/conf/config_installer/test_process_folder.py
@@ -0,0 +1,29 @@
+# coding=utf-8
+
+import os
+import unittest
+from collections import namedtuple
+
+import mock
+
+from conans.client.conf.config_installer import _process_folder
+from conans.test.utils.test_files import temp_folder
+from conans.test.utils.tools import TestBufferConanOutput, save_files
+
+
+class ProcessFolderTests(unittest.TestCase):
+    def test_config_in_empty_folder(self):
+        output = TestBufferConanOutput()
+        cache_t = namedtuple("_", ["cache_folder", "registry_path"])
+        config_t = namedtuple("_", ["source_folder"])
+
+        cache_folder = temp_folder()
+        remotes_json = os.path.join(cache_folder, "registry.json")
+        cache = cache_t(cache_folder=cache_folder, registry_path=remotes_json)
+        ori_folder = temp_folder()
+        save_files(ori_folder, {'registry.json': 'whatever'})
+        with mock.patch("conans.client.conf.config_installer.migrate_registry_file",
+                        return_value=None):
+            self.assertFalse(os.path.exists(remotes_json))
+            _process_folder(config_t(None), ori_folder, cache, output)
+        self.assertTrue(os.path.exists(remotes_json))
diff --git a/conans/test/utils/multi_config.py b/conans/test/utils/multi_config.py
index 7804471ae..1889c787a 100644
--- a/conans/test/utils/multi_config.py
+++ b/conans/test/utils/multi_config.py
@@ -17,8 +17,10 @@ class {name}Conan(ConanFile):
             self.run(cmd)
             self.run("cmake --build . --config Debug")
             self.run("cmake --build . --config Release")
+            self.run("cmake --build . --config RelWithDebInfo")
+            self.run("cmake --build . --config MinSizeRel")
         else:
-            for config in ("Debug", "Release"):
+            for config in ("Debug", "Release", "RelWithDebInfo", "MinSizeRel"):
                 self.output.info("Building %s" % config)
                 self.run('cmake "%s" %s -DCMAKE_BUILD_TYPE=%s'
                          % (self.source_folder, cmake.command_line, config))
@@ -35,10 +37,17 @@ class {name}Conan(ConanFile):
     def package_info(self):
         self.cpp_info.release.libs = ["hello{name}"]
         self.cpp_info.debug.libs = ["hello{name}_d"]
+        self.cpp_info.relwithdebinfo.libs = ["hello{name}_relwithdebinfo"]
+        self.cpp_info.minsizerel.libs = ["hello{name}_minsizerel"]
+        
         self.cpp_info.release.defines = ['HELLO{name}DEFINE="Release"',
                                          'HELLO{name}BUILD="Release"']
         self.cpp_info.debug.defines = ['HELLO{name}DEFINE="Debug"',
                                        'HELLO{name}BUILD="Debug"']
+        self.cpp_info.relwithdebinfo.defines = ['HELLO{name}DEFINE="RelWithDebInfo"',
+                                                'HELLO{name}BUILD="RelWithDebInfo"']
+        self.cpp_info.minsizerel.defines = ['HELLO{name}DEFINE="MinSizeRel"',
+                                            'HELLO{name}BUILD="MinSizeRel"']
 """
 
 testconanfile = """
@@ -111,9 +120,13 @@ conan_basic_setup()
 
 add_library(hello{name} hello.cpp)
 set_target_properties(hello{name} PROPERTIES DEBUG_POSTFIX _d)
+set_target_properties(hello{name} PROPERTIES MINSIZEREL_POSTFIX _minsizerel)
+set_target_properties(hello{name} PROPERTIES RELWITHDEBINFO_POSTFIX _relwithdebinfo)
 conan_target_link_libraries(hello{name})
 add_executable(say_hello main.cpp)
 set_target_properties(say_hello PROPERTIES DEBUG_POSTFIX _d)
+set_target_properties(hello{name} PROPERTIES MINSIZEREL_POSTFIX _minsizerel)
+set_target_properties(hello{name} PROPERTIES RELWITHDEBINFO_POSTFIX _relwithdebinfo)
 target_link_libraries(say_hello hello{name})
 
 """