@@ -43,6 +43,14 @@ function(detect_compiler COMPILER COMPILER_VERSION)
43
43
set (_COMPILER "apple-clang" )
44
44
string (REPLACE "." ";" VERSION_LIST ${CMAKE_CXX_COMPILER_VERSION} )
45
45
list (GET VERSION_LIST 0 _COMPILER_VERSION)
46
+ elseif (_COMPILER MATCHES Clang)
47
+ set (_COMPILER "clang" )
48
+ string (REPLACE "." ";" VERSION_LIST ${CMAKE_CXX_COMPILER_VERSION} )
49
+ list (GET VERSION_LIST 0 _COMPILER_VERSION)
50
+ elseif (_COMPILER MATCHES GNU)
51
+ set (_COMPILER "gcc" )
52
+ string (REPLACE "." ";" VERSION_LIST ${CMAKE_CXX_COMPILER_VERSION} )
53
+ list (GET VERSION_LIST 0 _COMPILER_VERSION)
46
54
endif ()
47
55
48
56
message (STATUS "Conan-cmake: [settings] compiler=${_COMPILER} " )
@@ -91,6 +99,10 @@ function(detect_host_profile output_file)
91
99
else ()
92
100
set (_FN ${output_file} )
93
101
endif ()
102
+
103
+ string (APPEND PROFILE "[conf]\n " )
104
+ string (APPEND PROFILE "tools.cmake.cmaketoolchain:generator=${CMAKE_GENERATOR} \n " )
105
+
94
106
message (STATUS "Conan-cmake: Creating profile ${_FN} " )
95
107
file (WRITE ${_FN} ${PROFILE} )
96
108
message (STATUS "Conan-cmake: Profile: \n ${PROFILE} " )
@@ -128,7 +140,7 @@ function(conan_provide_dependency package_name)
128
140
if (NOT CONAN_INSTALL_SUCCESS)
129
141
message (STATUS "CMake-conan: first find_package() found, running 'conan install' to install deps" )
130
142
detect_host_profile(${CMAKE_BINARY_DIR} /conan_host_profile)
131
- if (CMAKE_BUILD_TYPE )
143
+ if (NOT CMAKE_CONFIGURATION_TYPES )
132
144
message (STATUS "CMake-conan: Intalling single configuration ${CMAKE_BUILD_TYPE} " )
133
145
conan_install(-pr ${CMAKE_BINARY_DIR} /conan_host_profile --build =missing -g CMakeDeps)
134
146
else ()
0 commit comments