In your question, you include warning 44101 (which doesn't exist if I'm right?), But shutdown warning 4101 : is this a typo?
EDIT:
You answered this in the comments on your question. Reading MSDN documentation , the /wlnnnn option allows /wlnnnn to set the warning level to l for the warning number specified by nnnn . Thus, /w44101 resolves warning number 4101 at level 4 .
In any case, if your projects are generated using CMake, add_compile_options can be used to add parameters to the compilation of source files in the Current directory. This can be used to enable warning 4101 in the "global scope":
add_compile_options(/w4101)
Then you can use target_compile_definitions to disable it for each purpose:
add_library(foo ...) target_compile_definitions(foo PUBLIC /wd4101)
EDIT:
From your comments in the main CMake repo file there is:
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} /w44101")
And in your project, the CMake file you are trying to make is:
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} /wd4101")
What you need to do is remove /w44101 from CMAKE_CXX_FLAGS . You can achieve this using string(REPLACE ...) to replace /w44101 an empty string:
string(REPLACE "/w44101" "" CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS}")
Obviously, the best solution would be to fix the warning code. 4101 about unused variables that are easy to fix;)
(see the corresponding question. What is the best way to disable the warning about unused variables? )