diff --git a/conan/tools/cmake/toolchain.py b/conan/tools/cmake/toolchain.py index 60248a5a962..fa04525912a 100644 --- a/conan/tools/cmake/toolchain.py +++ b/conan/tools/cmake/toolchain.py @@ -134,8 +134,8 @@ def context(self): class FPicBlock(Block): template = textwrap.dedent(""" - message(STATUS "Conan toolchain: Setting CMAKE_POSITION_INDEPENDENT_CODE=ON (options.fPIC)") - set(CMAKE_POSITION_INDEPENDENT_CODE ON) + message(STATUS "Conan toolchain: Setting CMAKE_POSITION_INDEPENDENT_CODE={{ fpic }} (options.fPIC)") + set(CMAKE_POSITION_INDEPENDENT_CODE {{ fpic }}) """) def context(self):