Do not enforce using explicit build types.
cmake_multi enforced existence of conanbuildinfo_release.cmake &
conanbuildinfo_debug.cmake had to be present or the build would fail if
conanbuildinfo_multi.cmake was loaded. This is now changed so that
only generated conanbuildinfo files are loaded.
Fixes
@@ -971,25 +971,12 @@ cmake_macros = "\n".join([
cmake_macros_multi = "\n".join([
textwrap.dedent("""
- if(EXISTS ${CMAKE_CURRENT_LIST_DIR}/conanbuildinfo_release.cmake)
- include(${CMAKE_CURRENT_LIST_DIR}/conanbuildinfo_release.cmake)
- else()
- message(FATAL_ERROR "No conanbuildinfo_release.cmake, please install the Release conf first")
- endif()
-
- if(EXISTS ${CMAKE_CURRENT_LIST_DIR}/conanbuildinfo_debug.cmake)
- include(${CMAKE_CURRENT_LIST_DIR}/conanbuildinfo_debug.cmake)
- 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)
+ ### load generated conanbuildinfo files.
+ foreach(_name release debug minsizerel relwithdebinfo)
+ if(EXISTS ${CMAKE_CURRENT_LIST_DIR}/conanbuildinfo_${_name}.cmake)
+ include(${CMAKE_CURRENT_LIST_DIR}/conanbuildinfo_${_name}.cmake)
endif()
+ endforeach()
"""),
CMakeCommonMacros.conan_set_vs_runtime_preserve_build_type,
CMakeCommonMacros.conan_set_find_paths_multi,
