diff --git a/cmake/Macros.cmake b/cmake/Macros.cmake index eed932f3f..e140893e3 100644 --- a/cmake/Macros.cmake +++ b/cmake/Macros.cmake @@ -260,13 +260,13 @@ macro(sfml_add_library module) # add /include as public include directory target_include_directories(${target} - PUBLIC $ - PRIVATE ${PROJECT_SOURCE_DIR}/src) + PUBLIC "$" + PRIVATE "${PROJECT_SOURCE_DIR}/src") if(SFML_BUILD_FRAMEWORKS) - target_include_directories(${target} INTERFACE $) + target_include_directories(${target} INTERFACE "$") else() - target_include_directories(${target} INTERFACE $) + target_include_directories(${target} INTERFACE "$") endif() # define SFML_STATIC if the build type is not set to 'shared' diff --git a/examples/X11/CMakeLists.txt b/examples/X11/CMakeLists.txt index 55ec52c48..4de80d495 100644 --- a/examples/X11/CMakeLists.txt +++ b/examples/X11/CMakeLists.txt @@ -9,4 +9,4 @@ sfml_add_example(X11Example GUI_APP DEPENDS SFML::Window X11::X11) # external dependency headers -target_include_directories(X11Example SYSTEM PRIVATE ${PROJECT_SOURCE_DIR}/examples/include) +target_include_directories(X11Example SYSTEM PRIVATE "${PROJECT_SOURCE_DIR}/examples/include") diff --git a/examples/island/CMakeLists.txt b/examples/island/CMakeLists.txt index 3a09497fb..0545c2017 100644 --- a/examples/island/CMakeLists.txt +++ b/examples/island/CMakeLists.txt @@ -9,6 +9,6 @@ sfml_add_example(island GUI_APP DEPENDS SFML::Graphics) # external dependency headers -target_include_directories(island SYSTEM PRIVATE ${PROJECT_SOURCE_DIR}/examples/island) +target_include_directories(island SYSTEM PRIVATE "${PROJECT_SOURCE_DIR}/examples/island") target_link_libraries(island PRIVATE Threads::Threads) diff --git a/examples/opengl/CMakeLists.txt b/examples/opengl/CMakeLists.txt index f70d4aaf2..797916f2b 100644 --- a/examples/opengl/CMakeLists.txt +++ b/examples/opengl/CMakeLists.txt @@ -15,4 +15,4 @@ sfml_add_example(opengl GUI_APP DEPENDS SFML::Graphics) # external dependency headers -target_include_directories(opengl SYSTEM PRIVATE ${PROJECT_SOURCE_DIR}/examples/include) +target_include_directories(opengl SYSTEM PRIVATE "${PROJECT_SOURCE_DIR}/examples/include") diff --git a/examples/vulkan/CMakeLists.txt b/examples/vulkan/CMakeLists.txt index 4289dc647..d7eee9d12 100644 --- a/examples/vulkan/CMakeLists.txt +++ b/examples/vulkan/CMakeLists.txt @@ -7,4 +7,4 @@ sfml_add_example(vulkan GUI_APP DEPENDS SFML::Graphics) # external dependency headers -target_include_directories(vulkan SYSTEM PRIVATE ${PROJECT_SOURCE_DIR}/examples/vulkan) +target_include_directories(vulkan SYSTEM PRIVATE "${PROJECT_SOURCE_DIR}/examples/vulkan") diff --git a/examples/window/CMakeLists.txt b/examples/window/CMakeLists.txt index d880def3a..a2ae398a8 100644 --- a/examples/window/CMakeLists.txt +++ b/examples/window/CMakeLists.txt @@ -7,4 +7,4 @@ sfml_add_example(window GUI_APP DEPENDS SFML::Window) # external dependency headers -target_include_directories(window SYSTEM PRIVATE ${PROJECT_SOURCE_DIR}/examples/include) +target_include_directories(window SYSTEM PRIVATE "${PROJECT_SOURCE_DIR}/examples/include") diff --git a/src/SFML/System/CMakeLists.txt b/src/SFML/System/CMakeLists.txt index 3b7543a44..159841f16 100644 --- a/src/SFML/System/CMakeLists.txt +++ b/src/SFML/System/CMakeLists.txt @@ -76,7 +76,7 @@ sfml_add_library(System # enable precompiled headers if (SFML_ENABLE_PCH) message(VERBOSE "enabling PCH for SFML library 'sfml-system' (reused as the PCH for other SFML libraries)") - target_precompile_headers(sfml-system PRIVATE ${PROJECT_SOURCE_DIR}/src/SFML/PCH.hpp) + target_precompile_headers(sfml-system PRIVATE "${PROJECT_SOURCE_DIR}/src/SFML/PCH.hpp") endif() if(SFML_OS_ANDROID) diff --git a/test/CMakeLists.txt b/test/CMakeLists.txt index 4731b4c92..02cb27d34 100644 --- a/test/CMakeLists.txt +++ b/test/CMakeLists.txt @@ -20,7 +20,7 @@ set_target_properties(Catch2 PROPERTIES COMPILE_OPTIONS "" EXPORT_COMPILE_COMMAN set_target_properties(Catch2WithMain PROPERTIES EXPORT_COMPILE_COMMANDS OFF) set_target_properties(Catch2 Catch2WithMain PROPERTIES FOLDER "Dependencies") get_target_property(CATCH2_INCLUDE_DIRS Catch2 INTERFACE_INCLUDE_DIRECTORIES) -target_include_directories(Catch2 SYSTEM INTERFACE ${CATCH2_INCLUDE_DIRS}) +target_include_directories(Catch2 SYSTEM INTERFACE "${CATCH2_INCLUDE_DIRS}") add_library(sfml-test-main STATIC TestUtilities/SystemUtil.hpp diff --git a/tools/freetype/PatchFreetype.cmake b/tools/freetype/PatchFreetype.cmake index d114703aa..039c9cbd2 100644 --- a/tools/freetype/PatchFreetype.cmake +++ b/tools/freetype/PatchFreetype.cmake @@ -1,3 +1,6 @@ file(READ "${FREETYPE_DIR}/CMakeLists.txt" FREETYPE_CMAKELISTS_CONTENTS) string(REPLACE " install(\n FILES \${PROJECT_BINARY_DIR}/freetype2.pc\n DESTINATION \${CMAKE_INSTALL_LIBDIR}/pkgconfig\n COMPONENT pkgconfig)" "" FREETYPE_CMAKELISTS_CONTENTS "${FREETYPE_CMAKELISTS_CONTENTS}") -file(WRITE "${FREETYPE_DIR}/CMakeLists.txt" "${FREETYPE_CMAKELISTS_CONTENTS}") \ No newline at end of file +string(REPLACE " \$\n \$\n \$" " \"\$\"\n \"\$\"\n \"\$\"" FREETYPE_CMAKELISTS_CONTENTS "${FREETYPE_CMAKELISTS_CONTENTS}") +string(REPLACE " \${CMAKE_CURRENT_BINARY_DIR}/include\n \${CMAKE_CURRENT_SOURCE_DIR}/include" " \"\${CMAKE_CURRENT_BINARY_DIR}/include\"\n \"\${CMAKE_CURRENT_SOURCE_DIR}/include\"" FREETYPE_CMAKELISTS_CONTENTS "${FREETYPE_CMAKELISTS_CONTENTS}") +string(REPLACE "\${CMAKE_CURRENT_BINARY_DIR}/include/freetype/config" "\"\${CMAKE_CURRENT_BINARY_DIR}/include/freetype/config\"" FREETYPE_CMAKELISTS_CONTENTS "${FREETYPE_CMAKELISTS_CONTENTS}") +file(WRITE "${FREETYPE_DIR}/CMakeLists.txt" "${FREETYPE_CMAKELISTS_CONTENTS}")