We are currently solving the following issue within our repository. Here is the issue text:
--- BEGIN ISSUE ---
mark headers as "SYSTEM" headers to silence warnings
Many libraries generate tons of warnings in public headers. WebSocket++ uses auto_ptr for example and many Boost libraries truncate integers implicitly (-Wconversion). To consume these libraries you have to treat them as system headers because GCC won't emit warnings in these.

This is how Conan currently sets the include directories:

``` CMake
include_directories(${CONAN_INCLUDE_DIRS})
```

This is how you would add them as "system" headers to silence warnings:

``` CMake
include_directories(SYSTEM ${CONAN_INCLUDE_DIRS})
```

Is there a reason it is not already done this way?
This issue may apply to configurations other than CMake/GCC, too, but this is the most important one for me.


--- END ISSUE ---

Below are some code segments, each from a relevant file. One or more of these files may contain bugs.
--- BEGIN FILES ---
Path: `conans/client/generators/cmake.py`
Content:
```
1 from conans.model import Generator
2 from conans.paths import BUILD_INFO_CMAKE
3 
4 
5 class DepsCppCmake(object):
6     def __init__(self, deps_cpp_info):
7         self.include_paths = "\n\t\t\t".join('"%s"' % p.replace("\\", "/")
8                                              for p in deps_cpp_info.include_paths)
9         self.lib_paths = "\n\t\t\t".join('"%s"' % p.replace("\\", "/")
10                                          for p in deps_cpp_info.lib_paths)
11         self.libs = " ".join(deps_cpp_info.libs)
12         self.defines = "\n\t\t\t".join("-D%s" % d for d in deps_cpp_info.defines)
13         self.cppflags = " ".join(deps_cpp_info.cppflags)
14         self.cflags = " ".join(deps_cpp_info.cflags)
15         self.sharedlinkflags = " ".join(deps_cpp_info.sharedlinkflags)
16         self.exelinkflags = " ".join(deps_cpp_info.exelinkflags)
17         self.bin_paths = "\n\t\t\t".join('"%s"' % p.replace("\\", "/")
18                                          for p in deps_cpp_info.bin_paths)
19 
20         self.rootpath = '"%s"' % deps_cpp_info.rootpath.replace("\\", "/")
21 
22 
23 class CMakeGenerator(Generator):
24     @property
25     def filename(self):
26         return BUILD_INFO_CMAKE
27 
28     @property
29     def content(self):
30         sections = []
31 
32         # DEPS VARIABLES
33         template_dep = ('set(CONAN_{dep}_ROOT {deps.rootpath})\n'
34                         'set(CONAN_INCLUDE_DIRS_{dep} {deps.include_paths})\n'
35                         'set(CONAN_LIB_DIRS_{dep} {deps.lib_paths})\n'
36                         'set(CONAN_BIN_DIRS_{dep} {deps.bin_paths})\n'
37                         'set(CONAN_LIBS_{dep} {deps.libs})\n'
38                         'set(CONAN_DEFINES_{dep} {deps.defines})\n'
39                         'set(CONAN_CXX_FLAGS_{dep} "{deps.cppflags}")\n'
40                         'set(CONAN_SHARED_LINKER_FLAGS_{dep} "{deps.sharedlinkflags}")\n'
41                         'set(CONAN_EXE_LINKER_FLAGS_{dep} "{deps.exelinkflags}")\n'
42                         'set(CONAN_C_FLAGS_{dep} "{deps.cflags}")\n')
43 
44         for dep_name, dep_cpp_info in self.deps_build_info.dependencies:
45             deps = DepsCppCmake(dep_cpp_info)
46             dep_flags = template_dep.format(dep=dep_name.upper(),
47                                             deps=deps)
48             sections.append(dep_flags)
49 
50         # GENERAL VARIABLES
51         deps = DepsCppCmake(self.deps_build_info)
52 
53         template = ('set(CONAN_INCLUDE_DIRS {deps.include_paths} ${{CONAN_INCLUDE_DIRS}})\n'
54             'set(CONAN_LIB_DIRS {deps.lib_paths} ${{CONAN_LIB_DIRS}})\n'
55             'set(CONAN_BIN_DIRS {deps.bin_paths} ${{CONAN_BIN_DIRS}})\n'
56             'set(CONAN_LIBS {deps.libs} ${{CONAN_LIBS}})\n'
57             'set(CONAN_DEFINES {deps.defines} ${{CONAN_DEFINES}})\n'
58             'set(CONAN_CXX_FLAGS "{deps.cppflags} ${{CONAN_CXX_FLAGS}}")\n'
59             'set(CONAN_SHARED_LINKER_FLAGS "{deps.sharedlinkflags} ${{CONAN_SHARED_LINKER_FLAGS}}")\n'
60             'set(CONAN_EXE_LINKER_FLAGS "{deps.exelinkflags} ${{CONAN_EXE_LINKER_FLAGS}}")\n'
61             'set(CONAN_C_FLAGS "{deps.cflags} ${{CONAN_C_FLAGS}}")\n'
62             'set(CONAN_CMAKE_MODULE_PATH {module_paths} ${{CONAN_CMAKE_MODULE_PATH}})')
63 
64         rootpaths = [DepsCppCmake(dep_cpp_info).rootpath for _, dep_cpp_info
65                      in self.deps_build_info.dependencies]
66         module_paths = " ".join(rootpaths)
67         all_flags = template.format(deps=deps, module_paths=module_paths)
68         sections.append(all_flags)
69 
70         # MACROS
71         sections.append(self._aux_cmake_test_setup())
72 
73         return "\n".join(sections)
74 
75     def _aux_cmake_test_setup(self):
76         return """macro(CONAN_BASIC_SETUP)
77     conan_check_compiler()
78     conan_output_dirs_setup()
79     conan_flags_setup()
80     # CMake can find findXXX.cmake files in the root of packages
81     set(CMAKE_MODULE_PATH ${CONAN_CMAKE_MODULE_PATH} ${CMAKE_MODULE_PATH})
82 endmacro()
83 
84 macro(CONAN_FLAGS_SETUP)
85     include_directories(${CONAN_INCLUDE_DIRS})
86     link_directories(${CONAN_LIB_DIRS})
87     add_definitions(${CONAN_DEFINES})
88 
89     # For find_library
90     set(CMAKE_INCLUDE_PATH ${CONAN_INCLUDE_DIRS} ${CMAKE_INCLUDE_PATH})
91     set(CMAKE_LIBRARY_PATH ${CONAN_LIB_DIRS} ${CMAKE_LIBRARY_PATH})
92 
93     set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} ${CONAN_CXX_FLAGS}")
94     set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} ${CONAN_C_FLAGS}")
95     set(CMAKE_SHARED_LINKER_FLAGS "${CMAKE_SHARED_LINKER_FLAGS} ${CONAN_SHARED_LINKER_FLAGS}")
96     set(CMAKE_EXE_LINKER_FLAGS "${CMAKE_EXE_LINKER_FLAGS} ${CONAN_EXE_LINKER_FLAGS}")
97 
98     if(APPLE)
99         # https://cmake.org/Wiki/CMake_RPATH_handling
100         # CONAN GUIDE: All generated libraries should have the id and dependencies to other
101         # dylibs without path, just the name, EX:
102         # libMyLib1.dylib:
103         #     libMyLib1.dylib (compatibility version 0.0.0, current version 0.0.0)
104         #     libMyLib0.dylib (compatibility version 0.0.0, current version 0.0.0)
105         #     /usr/lib/libc++.1.dylib (compatibility version 1.0.0, current version 120.0.0)
106         #     /usr/lib/libSystem.B.dylib (compatibility version 1.0.0, current version 1197.1.1)
107         set(CMAKE_SKIP_RPATH 1)  # AVOID RPATH FOR *.dylib, ALL LIBS BETWEEN THEM AND THE EXE
108                                  # SHOULD BE ON THE LINKER RESOLVER PATH (./ IS ONE OF THEM)
109     endif()
110     if(CONAN_LINK_RUNTIME)
111         string(REPLACE "/MD" ${CONAN_LINK_RUNTIME} CMAKE_CXX_FLAGS_RELEASE ${CMAKE_CXX_FLAGS_RELEASE})
112         string(REPLACE "/MDd" ${CONAN_LINK_RUNTIME} CMAKE_CXX_FLAGS_DEBUG ${CMAKE_CXX_FLAGS_DEBUG})
113         string(REPLACE "/MD" ${CONAN_LINK_RUNTIME} CMAKE_C_FLAGS_RELEASE ${CMAKE_C_FLAGS_RELEASE})
114         string(REPLACE "/MDd" ${CONAN_LINK_RUNTIME} CMAKE_C_FLAGS_DEBUG ${CMAKE_C_FLAGS_DEBUG})
115     endif()
116 endmacro()
117 
118 macro(CONAN_OUTPUT_DIRS_SETUP)
119     set(CMAKE_RUNTIME_OUTPUT_DIRECTORY ${CMAKE_CURRENT_BINARY_DIR}/bin)
120     set(CMAKE_RUNTIME_OUTPUT_DIRECTORY_RELEASE ${CMAKE_RUNTIME_OUTPUT_DIRECTORY})
121     set(CMAKE_RUNTIME_OUTPUT_DIRECTORY_DEBUG ${CMAKE_RUNTIME_OUTPUT_DIRECTORY})
122 
123     set(CMAKE_ARCHIVE_OUTPUT_DIRECTORY ${CMAKE_CURRENT_BINARY_DIR}/lib)
124     set(CMAKE_ARCHIVE_OUTPUT_DIRECTORY_RELEASE ${CMAKE_ARCHIVE_OUTPUT_DIRECTORY})
125     set(CMAKE_ARCHIVE_OUTPUT_DIRECTORY_DEBUG ${CMAKE_ARCHIVE_OUTPUT_DIRECTORY})
126 endmacro()
127 
128 macro(CONAN_SPLIT_VERSION VERSION_STRING MAJOR MINOR)
129     #make a list from the version string
130     string(REPLACE "." ";" VERSION_LIST ${${VERSION_STRING}})
131 
132     #write output values
133     list(GET VERSION_LIST 0 ${MAJOR})
134     list(GET VERSION_LIST 1 ${MINOR})
135 endmacro()
136 
137 macro(ERROR_COMPILER_VERSION)
138     message(FATAL_ERROR "Incorrect '${CONAN_COMPILER}' version 'compiler.version=${CONAN_COMPILER_VERSION}'"
139                         " is not the one detected by CMake: '${CMAKE_CXX_COMPILER_ID}="${VERSION_MAJOR}.${VERSION_MINOR}')
140 endmacro()
141 
142 macro(CHECK_COMPILER_VERSION)
143 
144     CONAN_SPLIT_VERSION(CMAKE_CXX_COMPILER_VERSION VERSION_MAJOR VERSION_MINOR)
145 
146     if("${CMAKE_CXX_COMPILER_ID}" STREQUAL "MSVC")
147         # https://cmake.org/cmake/help/v3.2/variable/MSVC_VERSION.html
148         if( (${CONAN_COMPILER_VERSION} STREQUAL "14" AND NOT ${VERSION_MAJOR} STREQUAL "19") OR
149             (${CONAN_COMPILER_VERSION} STREQUAL "12" AND NOT ${VERSION_MAJOR} STREQUAL "18") OR
150             (${CONAN_COMPILER_VERSION} STREQUAL "11" AND NOT ${VERSION_MAJOR} STREQUAL "17") OR
151             (${CONAN_COMPILER_VERSION} STREQUAL "10" AND NOT ${VERSION_MAJOR} STREQUAL "16") OR
152             (${CONAN_COMPILER_VERSION} STREQUAL "9" AND NOT ${VERSION_MAJOR} STREQUAL "15") OR
153             (${CONAN_COMPILER_VERSION} STREQUAL "8" AND NOT ${VERSION_MAJOR} STREQUAL "14") OR
154             (${CONAN_COMPILER_VERSION} STREQUAL "7" AND NOT ${VERSION_MAJOR} STREQUAL "13") OR
155             (${CONAN_COMPILER_VERSION} STREQUAL "6" AND NOT ${VERSION_MAJOR} STREQUAL "12") )
156             ERROR_COMPILER_VERSION()
157         endif()
158     elseif("${CONAN_COMPILER}" STREQUAL "gcc" OR "${CONAN_COMPILER}" MATCHES "Clang")
159         if(NOT ${VERSION_MAJOR}.${VERSION_MINOR} VERSION_EQUAL "${CONAN_COMPILER_VERSION}")
160            ERROR_COMPILER_VERSION()
161         endif()
162     else()
163         message("Skipping version checking of not detected compiler...")
164     endif()
165 endmacro()
166 
167 macro(CONAN_CHECK_COMPILER)
168     if( ("${CONAN_COMPILER}" STREQUAL "Visual Studio" AND NOT "${CMAKE_CXX_COMPILER_ID}" STREQUAL "MSVC") OR
169         ("${CONAN_COMPILER}" STREQUAL "gcc" AND NOT "${CMAKE_CXX_COMPILER_ID}" STREQUAL "GNU") OR
170         ("${CONAN_COMPILER}" STREQUAL "apple-clang" AND (NOT APPLE OR NOT ${CMAKE_CXX_COMPILER_ID} MATCHES "Clang")) OR
171         ("${CONAN_COMPILER}" STREQUAL "clang" AND NOT ${CMAKE_CXX_COMPILER_ID} MATCHES "Clang") )
172         message(FATAL_ERROR "Incorrect '${CONAN_COMPILER}', is not the one detected by CMake: '${CMAKE_CXX_COMPILER_ID}'")
173     endif()
174     CHECK_COMPILER_VERSION()
175 endmacro()
176 """
177
```
--- END FILES ---

Please first localize the bug based on the issue statement, and then generate a patch according to the `git diff` format fenced by three backticks.

Here is an example:

```diff
diff --git a/examples/server_async.py b/examples/server_async.py
--- a/examples/server_async.py
+++ b/examples/server_async.py
@@ -313,4 +313,4 @@
 
 
 if __name__ == "__main__":
-    asyncio.run(run_async_server("."), debug=True)
+    asyncio.run(run_async_server(), debug=True)
diff --git a/examples/server_sync.py b/examples/server_sync.py
--- a/examples/server_sync.py
+++ b/examples/server_sync.py
@@ -313,5 +313,5 @@
 
 
 if __name__ == "__main__":
-    server = run_sync_server(".")
+    server = run_sync_server()
     server.shutdown()

```

diff --git a/conans/client/generators/cmake.py b/conans/client/generators/cmake.py
--- a/conans/client/generators/cmake.py
+++ b/conans/client/generators/cmake.py
@@ -82,7 +82,7 @@
 endmacro()
 
 macro(CONAN_FLAGS_SETUP)
-    include_directories(${CONAN_INCLUDE_DIRS})
+    include_directories(SYSTEM ${CONAN_INCLUDE_DIRS})
     link_directories(${CONAN_LIB_DIRS})
     add_definitions(${CONAN_DEFINES})

{"golden_diff": "diff --git a/conans/client/generators/cmake.py b/conans/client/generators/cmake.py\n--- a/conans/client/generators/cmake.py\n+++ b/conans/client/generators/cmake.py\n@@ -82,7 +82,7 @@\n endmacro()\n \n macro(CONAN_FLAGS_SETUP)\n-    include_directories(${CONAN_INCLUDE_DIRS})\n+    include_directories(SYSTEM ${CONAN_INCLUDE_DIRS})\n     link_directories(${CONAN_LIB_DIRS})\n     add_definitions(${CONAN_DEFINES})\n", "issue": "mark headers as \"SYSTEM\" headers to silence warnings\nMany libraries generate tons of warnings in public headers. WebSocket++ uses auto_ptr for example and many Boost libraries truncate integers implicitly (-Wconversion). To consume these libraries you have to treat them as system headers because GCC won't emit warnings in these.\n\nThis is how Conan currently sets the include directories:\n\n``` CMake\ninclude_directories(${CONAN_INCLUDE_DIRS})\n```\n\nThis is how you would add them as \"system\" headers to silence warnings:\n\n``` CMake\ninclude_directories(SYSTEM ${CONAN_INCLUDE_DIRS})\n```\n\nIs there a reason it is not already done this way?\nThis issue may apply to configurations other than CMake/GCC, too, but this is the most important one for me.\n\n", "before_files": [{"content": "from conans.model import Generator\nfrom conans.paths import BUILD_INFO_CMAKE\n\n\nclass DepsCppCmake(object):\n    def __init__(self, deps_cpp_info):\n        self.include_paths = \"\\n\\t\\t\\t\".join('\"%s\"' % p.replace(\"\\\\\", \"/\")\n                                             for p in deps_cpp_info.include_paths)\n        self.lib_paths = \"\\n\\t\\t\\t\".join('\"%s\"' % p.replace(\"\\\\\", \"/\")\n                                         for p in deps_cpp_info.lib_paths)\n        self.libs = \" \".join(deps_cpp_info.libs)\n        self.defines = \"\\n\\t\\t\\t\".join(\"-D%s\" % d for d in deps_cpp_info.defines)\n        self.cppflags = \" \".join(deps_cpp_info.cppflags)\n        self.cflags = \" \".join(deps_cpp_info.cflags)\n        self.sharedlinkflags = \" \".join(deps_cpp_info.sharedlinkflags)\n        self.exelinkflags = \" \".join(deps_cpp_info.exelinkflags)\n        self.bin_paths = \"\\n\\t\\t\\t\".join('\"%s\"' % p.replace(\"\\\\\", \"/\")\n                                         for p in deps_cpp_info.bin_paths)\n\n        self.rootpath = '\"%s\"' % deps_cpp_info.rootpath.replace(\"\\\\\", \"/\")\n\n\nclass CMakeGenerator(Generator):\n    @property\n    def filename(self):\n        return BUILD_INFO_CMAKE\n\n    @property\n    def content(self):\n        sections = []\n\n        # DEPS VARIABLES\n        template_dep = ('set(CONAN_{dep}_ROOT {deps.rootpath})\\n'\n                        'set(CONAN_INCLUDE_DIRS_{dep} {deps.include_paths})\\n'\n                        'set(CONAN_LIB_DIRS_{dep} {deps.lib_paths})\\n'\n                        'set(CONAN_BIN_DIRS_{dep} {deps.bin_paths})\\n'\n                        'set(CONAN_LIBS_{dep} {deps.libs})\\n'\n                        'set(CONAN_DEFINES_{dep} {deps.defines})\\n'\n                        'set(CONAN_CXX_FLAGS_{dep} \"{deps.cppflags}\")\\n'\n                        'set(CONAN_SHARED_LINKER_FLAGS_{dep} \"{deps.sharedlinkflags}\")\\n'\n                        'set(CONAN_EXE_LINKER_FLAGS_{dep} \"{deps.exelinkflags}\")\\n'\n                        'set(CONAN_C_FLAGS_{dep} \"{deps.cflags}\")\\n')\n\n        for dep_name, dep_cpp_info in self.deps_build_info.dependencies:\n            deps = DepsCppCmake(dep_cpp_info)\n            dep_flags = template_dep.format(dep=dep_name.upper(),\n                                            deps=deps)\n            sections.append(dep_flags)\n\n        # GENERAL VARIABLES\n        deps = DepsCppCmake(self.deps_build_info)\n\n        template = ('set(CONAN_INCLUDE_DIRS {deps.include_paths} ${{CONAN_INCLUDE_DIRS}})\\n'\n            'set(CONAN_LIB_DIRS {deps.lib_paths} ${{CONAN_LIB_DIRS}})\\n'\n            'set(CONAN_BIN_DIRS {deps.bin_paths} ${{CONAN_BIN_DIRS}})\\n'\n            'set(CONAN_LIBS {deps.libs} ${{CONAN_LIBS}})\\n'\n            'set(CONAN_DEFINES {deps.defines} ${{CONAN_DEFINES}})\\n'\n            'set(CONAN_CXX_FLAGS \"{deps.cppflags} ${{CONAN_CXX_FLAGS}}\")\\n'\n            'set(CONAN_SHARED_LINKER_FLAGS \"{deps.sharedlinkflags} ${{CONAN_SHARED_LINKER_FLAGS}}\")\\n'\n            'set(CONAN_EXE_LINKER_FLAGS \"{deps.exelinkflags} ${{CONAN_EXE_LINKER_FLAGS}}\")\\n'\n            'set(CONAN_C_FLAGS \"{deps.cflags} ${{CONAN_C_FLAGS}}\")\\n'\n            'set(CONAN_CMAKE_MODULE_PATH {module_paths} ${{CONAN_CMAKE_MODULE_PATH}})')\n\n        rootpaths = [DepsCppCmake(dep_cpp_info).rootpath for _, dep_cpp_info\n                     in self.deps_build_info.dependencies]\n        module_paths = \" \".join(rootpaths)\n        all_flags = template.format(deps=deps, module_paths=module_paths)\n        sections.append(all_flags)\n\n        # MACROS\n        sections.append(self._aux_cmake_test_setup())\n\n        return \"\\n\".join(sections)\n\n    def _aux_cmake_test_setup(self):\n        return \"\"\"macro(CONAN_BASIC_SETUP)\n    conan_check_compiler()\n    conan_output_dirs_setup()\n    conan_flags_setup()\n    # CMake can find findXXX.cmake files in the root of packages\n    set(CMAKE_MODULE_PATH ${CONAN_CMAKE_MODULE_PATH} ${CMAKE_MODULE_PATH})\nendmacro()\n\nmacro(CONAN_FLAGS_SETUP)\n    include_directories(${CONAN_INCLUDE_DIRS})\n    link_directories(${CONAN_LIB_DIRS})\n    add_definitions(${CONAN_DEFINES})\n\n    # For find_library\n    set(CMAKE_INCLUDE_PATH ${CONAN_INCLUDE_DIRS} ${CMAKE_INCLUDE_PATH})\n    set(CMAKE_LIBRARY_PATH ${CONAN_LIB_DIRS} ${CMAKE_LIBRARY_PATH})\n\n    set(CMAKE_CXX_FLAGS \"${CMAKE_CXX_FLAGS} ${CONAN_CXX_FLAGS}\")\n    set(CMAKE_C_FLAGS \"${CMAKE_C_FLAGS} ${CONAN_C_FLAGS}\")\n    set(CMAKE_SHARED_LINKER_FLAGS \"${CMAKE_SHARED_LINKER_FLAGS} ${CONAN_SHARED_LINKER_FLAGS}\")\n    set(CMAKE_EXE_LINKER_FLAGS \"${CMAKE_EXE_LINKER_FLAGS} ${CONAN_EXE_LINKER_FLAGS}\")\n\n    if(APPLE)\n        # https://cmake.org/Wiki/CMake_RPATH_handling\n        # CONAN GUIDE: All generated libraries should have the id and dependencies to other\n        # dylibs without path, just the name, EX:\n        # libMyLib1.dylib:\n        #     libMyLib1.dylib (compatibility version 0.0.0, current version 0.0.0)\n        #     libMyLib0.dylib (compatibility version 0.0.0, current version 0.0.0)\n        #     /usr/lib/libc++.1.dylib (compatibility version 1.0.0, current version 120.0.0)\n        #     /usr/lib/libSystem.B.dylib (compatibility version 1.0.0, current version 1197.1.1)\n        set(CMAKE_SKIP_RPATH 1)  # AVOID RPATH FOR *.dylib, ALL LIBS BETWEEN THEM AND THE EXE\n                                 # SHOULD BE ON THE LINKER RESOLVER PATH (./ IS ONE OF THEM)\n    endif()\n    if(CONAN_LINK_RUNTIME)\n        string(REPLACE \"/MD\" ${CONAN_LINK_RUNTIME} CMAKE_CXX_FLAGS_RELEASE ${CMAKE_CXX_FLAGS_RELEASE})\n        string(REPLACE \"/MDd\" ${CONAN_LINK_RUNTIME} CMAKE_CXX_FLAGS_DEBUG ${CMAKE_CXX_FLAGS_DEBUG})\n        string(REPLACE \"/MD\" ${CONAN_LINK_RUNTIME} CMAKE_C_FLAGS_RELEASE ${CMAKE_C_FLAGS_RELEASE})\n        string(REPLACE \"/MDd\" ${CONAN_LINK_RUNTIME} CMAKE_C_FLAGS_DEBUG ${CMAKE_C_FLAGS_DEBUG})\n    endif()\nendmacro()\n\nmacro(CONAN_OUTPUT_DIRS_SETUP)\n    set(CMAKE_RUNTIME_OUTPUT_DIRECTORY ${CMAKE_CURRENT_BINARY_DIR}/bin)\n    set(CMAKE_RUNTIME_OUTPUT_DIRECTORY_RELEASE ${CMAKE_RUNTIME_OUTPUT_DIRECTORY})\n    set(CMAKE_RUNTIME_OUTPUT_DIRECTORY_DEBUG ${CMAKE_RUNTIME_OUTPUT_DIRECTORY})\n\n    set(CMAKE_ARCHIVE_OUTPUT_DIRECTORY ${CMAKE_CURRENT_BINARY_DIR}/lib)\n    set(CMAKE_ARCHIVE_OUTPUT_DIRECTORY_RELEASE ${CMAKE_ARCHIVE_OUTPUT_DIRECTORY})\n    set(CMAKE_ARCHIVE_OUTPUT_DIRECTORY_DEBUG ${CMAKE_ARCHIVE_OUTPUT_DIRECTORY})\nendmacro()\n\nmacro(CONAN_SPLIT_VERSION VERSION_STRING MAJOR MINOR)\n    #make a list from the version string\n    string(REPLACE \".\" \";\" VERSION_LIST ${${VERSION_STRING}})\n\n    #write output values\n    list(GET VERSION_LIST 0 ${MAJOR})\n    list(GET VERSION_LIST 1 ${MINOR})\nendmacro()\n\nmacro(ERROR_COMPILER_VERSION)\n    message(FATAL_ERROR \"Incorrect '${CONAN_COMPILER}' version 'compiler.version=${CONAN_COMPILER_VERSION}'\"\n                        \" is not the one detected by CMake: '${CMAKE_CXX_COMPILER_ID}=\"${VERSION_MAJOR}.${VERSION_MINOR}')\nendmacro()\n\nmacro(CHECK_COMPILER_VERSION)\n\n    CONAN_SPLIT_VERSION(CMAKE_CXX_COMPILER_VERSION VERSION_MAJOR VERSION_MINOR)\n\n    if(\"${CMAKE_CXX_COMPILER_ID}\" STREQUAL \"MSVC\")\n        # https://cmake.org/cmake/help/v3.2/variable/MSVC_VERSION.html\n        if( (${CONAN_COMPILER_VERSION} STREQUAL \"14\" AND NOT ${VERSION_MAJOR} STREQUAL \"19\") OR\n            (${CONAN_COMPILER_VERSION} STREQUAL \"12\" AND NOT ${VERSION_MAJOR} STREQUAL \"18\") OR\n            (${CONAN_COMPILER_VERSION} STREQUAL \"11\" AND NOT ${VERSION_MAJOR} STREQUAL \"17\") OR\n            (${CONAN_COMPILER_VERSION} STREQUAL \"10\" AND NOT ${VERSION_MAJOR} STREQUAL \"16\") OR\n            (${CONAN_COMPILER_VERSION} STREQUAL \"9\" AND NOT ${VERSION_MAJOR} STREQUAL \"15\") OR\n            (${CONAN_COMPILER_VERSION} STREQUAL \"8\" AND NOT ${VERSION_MAJOR} STREQUAL \"14\") OR\n            (${CONAN_COMPILER_VERSION} STREQUAL \"7\" AND NOT ${VERSION_MAJOR} STREQUAL \"13\") OR\n            (${CONAN_COMPILER_VERSION} STREQUAL \"6\" AND NOT ${VERSION_MAJOR} STREQUAL \"12\") )\n            ERROR_COMPILER_VERSION()\n        endif()\n    elseif(\"${CONAN_COMPILER}\" STREQUAL \"gcc\" OR \"${CONAN_COMPILER}\" MATCHES \"Clang\")\n        if(NOT ${VERSION_MAJOR}.${VERSION_MINOR} VERSION_EQUAL \"${CONAN_COMPILER_VERSION}\")\n           ERROR_COMPILER_VERSION()\n        endif()\n    else()\n        message(\"Skipping version checking of not detected compiler...\")\n    endif()\nendmacro()\n\nmacro(CONAN_CHECK_COMPILER)\n    if( (\"${CONAN_COMPILER}\" STREQUAL \"Visual Studio\" AND NOT \"${CMAKE_CXX_COMPILER_ID}\" STREQUAL \"MSVC\") OR\n        (\"${CONAN_COMPILER}\" STREQUAL \"gcc\" AND NOT \"${CMAKE_CXX_COMPILER_ID}\" STREQUAL \"GNU\") OR\n        (\"${CONAN_COMPILER}\" STREQUAL \"apple-clang\" AND (NOT APPLE OR NOT ${CMAKE_CXX_COMPILER_ID} MATCHES \"Clang\")) OR\n        (\"${CONAN_COMPILER}\" STREQUAL \"clang\" AND NOT ${CMAKE_CXX_COMPILER_ID} MATCHES \"Clang\") )\n        message(FATAL_ERROR \"Incorrect '${CONAN_COMPILER}', is not the one detected by CMake: '${CMAKE_CXX_COMPILER_ID}'\")\n    endif()\n    CHECK_COMPILER_VERSION()\nendmacro()\n\"\"\"\n", "path": "conans/client/generators/cmake.py"}], "after_files": [{"content": "from conans.model import Generator\nfrom conans.paths import BUILD_INFO_CMAKE\n\n\nclass DepsCppCmake(object):\n    def __init__(self, deps_cpp_info):\n        self.include_paths = \"\\n\\t\\t\\t\".join('\"%s\"' % p.replace(\"\\\\\", \"/\")\n                                             for p in deps_cpp_info.include_paths)\n        self.lib_paths = \"\\n\\t\\t\\t\".join('\"%s\"' % p.replace(\"\\\\\", \"/\")\n                                         for p in deps_cpp_info.lib_paths)\n        self.libs = \" \".join(deps_cpp_info.libs)\n        self.defines = \"\\n\\t\\t\\t\".join(\"-D%s\" % d for d in deps_cpp_info.defines)\n        self.cppflags = \" \".join(deps_cpp_info.cppflags)\n        self.cflags = \" \".join(deps_cpp_info.cflags)\n        self.sharedlinkflags = \" \".join(deps_cpp_info.sharedlinkflags)\n        self.exelinkflags = \" \".join(deps_cpp_info.exelinkflags)\n        self.bin_paths = \"\\n\\t\\t\\t\".join('\"%s\"' % p.replace(\"\\\\\", \"/\")\n                                         for p in deps_cpp_info.bin_paths)\n\n        self.rootpath = '\"%s\"' % deps_cpp_info.rootpath.replace(\"\\\\\", \"/\")\n\n\nclass CMakeGenerator(Generator):\n    @property\n    def filename(self):\n        return BUILD_INFO_CMAKE\n\n    @property\n    def content(self):\n        sections = []\n\n        # DEPS VARIABLES\n        template_dep = ('set(CONAN_{dep}_ROOT {deps.rootpath})\\n'\n                        'set(CONAN_INCLUDE_DIRS_{dep} {deps.include_paths})\\n'\n                        'set(CONAN_LIB_DIRS_{dep} {deps.lib_paths})\\n'\n                        'set(CONAN_BIN_DIRS_{dep} {deps.bin_paths})\\n'\n                        'set(CONAN_LIBS_{dep} {deps.libs})\\n'\n                        'set(CONAN_DEFINES_{dep} {deps.defines})\\n'\n                        'set(CONAN_CXX_FLAGS_{dep} \"{deps.cppflags}\")\\n'\n                        'set(CONAN_SHARED_LINKER_FLAGS_{dep} \"{deps.sharedlinkflags}\")\\n'\n                        'set(CONAN_EXE_LINKER_FLAGS_{dep} \"{deps.exelinkflags}\")\\n'\n                        'set(CONAN_C_FLAGS_{dep} \"{deps.cflags}\")\\n')\n\n        for dep_name, dep_cpp_info in self.deps_build_info.dependencies:\n            deps = DepsCppCmake(dep_cpp_info)\n            dep_flags = template_dep.format(dep=dep_name.upper(),\n                                            deps=deps)\n            sections.append(dep_flags)\n\n        # GENERAL VARIABLES\n        deps = DepsCppCmake(self.deps_build_info)\n\n        template = ('set(CONAN_INCLUDE_DIRS {deps.include_paths} ${{CONAN_INCLUDE_DIRS}})\\n'\n            'set(CONAN_LIB_DIRS {deps.lib_paths} ${{CONAN_LIB_DIRS}})\\n'\n            'set(CONAN_BIN_DIRS {deps.bin_paths} ${{CONAN_BIN_DIRS}})\\n'\n            'set(CONAN_LIBS {deps.libs} ${{CONAN_LIBS}})\\n'\n            'set(CONAN_DEFINES {deps.defines} ${{CONAN_DEFINES}})\\n'\n            'set(CONAN_CXX_FLAGS \"{deps.cppflags} ${{CONAN_CXX_FLAGS}}\")\\n'\n            'set(CONAN_SHARED_LINKER_FLAGS \"{deps.sharedlinkflags} ${{CONAN_SHARED_LINKER_FLAGS}}\")\\n'\n            'set(CONAN_EXE_LINKER_FLAGS \"{deps.exelinkflags} ${{CONAN_EXE_LINKER_FLAGS}}\")\\n'\n            'set(CONAN_C_FLAGS \"{deps.cflags} ${{CONAN_C_FLAGS}}\")\\n'\n            'set(CONAN_CMAKE_MODULE_PATH {module_paths} ${{CONAN_CMAKE_MODULE_PATH}})')\n\n        rootpaths = [DepsCppCmake(dep_cpp_info).rootpath for _, dep_cpp_info\n                     in self.deps_build_info.dependencies]\n        module_paths = \" \".join(rootpaths)\n        all_flags = template.format(deps=deps, module_paths=module_paths)\n        sections.append(all_flags)\n\n        # MACROS\n        sections.append(self._aux_cmake_test_setup())\n\n        return \"\\n\".join(sections)\n\n    def _aux_cmake_test_setup(self):\n        return \"\"\"macro(CONAN_BASIC_SETUP)\n    conan_check_compiler()\n    conan_output_dirs_setup()\n    conan_flags_setup()\n    # CMake can find findXXX.cmake files in the root of packages\n    set(CMAKE_MODULE_PATH ${CONAN_CMAKE_MODULE_PATH} ${CMAKE_MODULE_PATH})\nendmacro()\n\nmacro(CONAN_FLAGS_SETUP)\n    include_directories(SYSTEM ${CONAN_INCLUDE_DIRS})\n    link_directories(${CONAN_LIB_DIRS})\n    add_definitions(${CONAN_DEFINES})\n\n    # For find_library\n    set(CMAKE_INCLUDE_PATH ${CONAN_INCLUDE_DIRS} ${CMAKE_INCLUDE_PATH})\n    set(CMAKE_LIBRARY_PATH ${CONAN_LIB_DIRS} ${CMAKE_LIBRARY_PATH})\n\n    set(CMAKE_CXX_FLAGS \"${CMAKE_CXX_FLAGS} ${CONAN_CXX_FLAGS}\")\n    set(CMAKE_C_FLAGS \"${CMAKE_C_FLAGS} ${CONAN_C_FLAGS}\")\n    set(CMAKE_SHARED_LINKER_FLAGS \"${CMAKE_SHARED_LINKER_FLAGS} ${CONAN_SHARED_LINKER_FLAGS}\")\n    set(CMAKE_EXE_LINKER_FLAGS \"${CMAKE_EXE_LINKER_FLAGS} ${CONAN_EXE_LINKER_FLAGS}\")\n\n    if(APPLE)\n        # https://cmake.org/Wiki/CMake_RPATH_handling\n        # CONAN GUIDE: All generated libraries should have the id and dependencies to other\n        # dylibs without path, just the name, EX:\n        # libMyLib1.dylib:\n        #     libMyLib1.dylib (compatibility version 0.0.0, current version 0.0.0)\n        #     libMyLib0.dylib (compatibility version 0.0.0, current version 0.0.0)\n        #     /usr/lib/libc++.1.dylib (compatibility version 1.0.0, current version 120.0.0)\n        #     /usr/lib/libSystem.B.dylib (compatibility version 1.0.0, current version 1197.1.1)\n        set(CMAKE_SKIP_RPATH 1)  # AVOID RPATH FOR *.dylib, ALL LIBS BETWEEN THEM AND THE EXE\n                                 # SHOULD BE ON THE LINKER RESOLVER PATH (./ IS ONE OF THEM)\n    endif()\n    if(CONAN_LINK_RUNTIME)\n        string(REPLACE \"/MD\" ${CONAN_LINK_RUNTIME} CMAKE_CXX_FLAGS_RELEASE ${CMAKE_CXX_FLAGS_RELEASE})\n        string(REPLACE \"/MDd\" ${CONAN_LINK_RUNTIME} CMAKE_CXX_FLAGS_DEBUG ${CMAKE_CXX_FLAGS_DEBUG})\n        string(REPLACE \"/MD\" ${CONAN_LINK_RUNTIME} CMAKE_C_FLAGS_RELEASE ${CMAKE_C_FLAGS_RELEASE})\n        string(REPLACE \"/MDd\" ${CONAN_LINK_RUNTIME} CMAKE_C_FLAGS_DEBUG ${CMAKE_C_FLAGS_DEBUG})\n    endif()\nendmacro()\n\nmacro(CONAN_OUTPUT_DIRS_SETUP)\n    set(CMAKE_RUNTIME_OUTPUT_DIRECTORY ${CMAKE_CURRENT_BINARY_DIR}/bin)\n    set(CMAKE_RUNTIME_OUTPUT_DIRECTORY_RELEASE ${CMAKE_RUNTIME_OUTPUT_DIRECTORY})\n    set(CMAKE_RUNTIME_OUTPUT_DIRECTORY_DEBUG ${CMAKE_RUNTIME_OUTPUT_DIRECTORY})\n\n    set(CMAKE_ARCHIVE_OUTPUT_DIRECTORY ${CMAKE_CURRENT_BINARY_DIR}/lib)\n    set(CMAKE_ARCHIVE_OUTPUT_DIRECTORY_RELEASE ${CMAKE_ARCHIVE_OUTPUT_DIRECTORY})\n    set(CMAKE_ARCHIVE_OUTPUT_DIRECTORY_DEBUG ${CMAKE_ARCHIVE_OUTPUT_DIRECTORY})\nendmacro()\n\nmacro(CONAN_SPLIT_VERSION VERSION_STRING MAJOR MINOR)\n    #make a list from the version string\n    string(REPLACE \".\" \";\" VERSION_LIST ${${VERSION_STRING}})\n\n    #write output values\n    list(GET VERSION_LIST 0 ${MAJOR})\n    list(GET VERSION_LIST 1 ${MINOR})\nendmacro()\n\nmacro(ERROR_COMPILER_VERSION)\n    message(FATAL_ERROR \"Incorrect '${CONAN_COMPILER}' version 'compiler.version=${CONAN_COMPILER_VERSION}'\"\n                        \" is not the one detected by CMake: '${CMAKE_CXX_COMPILER_ID}=\"${VERSION_MAJOR}.${VERSION_MINOR}')\nendmacro()\n\nmacro(CHECK_COMPILER_VERSION)\n\n    CONAN_SPLIT_VERSION(CMAKE_CXX_COMPILER_VERSION VERSION_MAJOR VERSION_MINOR)\n\n    if(\"${CMAKE_CXX_COMPILER_ID}\" STREQUAL \"MSVC\")\n        # https://cmake.org/cmake/help/v3.2/variable/MSVC_VERSION.html\n        if( (${CONAN_COMPILER_VERSION} STREQUAL \"14\" AND NOT ${VERSION_MAJOR} STREQUAL \"19\") OR\n            (${CONAN_COMPILER_VERSION} STREQUAL \"12\" AND NOT ${VERSION_MAJOR} STREQUAL \"18\") OR\n            (${CONAN_COMPILER_VERSION} STREQUAL \"11\" AND NOT ${VERSION_MAJOR} STREQUAL \"17\") OR\n            (${CONAN_COMPILER_VERSION} STREQUAL \"10\" AND NOT ${VERSION_MAJOR} STREQUAL \"16\") OR\n            (${CONAN_COMPILER_VERSION} STREQUAL \"9\" AND NOT ${VERSION_MAJOR} STREQUAL \"15\") OR\n            (${CONAN_COMPILER_VERSION} STREQUAL \"8\" AND NOT ${VERSION_MAJOR} STREQUAL \"14\") OR\n            (${CONAN_COMPILER_VERSION} STREQUAL \"7\" AND NOT ${VERSION_MAJOR} STREQUAL \"13\") OR\n            (${CONAN_COMPILER_VERSION} STREQUAL \"6\" AND NOT ${VERSION_MAJOR} STREQUAL \"12\") )\n            ERROR_COMPILER_VERSION()\n        endif()\n    elseif(\"${CONAN_COMPILER}\" STREQUAL \"gcc\" OR \"${CONAN_COMPILER}\" MATCHES \"Clang\")\n        if(NOT ${VERSION_MAJOR}.${VERSION_MINOR} VERSION_EQUAL \"${CONAN_COMPILER_VERSION}\")\n           ERROR_COMPILER_VERSION()\n        endif()\n    else()\n        message(\"Skipping version checking of not detected compiler...\")\n    endif()\nendmacro()\n\nmacro(CONAN_CHECK_COMPILER)\n    if( (\"${CONAN_COMPILER}\" STREQUAL \"Visual Studio\" AND NOT \"${CMAKE_CXX_COMPILER_ID}\" STREQUAL \"MSVC\") OR\n        (\"${CONAN_COMPILER}\" STREQUAL \"gcc\" AND NOT \"${CMAKE_CXX_COMPILER_ID}\" STREQUAL \"GNU\") OR\n        (\"${CONAN_COMPILER}\" STREQUAL \"apple-clang\" AND (NOT APPLE OR NOT ${CMAKE_CXX_COMPILER_ID} MATCHES \"Clang\")) OR\n        (\"${CONAN_COMPILER}\" STREQUAL \"clang\" AND NOT ${CMAKE_CXX_COMPILER_ID} MATCHES \"Clang\") )\n        message(FATAL_ERROR \"Incorrect '${CONAN_COMPILER}', is not the one detected by CMake: '${CMAKE_CXX_COMPILER_ID}'\")\n    endif()\n    CHECK_COMPILER_VERSION()\nendmacro()\n\"\"\"\n", "path": "conans/client/generators/cmake.py"}]}