Skip to content

Commit

Permalink
Merge pull request aminya#195 from bwhitchurch/conan_profiles
Browse files Browse the repository at this point in the history
  • Loading branch information
aminya authored Jan 21, 2023
2 parents b47ff98 + 42bbced commit 7a0987f
Show file tree
Hide file tree
Showing 2 changed files with 24 additions and 1 deletion.
21 changes: 21 additions & 0 deletions src/Conan.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -77,6 +77,23 @@ macro(run_conan)
# CONAN_ENV should be redundant, since the profile can set CC & CXX
endif()

if("${ProjectOptions_CONAN_PROFILE}" STREQUAL "")
set(CONAN_DEFAULT_PROFILE "default")
else()
set(CONAN_DEFAULT_PROFILE ${ProjectOptions_CONAN_PROFILE})
endif()
if("${ProjectOptions_CONAN_BUILD_PROFILE}" STREQUAL "")
set(CONAN_BUILD_PROFILE ${CONAN_DEFAULT_PROFILE})
else()
set(CONAN_BUILD_PROFILE ${ProjectOptions_CONAN_BUILD_PROFILE})
endif()

if("${ProjectOptions_CONAN_HOST_PROFILE}" STREQUAL "")
set(CONAN_HOST_PROFILE ${CONAN_DEFAULT_PROFILE})
else()
set(CONAN_HOST_PROFILE ${ProjectOptions_CONAN_HOST_PROFILE})
endif()

# PATH_OR_REFERENCE ${CMAKE_SOURCE_DIR} is used to tell conan to process
# the external "conanfile.py" provided with the project
# Alternatively a conanfile.txt could be used
Expand All @@ -90,6 +107,10 @@ macro(run_conan)
${ProjectOptions_CONAN_OPTIONS}
# Pass CMake compilers to Conan
${CONAN_ENV}
PROFILE_HOST
${CONAN_HOST_PROFILE}
PROFILE_BUILD
${CONAN_BUILD_PROFILE}
# Pass either autodetected settings or a conan profile
${CONAN_SETTINGS}
${OUTPUT_QUIET})
Expand Down
4 changes: 3 additions & 1 deletion src/Index.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -97,7 +97,9 @@ macro(project_options)
PREFIX
LINKER
VS_ANALYSIS_RULESET
CONAN_PROFILE)
CONAN_PROFILE
CONAN_HOST_PROFILE
CONAN_BUILD_PROFILE)
set(multiValueArgs
DOXYGEN_THEME
MSVC_WARNINGS
Expand Down

0 comments on commit 7a0987f

Please sign in to comment.