-
Notifications
You must be signed in to change notification settings - Fork 254
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
dep provider: fixes #476
dep provider: fixes #476
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -43,6 +43,14 @@ function(detect_compiler COMPILER COMPILER_VERSION) | |
set(_COMPILER "apple-clang") | ||
string(REPLACE "." ";" VERSION_LIST ${CMAKE_CXX_COMPILER_VERSION}) | ||
list(GET VERSION_LIST 0 _COMPILER_VERSION) | ||
elseif(_COMPILER MATCHES Clang) | ||
set(_COMPILER "clang") | ||
string(REPLACE "." ";" VERSION_LIST ${CMAKE_CXX_COMPILER_VERSION}) | ||
list(GET VERSION_LIST 0 _COMPILER_VERSION) | ||
elseif(_COMPILER MATCHES GNU) | ||
set(_COMPILER "gcc") | ||
string(REPLACE "." ";" VERSION_LIST ${CMAKE_CXX_COMPILER_VERSION}) | ||
list(GET VERSION_LIST 0 _COMPILER_VERSION) | ||
endif() | ||
|
||
message(STATUS "Conan-cmake: [settings] compiler=${_COMPILER}") | ||
|
@@ -91,6 +99,10 @@ function(detect_host_profile output_file) | |
else() | ||
set(_FN ${output_file}) | ||
endif() | ||
|
||
string(APPEND PROFILE "[conf]\n") | ||
string(APPEND PROFILE "tools.cmake.cmaketoolchain:generator=${CMAKE_GENERATOR}\n") | ||
|
||
message(STATUS "Conan-cmake: Creating profile ${_FN}") | ||
file(WRITE ${_FN} ${PROFILE}) | ||
message(STATUS "Conan-cmake: Profile: \n${PROFILE}") | ||
|
@@ -128,7 +140,7 @@ function(conan_provide_dependency package_name) | |
if(NOT CONAN_INSTALL_SUCCESS) | ||
message(STATUS "CMake-conan: first find_package() found, running 'conan install' to install deps") | ||
detect_host_profile(${CMAKE_BINARY_DIR}/conan_host_profile) | ||
if(CMAKE_BUILD_TYPE) | ||
if(NOT CMAKE_CONFIGURATION_TYPES) | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I was relying on the fact that users in Windows can still force installing just 1 configuration with If we are not allowing this, we would need another kind of opt-out I guess? There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. yup, we would need some opt-out indeed! I would try to avoid giving |
||
message(STATUS "CMake-conan: Intalling single configuration ${CMAKE_BUILD_TYPE}") | ||
conan_install(-pr ${CMAKE_BINARY_DIR}/conan_host_profile --build=missing -g CMakeDeps) | ||
else() | ||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Is CMAKE_GENERATOR always defined as a variable? Even when not provided in CLI and defaulted?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
yup, should be defined by CMake itself, even when not provided by the user