In /cmake/StaticAnalyzers.cmake, the macro myproject_enable_include_what_you_use is declared.
However, myproject_enable_include_what_you_use is never actually set as an option elsewhere. Therefore, it's not possible to set it as an option in places like cmake-gui or based on the configuration.
For instance, myproject_enable_clang_tidy is right above it. I see that at the bottom of ProjectOptions.cmake that macro is called if myproject_ENABLE_CLANG_TIDY is set to true. There is no equivalent for myproject_enable_include_what_you_use.
It appears when iwyu was added, https://github.com/cpp-best-practices/cmake_template/blob/3a8c8f9793fb9805af558bfe097491e9a6efc97c/cmake/StaticAnalyzers.cmake was simpler. It did have option(ENABLE_INCLUDE_WHAT_YOU_USE "Enable static analysis with include-what-you-use" OFF).
StaticAnalyzers.cmake has had some changes, but it appears
macro(myproject_enable_include_what_you_use)
find_program(INCLUDE_WHAT_YOU_USE include-what-you-use)
if(INCLUDE_WHAT_YOU_USE)
set(CMAKE_CXX_INCLUDE_WHAT_YOU_USE ${INCLUDE_WHAT_YOU_USE})
else()
message(WARNING "include-what-you-use requested but executable not found")
endif()
endmacro()
is orphaned code that doesn't do anything. If I am mistaken hopefully, someone can explain this a little bit better to me. I've had to heavily edit my fork of this template because we can only support CMake 3.12 at this time, due to our usage of MSVS 2017. I'm doing some cleanup and noticed that iwyu is never really used. Looking at the code on the main branch, I don't see it being used so it's not like I unintentionally removed it.
In /cmake/StaticAnalyzers.cmake, the macro myproject_enable_include_what_you_use is declared.
However, myproject_enable_include_what_you_use is never actually set as an option elsewhere. Therefore, it's not possible to set it as an option in places like cmake-gui or based on the configuration.
For instance, myproject_enable_clang_tidy is right above it. I see that at the bottom of ProjectOptions.cmake that macro is called if myproject_ENABLE_CLANG_TIDY is set to true. There is no equivalent for myproject_enable_include_what_you_use.
It appears when iwyu was added, https://github.com/cpp-best-practices/cmake_template/blob/3a8c8f9793fb9805af558bfe097491e9a6efc97c/cmake/StaticAnalyzers.cmake was simpler. It did have
option(ENABLE_INCLUDE_WHAT_YOU_USE "Enable static analysis with include-what-you-use" OFF).StaticAnalyzers.cmake has had some changes, but it appears
is orphaned code that doesn't do anything. If I am mistaken hopefully, someone can explain this a little bit better to me. I've had to heavily edit my fork of this template because we can only support CMake 3.12 at this time, due to our usage of MSVS 2017. I'm doing some cleanup and noticed that iwyu is never really used. Looking at the code on the main branch, I don't see it being used so it's not like I unintentionally removed it.