I'm trying to create a conan-package (hint: the names contain forward-slashes) as a postbuild operation with something like this:
add_custom_command(
TARGET ${PROJECT_NAME} POST_BUILD
WORKING_DIRECTORY ${PROJECT_DIR}
COMMAND conan export-pkg .. "gtest/1.10.0@shared/testing" -f -pr ${CONAN_PROFILE}
COMMENT "Uploading conan package..."
)
On Linux/Ubuntu/WSL this works fine.
conan export-pkg . 'gtest/1.10.0@shared/testing' -f -pr './platforms/platform_linux-x86-clang/conan_profile/linux-x86-clang'
On Windows the executed command looks like this:
conan export-pkg . 'gtest\1.10.0@shared\testing' -f -pr .\platforms\platform_win-x86-clang\conan_profile\win-x86-clang
How do I keep cmake from replacing / with \? Is there a setting for this?