MarkSchofield / WindowsToolchain

A repository containing a CMake toolchain for using MSVC
MIT License
106 stars 19 forks source link

Replace include_directories by CMAKE_CXX_STANDARD_INCLUDE_DIRECTORIES #67

Closed bebuch closed 1 year ago

bebuch commented 1 year ago

Accoring to

include_directories should not be used in toolchain files.

I did run into an issue with Qt today:

add_executable(syncqt   C:/Temp/TechnoTeam/20230605_115055/build_tools/src/qt/qt-everywhere-src-6.5.1/qtbase/src/tools/syncqt/main.cpp)
set_target_properties(syncqt PROPERTIES
    INCLUDE_DIRECTORIES ""
    RUNTIME_OUTPUT_DIRECTORY "${output_directory}"
)

This is from one of the Qt configuration files and it removes include_directories while CMAKE_CXX_STANDARD_INCLUDE_DIRECTORIES still works. I think that is the reason why Brad King stated that link_directories and friends should not be used in toolchain files.