From fe98c62f07feb127e67b93d0908756be998e4713 Mon Sep 17 00:00:00 2001 From: Joel Holdsworth Date: Thu, 18 Jul 2024 11:08:51 -0700 Subject: [PATCH] Improved naming of variables in detect_host_profile --- conan_provider.cmake | 86 ++++++++++++++++++++++---------------------- 1 file changed, 43 insertions(+), 43 deletions(-) diff --git a/conan_provider.cmake b/conan_provider.cmake index dfc83732..49f6dc9b 100644 --- a/conan_provider.cmake +++ b/conan_provider.cmake @@ -360,74 +360,74 @@ endmacro() function(detect_host_profile output_file) - detect_os(MYOS MYOS_API_LEVEL MYOS_SDK MYOS_SUBSYSTEM MYOS_VERSION) - detect_arch(MYARCH) - detect_compiler(MYCOMPILER MYCOMPILER_VERSION MYCOMPILER_RUNTIME MYCOMPILER_RUNTIME_TYPE) - detect_cxx_standard(MYCXX_STANDARD) - detect_lib_cxx(MYLIB_CXX) - detect_build_type(MYBUILD_TYPE) + detect_os(os os_api_level os_sdk os_subsystem os_version) + detect_arch(arch) + detect_compiler(compiler compiler_version compiler_runtime compiler_runtime_type) + detect_cxx_standard(compiler_cppstandard) + detect_lib_cxx(compiler_libcxx) + detect_build_type(build_type) - set(PROFILE "") - string(APPEND PROFILE "[settings]\n") - if(MYARCH) - string(APPEND PROFILE arch=${MYARCH} "\n") + set(profile "") + string(APPEND profile "[settings]\n") + if(arch) + string(APPEND profile arch=${arch} "\n") endif() - if(MYOS) - string(APPEND PROFILE os=${MYOS} "\n") + if(os) + string(APPEND profile os=${os} "\n") endif() - if(MYOS_API_LEVEL) - string(APPEND PROFILE os.api_level=${MYOS_API_LEVEL} "\n") + if(os_api_level) + string(APPEND profile os.api_level=${os_api_level} "\n") endif() - if(MYOS_VERSION) - string(APPEND PROFILE os.version=${MYOS_VERSION} "\n") + if(os_version) + string(APPEND profile os.version=${os_version} "\n") endif() - if(MYOS_SDK) - string(APPEND PROFILE os.sdk=${MYOS_SDK} "\n") + if(os_sdk) + string(APPEND profile os.sdk=${os_sdk} "\n") endif() - if(MYOS_SUBSYSTEM) - string(APPEND PROFILE os.subsystem=${MYOS_SUBSYSTEM} "\n") + if(os_subsystem) + string(APPEND profile os.subsystem=${os_subsystem} "\n") endif() - if(MYCOMPILER) - string(APPEND PROFILE compiler=${MYCOMPILER} "\n") + if(compiler) + string(APPEND profile compiler=${compiler} "\n") endif() - if(MYCOMPILER_VERSION) - string(APPEND PROFILE compiler.version=${MYCOMPILER_VERSION} "\n") + if(compiler_version) + string(APPEND profile compiler.version=${compiler_version} "\n") endif() - if(MYCOMPILER_RUNTIME) - string(APPEND PROFILE compiler.runtime=${MYCOMPILER_RUNTIME} "\n") + if(compiler_runtime) + string(APPEND profile compiler.runtime=${compiler_runtime} "\n") endif() - if(MYCOMPILER_RUNTIME_TYPE) - string(APPEND PROFILE compiler.runtime_type=${MYCOMPILER_RUNTIME_TYPE} "\n") + if(compiler_runtime_type) + string(APPEND profile compiler.runtime_type=${compiler_runtime_type} "\n") endif() - if(MYCXX_STANDARD) - string(APPEND PROFILE compiler.cppstd=${MYCXX_STANDARD} "\n") + if(compiler_cppstandard) + string(APPEND profile compiler.cppstd=${compiler_cppstandard} "\n") endif() - if(MYLIB_CXX) - string(APPEND PROFILE compiler.libcxx=${MYLIB_CXX} "\n") + if(compiler_libcxx) + string(APPEND profile compiler.libcxx=${compiler_libcxx} "\n") endif() - if(MYBUILD_TYPE) - string(APPEND PROFILE "build_type=${MYBUILD_TYPE}\n") + if(build_type) + string(APPEND profile "build_type=${build_type}\n") endif() if(NOT DEFINED output_file) - set(_FN "${CMAKE_BINARY_DIR}/profile") + set(file_name "${CMAKE_BINARY_DIR}/profile") else() - set(_FN ${output_file}) + set(file_name ${output_file}) endif() - string(APPEND PROFILE "[conf]\n") - string(APPEND PROFILE "tools.cmake.cmaketoolchain:generator=${CMAKE_GENERATOR}\n") + string(APPEND profile "[conf]\n") + string(APPEND profile "tools.cmake.cmaketoolchain:generator=${CMAKE_GENERATOR}\n") # propagate compilers via profile append_compiler_executables_configuration() - if(MYOS STREQUAL "Android") - string(APPEND PROFILE "tools.android:ndk_path=${CMAKE_ANDROID_NDK}\n") + if(os STREQUAL "Android") + string(APPEND profile "tools.android:ndk_path=${CMAKE_ANDROID_NDK}\n") endif() - message(STATUS "CMake-Conan: Creating profile ${_FN}") - file(WRITE ${_FN} ${PROFILE}) - message(STATUS "CMake-Conan: Profile: \n${PROFILE}") + message(STATUS "CMake-Conan: Creating profile ${file_name}") + file(WRITE ${file_name} ${profile}) + message(STATUS "CMake-Conan: Profile: \n${profile}") endfunction()