Skip to content

Commit

Permalink
Do not enforce using explicit build types. (#7376)
Browse files Browse the repository at this point in the history
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 #7253
  • Loading branch information
rasjani committed Aug 30, 2020
1 parent 951f45a commit bd0da4d
Showing 1 changed file with 6 additions and 19 deletions.
25 changes: 6 additions & 19 deletions conans/client/generators/cmake_common.py
Original file line number Diff line number Diff line change
Expand Up @@ -971,25 +971,12 @@ def _conan_basic_setup_common(addtional_macros, cmake_multi=False):

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)
endif()
### 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,
Expand Down

0 comments on commit bd0da4d

Please sign in to comment.