cmake parse error :Invalid escape sequence \o - cmake

I have a lot of similar error alert info like this type:
CMake Warning (dev) at cmake/common.cmake:5 (source_group):
Syntax error in cmake code at
C:/yumen/wxgisgdal-read-only/cmake/common.cmake:5
when parsing string
Header Files\\ogr\ogrsf_frmts
Invalid escape sequence \o
The file C:/yumen/wxgisgdal-read-only/cmake/common.cmake is
like is:
#add data
macro(add_files_macro FPATH FGROUP)
file(GLOB GDAL_AHHEADERS ${FPATH}/*.h ${FPATH}/*.hpp)
set(GDAL_HHEADERS ${GDAL_HHEADERS} ${GDAL_AHHEADERS})
source_group("Header Files\\${FGROUP}" FILES ${GDAL_AHHEADERS})
file(GLOB GDAL_ACSOURCES ${FPATH}/*.cpp ${FPATH}/*.cc ${FPATH}/*.c)
set(GDAL_CSOURCES ${GDAL_CSOURCES} ${GDAL_ACSOURCES})
source_group("Source Files\\${FGROUP}" FILES ${GDAL_ACSOURCES})
endmacro()
Below is the CMake error info:
gdal version=[1.9.0]
GDAL lib name ... wxgisgdal19
c++ compiler ... cl
CMake Error at CMakeLists.txt:92 (option):
option called with incorrect number of arguments: BUILD_RELEASE_DEBUG_DIRS
Set OFF to build each co# uninstall target
configure_file(
C:/yumen/wxgisgdal-read-only/cmake_uninstall.cmake.in
C:/yumen/wxgisgdal-read-only/build/cmake_uninstall.cmake
IMMEDIATE #ONLY)nfiguration to a separate directory ON
Found GEOS: C:/geos-3.2.3/lib/geosd.lib
Found Proj: C:/PROJ/lib/proj.lib
CMake Warning (dev) at cmake/common.cmake:5 (source_group):
Syntax error in cmake code at
C:/yumen/wxgisgdal-read-only/cmake/common.cmake:5
when parsing string
Header Files\\ogr\ogrsf_frmts
Invalid escape sequence \o
Policy CMP0010 is not set: Bad variable reference syntax is an error. Run
"cmake --help-policy CMP0010" for policy details. Use the cmake_policy
command to set the policy and suppress this warning.
Call Stack (most recent call first):
cmake/ogr.cmake:121 (add_files_macro)
CMakeLists.txt:135 (include)
This warning is for project developers. Use -Wno-dev to suppress it.
CMake Warning (dev) at cmake/common.cmake:8 (source_group):
Syntax error in cmake code at
C:/yumen/wxgisgdal-read-only/cmake/common.cmake:8
when parsing string
Source Files\\ogr\ogrsf_frmts
Invalid escape sequence \o
Policy CMP0010 is not set: Bad variable reference syntax is an error. Run
"cmake --help-policy CMP0010" for policy details. Use the cmake_policy
command to set the policy and suppress this warning.
Call Stack (most recent call first):
cmake/ogr.cmake:121 (add_files_macro)
CMakeLists.txt:135 (include)
This warning is for project developers. Use -Wno-dev to suppress it.
CMake Warning (dev) at cmake/common.cmake:5 (source_group):
Syntax error in cmake code at
C:/yumen/wxgisgdal-read-only/cmake/common.cmake:5
when parsing string
Header Files\\ogr\ogrsf_frmts\generic
Invalid escape sequence \o
Policy CMP0010 is not set: Bad variable reference syntax is an error. Run
"cmake --help-policy CMP0010" for policy details. Use the cmake_policy
command to set the policy and suppress this warning.
Call Stack (most recent call first):
cmake/ogr.cmake:122 (add_files_macro)
CMakeLists.txt:135 (include)
This warning is for project developers. Use -Wno-dev to suppress it.
CMake Warning (dev) at cmake/common.cmake:8 (source_group):
Syntax error in cmake code at
C:/yumen/wxgisgdal-read-only/cmake/common.cmake:8
when parsing string
Source Files\\ogr\ogrsf_frmts\generic
Invalid escape sequence \o
Policy CMP0010 is not set: Bad variable reference syntax is an error. Run
"cmake --help-policy CMP0010" for policy details. Use the cmake_policy
command to set the policy and suppress this warning.
Call Stack (most recent call first):
cmake/ogr.cmake:122 (add_files_macro)
CMakeLists.txt:135 (include)
This warning is for project developers. Use -Wno-dev to suppress it.
CMake Warning (dev) at cmake/common.cmake:5 (source_group):
Syntax error in cmake code at
C:/yumen/wxgisgdal-read-only/cmake/common.cmake:5
when parsing string
Header Files\\ogr\ogrsf_frmts\mem
Invalid escape sequence \o
Policy CMP0010 is not set: Bad variable reference syntax is an error. Run
"cmake --help-policy CMP0010" for policy details. Use the cmake_policy
command to set the policy and suppress this warning.
Call Stack (most recent call first):
cmake/ogr.cmake:125 (add_files_macro)
CMakeLists.txt:135 (include)
This warning is for project developers. Use -Wno-dev to suppress it.
CMake Warning (dev) at cmake/common.cmake:8 (source_group):
Syntax error in cmake code at
C:/yumen/wxgisgdal-read-only/cmake/common.cmake:8
when parsing string
Source Files\\ogr\ogrsf_frmts\mem
Invalid escape sequence \o
Policy CMP0010 is not set: Bad variable reference syntax is an error. Run
"cmake --help-policy CMP0010" for policy details. Use the cmake_policy
command to set the policy and suppress this warning.
Call Stack (most recent call first):
cmake/ogr.cmake:125 (add_files_macro)
CMakeLists.txt:135 (include)
This warning is for project developers. Use -Wno-dev to suppress it.
CMake Warning (dev) at cmake/common.cmake:5 (source_group):
Syntax error in cmake code at
C:/yumen/wxgisgdal-read-only/cmake/common.cmake:5
when parsing string
Header Files\\ogr\ogrsf_frmts\vrt
Invalid escape sequence \o
Policy CMP0010 is not set: Bad variable reference syntax is an error. Run
"cmake --help-policy CMP0010" for policy details. Use the cmake_policy
command to set the policy and suppress this warning.
Call Stack (most recent call first):
cmake/ogr.cmake:130 (add_files_macro)
CMakeLists.txt:135 (include)
This warning is for project developers. Use -Wno-dev to suppress it.
CMake Warning (dev) at cmake/common.cmake:8 (source_group):
Syntax error in cmake code at
C:/yumen/wxgisgdal-read-only/cmake/common.cmake:8
when parsing string
Source Files\\ogr\ogrsf_frmts\vrt
Invalid escape sequence \o
Policy CMP0010 is not set: Bad variable reference syntax is an error. Run
"cmake --help-policy CMP0010" for policy details. Use the cmake_policy
command to set the policy and suppress this warning.
Call Stack (most recent call first):
cmake/ogr.cmake:130 (add_files_macro)
CMakeLists.txt:135 (include)
This warning is for project developers. Use -Wno-dev to suppress it.
CMake Warning (dev) at cmake/common.cmake:5 (source_group):
Syntax error in cmake code at
C:/yumen/wxgisgdal-read-only/cmake/common.cmake:5
when parsing string
Header Files\\ogr\ogrsf_frmts\csv
Invalid escape sequence \o
Policy CMP0010 is not set: Bad variable reference syntax is an error. Run
"cmake --help-policy CMP0010" for policy details. Use the cmake_policy
command to set the policy and suppress this warning.
Call Stack (most recent call first):
cmake/ogr.cmake:135 (add_files_macro)
CMakeLists.txt:135 (include)
This warning is for project developers. Use -Wno-dev to suppress it.
CMake Warning (dev) at cmake/common.cmake:8 (source_group):
Syntax error in cmake code at
C:/yumen/wxgisgdal-read-only/cmake/common.cmake:8
when parsing string
Source Files\\ogr\ogrsf_frmts\csv
Invalid escape sequence \o
Policy CMP0010 is not set: Bad variable reference syntax is an error. Run
"cmake --help-policy CMP0010" for policy details. Use the cmake_policy
command to set the policy and suppress this warning.
Call Stack (most recent call first):
cmake/ogr.cmake:135 (add_files_macro)
CMakeLists.txt:135 (include)
This warning is for project developers. Use -Wno-dev to suppress it.
CMake Warning (dev) at cmake/common.cmake:5 (source_group):
Syntax error in cmake code at
C:/yumen/wxgisgdal-read-only/cmake/common.cmake:5
when parsing string
Header Files\\ogr\ogrsf_frmts\dxf
Invalid escape sequence \o
Policy CMP0010 is not set: Bad variable reference syntax is an error. Run
"cmake --help-policy CMP0010" for policy details. Use the cmake_policy
command to set the policy and suppress this warning.
Call Stack (most recent call first):
cmake/ogr.cmake:140 (add_files_macro)
CMakeLists.txt:135 (include)
This warning is for project developers. Use -Wno-dev to suppress it.
CMake Warning (dev) at cmake/common.cmake:8 (source_group):
Syntax error in cmake code at
C:/yumen/wxgisgdal-read-only/cmake/common.cmake:8
when parsing string
Source Files\\ogr\ogrsf_frmts\dxf
Invalid escape sequence \o
Policy CMP0010 is not set: Bad variable reference syntax is an error. Run
"cmake --help-policy CMP0010" for policy details. Use the cmake_policy
command to set the policy and suppress this warning.
Call Stack (most recent call first):
cmake/ogr.cmake:140 (add_files_macro)
CMakeLists.txt:135 (include)
This warning is for project developers. Use -Wno-dev to suppress it.
CMake Warning (dev) at cmake/common.cmake:5 (source_group):
Syntax error in cmake code at
C:/yumen/wxgisgdal-read-only/cmake/common.cmake:5
when parsing string
Header Files\\ogr\ogrsf_frmts\shp
Invalid escape sequence \o
Policy CMP0010 is not set: Bad variable reference syntax is an error. Run
"cmake --help-policy CMP0010" for policy details. Use the cmake_policy
command to set the policy and suppress this warning.
Call Stack (most recent call first):
cmake/ogr.cmake:145 (add_files_macro)
CMakeLists.txt:135 (include)
This warning is for project developers. Use -Wno-dev to suppress it.
CMake Warning (dev) at cmake/common.cmake:8 (source_group):
Syntax error in cmake code at
C:/yumen/wxgisgdal-read-only/cmake/common.cmake:8
when parsing string
Source Files\\ogr\ogrsf_frmts\shp
Invalid escape sequence \o
Policy CMP0010 is not set: Bad variable reference syntax is an error. Run
"cmake --help-policy CMP0010" for policy details. Use the cmake_policy
command to set the policy and suppress this warning.
Call Stack (most recent call first):
cmake/ogr.cmake:145 (add_files_macro)
CMakeLists.txt:135 (include)
This warning is for project developers. Use -Wno-dev to suppress it.
Found PostgreSQL: C:/pgsql/lib
CMake Warning (dev) at cmake/common.cmake:5 (source_group):
Syntax error in cmake code at
C:/yumen/wxgisgdal-read-only/cmake/common.cmake:5
when parsing string
Header Files\\ogr\ogrsf_frmts\pg
Invalid escape sequence \o
Policy CMP0010 is not set: Bad variable reference syntax is an error. Run
"cmake --help-policy CMP0010" for policy details. Use the cmake_policy
command to set the policy and suppress this warning.
Call Stack (most recent call first):
cmake/ogr.cmake:158 (add_files_macro)
CMakeLists.txt:135 (include)
This warning is for project developers. Use -Wno-dev to suppress it.
CMake Warning (dev) at cmake/common.cmake:8 (source_group):
Syntax error in cmake code at
C:/yumen/wxgisgdal-read-only/cmake/common.cmake:8
when parsing string
Source Files\\ogr\ogrsf_frmts\pg
Invalid escape sequence \o
Policy CMP0010 is not set: Bad variable reference syntax is an error. Run
"cmake --help-policy CMP0010" for policy details. Use the cmake_policy
command to set the policy and suppress this warning.
Call Stack (most recent call first):
cmake/ogr.cmake:158 (add_files_macro)
CMakeLists.txt:135 (include)
This warning is for project developers. Use -Wno-dev to suppress it.
CMake Warning (dev) at cmake/common.cmake:5 (source_group):
Syntax error in cmake code at
C:/yumen/wxgisgdal-read-only/cmake/common.cmake:5
when parsing string
Header Files\\ogr\ogrsf_frmts\gml
Invalid escape sequence \o
Policy CMP0010 is not set: Bad variable reference syntax is an error. Run
"cmake --help-policy CMP0010" for policy details. Use the cmake_policy
command to set the policy and suppress this warning.
Call Stack (most recent call first):
cmake/ogr.cmake:163 (add_files_macro)
CMakeLists.txt:135 (include)
This warning is for project developers. Use -Wno-dev to suppress it.
CMake Warning (dev) at cmake/common.cmake:8 (source_group):
Syntax error in cmake code at
C:/yumen/wxgisgdal-read-only/cmake/common.cmake:8
when parsing string
Source Files\\ogr\ogrsf_frmts\gml
Invalid escape sequence \o
Policy CMP0010 is not set: Bad variable reference syntax is an error. Run
"cmake --help-policy CMP0010" for policy details. Use the cmake_policy
command to set the policy and suppress this warning.
Call Stack (most recent call first):
cmake/ogr.cmake:163 (add_files_macro)
CMakeLists.txt:135 (include)
This warning is for project developers. Use -Wno-dev to suppress it.
CMake Warning (dev) at cmake/common.cmake:5 (source_group):
Syntax error in cmake code at
C:/yumen/wxgisgdal-read-only/cmake/common.cmake:5
when parsing string
Header Files\\ogr\ogrsf_frmts\mitab
Invalid escape sequence \o
Policy CMP0010 is not set: Bad variable reference syntax is an error. Run
"cmake --help-policy CMP0010" for policy details. Use the cmake_policy
command to set the policy and suppress this warning.
Call Stack (most recent call first):
cmake/ogr.cmake:168 (add_files_macro)
CMakeLists.txt:135 (include)
This warning is for project developers. Use -Wno-dev to suppress it.
CMake Warning (dev) at cmake/common.cmake:8 (source_group):
Syntax error in cmake code at
C:/yumen/wxgisgdal-read-only/cmake/common.cmake:8
when parsing string
Source Files\\ogr\ogrsf_frmts\mitab
Invalid escape sequence \o
Policy CMP0010 is not set: Bad variable reference syntax is an error. Run
"cmake --help-policy CMP0010" for policy details. Use the cmake_policy
command to set the policy and suppress this warning.
Call Stack (most recent call first):
cmake/ogr.cmake:168 (add_files_macro)
CMakeLists.txt:135 (include)
This warning is for project developers. Use -Wno-dev to suppress it.
Found LIBKML: C:\Users\Public\libkml-read-only\msvc\Debug
Found LIBKML Headers: C:/Users/Public/libkml-read-only/src
CMake Warning (dev) at cmake/common.cmake:5 (source_group):
Syntax error in cmake code at
C:/yumen/wxgisgdal-read-only/cmake/common.cmake:5
when parsing string
Header Files\\ogr\ogrsf_frmts\libkml
Invalid escape sequence \o
Policy CMP0010 is not set: Bad variable reference syntax is an error. Run
"cmake --help-policy CMP0010" for policy details. Use the cmake_policy
command to set the policy and suppress this warning.
Call Stack (most recent call first):
cmake/ogr.cmake:184 (add_files_macro)
CMakeLists.txt:135 (include)
This warning is for project developers. Use -Wno-dev to suppress it.
CMake Warning (dev) at cmake/common.cmake:8 (source_group):
Syntax error in cmake code at
C:/yumen/wxgisgdal-read-only/cmake/common.cmake:8
when parsing string
Source Files\\ogr\ogrsf_frmts\libkml
Invalid escape sequence \o
Policy CMP0010 is not set: Bad variable reference syntax is an error. Run
"cmake --help-policy CMP0010" for policy details. Use the cmake_policy
command to set the policy and suppress this warning.
Call Stack (most recent call first):
cmake/ogr.cmake:184 (add_files_macro)
CMakeLists.txt:135 (include)
This warning is for project developers. Use -Wno-dev to suppress it.
CMake Warning (dev) at cmake/common.cmake:5 (source_group):
Syntax error in cmake code at
C:/yumen/wxgisgdal-read-only/cmake/common.cmake:5
when parsing string
Header Files\\ogr\ogrsf_frmts\kml
Invalid escape sequence \o
Policy CMP0010 is not set: Bad variable reference syntax is an error. Run
"cmake --help-policy CMP0010" for policy details. Use the cmake_policy
command to set the policy and suppress this warning.
Call Stack (most recent call first):
cmake/ogr.cmake:187 (add_files_macro)
CMakeLists.txt:135 (include)
This warning is for project developers. Use -Wno-dev to suppress it.
CMake Warning (dev) at cmake/common.cmake:8 (source_group):
Syntax error in cmake code at
C:/yumen/wxgisgdal-read-only/cmake/common.cmake:8
when parsing string
Source Files\\ogr\ogrsf_frmts\kml
Invalid escape sequence \o
Policy CMP0010 is not set: Bad variable reference syntax is an error. Run
"cmake --help-policy CMP0010" for policy details. Use the cmake_policy
command to set the policy and suppress this warning.
Call Stack (most recent call first):
cmake/ogr.cmake:187 (add_files_macro)
CMakeLists.txt:135 (include)
This warning is for project developers. Use -Wno-dev to suppress it.
CMake Warning (dev) at cmake/common.cmake:5 (source_group):
Syntax error in cmake code at
C:/yumen/wxgisgdal-read-only/cmake/common.cmake:5
when parsing string
Header Files\\ogr\ogrsf_frmts\geojson
Invalid escape sequence \o
Policy CMP0010 is not set: Bad variable reference syntax is an error. Run
"cmake --help-policy CMP0010" for policy details. Use the cmake_policy
command to set the policy and suppress this warning.
Call Stack (most recent call first):
cmake/ogr.cmake:193 (add_files_macro)
CMakeLists.txt:135 (include)
This warning is for project developers. Use -Wno-dev to suppress it.
CMake Warning (dev) at cmake/common.cmake:8 (source_group):
Syntax error in cmake code at
C:/yumen/wxgisgdal-read-only/cmake/common.cmake:8
when parsing string
Source Files\\ogr\ogrsf_frmts\geojson
Invalid escape sequence \o
Policy CMP0010 is not set: Bad variable reference syntax is an error. Run
"cmake --help-policy CMP0010" for policy details. Use the cmake_policy
command to set the policy and suppress this warning.
Call Stack (most recent call first):
cmake/ogr.cmake:193 (add_files_macro)
CMakeLists.txt:135 (include)
This warning is for project developers. Use -Wno-dev to suppress it.
CMake Warning (dev) at cmake/common.cmake:5 (source_group):
Syntax error in cmake code at
C:/yumen/wxgisgdal-read-only/cmake/common.cmake:5
when parsing string
Header Files\\ogr\ogrsf_frmts\geojson\jsonc
Invalid escape sequence \o
Policy CMP0010 is not set: Bad variable reference syntax is an error. Run
"cmake --help-policy CMP0010" for policy details. Use the cmake_policy
command to set the policy and suppress this warning.
Call Stack (most recent call first):
cmake/ogr.cmake:195 (add_files_macro)
CMakeLists.txt:135 (include)
This warning is for project developers. Use -Wno-dev to suppress it.
CMake Warning (dev) at cmake/common.cmake:8 (source_group):
Syntax error in cmake code at
C:/yumen/wxgisgdal-read-only/cmake/common.cmake:8
when parsing string
Source Files\\ogr\ogrsf_frmts\geojson\jsonc
Invalid escape sequence \o
Policy CMP0010 is not set: Bad variable reference syntax is an error. Run
"cmake --help-policy CMP0010" for policy details. Use the cmake_policy
command to set the policy and suppress this warning.
Call Stack (most recent call first):
cmake/ogr.cmake:195 (add_files_macro)
CMakeLists.txt:135 (include)
This warning is for project developers. Use -Wno-dev to suppress it.
Found JPEG: C:/GnuWin32/lib/jpeg.lib
Configuring incomplete, errors occurred!
A guy told me that I should add something like this:
In Header Files\\ogr\ogrsf_frmts need to add terminator '\' like this:
"Header Files\\ogr\\ogrsf_frmts"
but as I paste the common.cmake file content line 5:
source_group("Header Files\\${FGROUP}" FILES ${GDAL_AHHEADERS})
the string after Header Files is replaced by FGROUP macro, may generated automatically by CMake, so I can not edit them.

The error is happening because the contents of the variable ${FGROUP} contain paths with Windows-style separators. These are treated by CMake as escape characters.
You should change your macro to a function to avoid this. From the docs for macro:
Note that the parameters to a macro and values such as ARGN are not variables in the usual CMake sense. They are string replacements much like the c preprocessor would do with a macro. If you want true CMake variables you should look at the function command.

Related

Set -Wno-dev in CMakeLists.txt

I use the SDL2 CMake Modules and include them in my CMakeLists.txt like this
list(APPEND CMAKE_MODULE_PATH ${CMAKE_CURRENT_SOURCE_DIR}/cmake/sdl2)
find_package(SDL2 REQUIRED)
find_package(SDL2_gfx REQUIRED)
There, they generate the warning
CMake Warning (dev) at /opt/homebrew/Cellar/cmake/3.21.1/share/cmake/Modules/FindPackageHandleStandardArgs.cmake:438 (message):
The package name passed to find_package_handle_standard_args (SDL2main)
does not match the name of the calling package (SDL2). This can lead to
problems in calling code that expects find_package result variables
(e.g., _FOUND) to follow a certain pattern.
Call Stack (most recent call first):
cmake/sdl2/FindSDL2.cmake:318 (FIND_PACKAGE_HANDLE_STANDARD_ARGS CMakeLists.txt:13 (find_package)
This warning is for project developers. Use -Wno-dev to suppress it.
I don't care about that warning and want to suppress it.
However, I don't want to pass -Wno-dev to the cmake command itself, I would rather set that flag in the CMakeLists.txt.

cmake/config-ix.cmake:401 (get_host_triple) error when trying to build LLVM with CMake on Windows

I want to set up a debugger for Visual Studio Code so I tried to build LLVM environment so as to have LLDB on my computer. But the build fails with following output:
CMake Warning at cmake/modules/GetHostTriple.cmake:28 (message):
unable to determine host target triple
Call Stack (most recent call first):
cmake/config-ix.cmake:401 (get_host_triple)
CMakeLists.txt:670 (include)
CMake Error at cmake/config-ix.cmake:409 (string):
string sub-command REGEX, mode MATCH needs at least 5 arguments total to
command.
Call Stack (most recent call first):
CMakeLists.txt:670 (include)
CMake Error at cmake/config-ix.cmake:453 (message):
Unknown architecture host
Call Stack (most recent call first):
CMakeLists.txt:670 (include)
I use clang v11.0.1, CMake v3.18.0-rc4, and Ninja v1.10.2.
I had same problem and fixed by adding this line manually as build option:
-DLLVM_HOST_TRIPLE=x86_64

Syntax error in CMake code at FindOpenSSL.cmake:422 when parsing string

CMake Error at /usr/local/Cellar/cmake/3.17.3/share/cmake/Modules/FindOpenSSL.cmake:421 (file):
Syntax error in cmake code at
/usr/local/Cellar/cmake/3.17.3/share/cmake/Modules/FindOpenSSL.cmake:422
when parsing string
^#[\t ]*define[\t ]+OPENSSL_VERSION_STR[\t ]+\"([0-9])+\.([0-9])+\.([0-9])+\".*
Invalid escape sequence \.
Call Stack (most recent call first):
CMakeLists.txt:8 (FIND_PACKAGE)
-- Configuring incomplete, errors occurred!
I've installed OpenSSL, but I don't know why CMake won't let me run the code.
This issue is a bug introduced in CMake version 3.17.3, see the commit here. The code change was intended to update the how CMake parses the OpenSSL version number, but the regex used by the CMake maintainers was malformed.
The issue was quickly patched in CMake 3.18.0-rc1 here, so if you upgrade to the latest CMake version the issue will be resolved.

CMake with --warn-unused-vars warns about all unused CMAKE_* variables

I want to use the --warn-unused-vars flag with CMake, but it floods the output with warnings to unused CMAKE_* variables. It happens even with an empty CMakeLists.txt file, but to generate an example I used this one:
cmake_minimum_required(VERSION 3.15)
project(p)
set(myVar)
If I run cmake --warn-unused-vars .. it generates the following output:
Finding unused variables.
CMake Warning (dev) in build/CMakeFiles/3.15.4/CMakeSystem.cmake:
unused variable (changing definition) 'CMAKE_CURRENT_LIST_FILE'
Call Stack (most recent call first):
CMakeLists.txt:3 (project)
This warning is for project developers. Use -Wno-dev to suppress it.
CMake Warning (dev) in build/CMakeFiles/3.15.4/CMakeSystem.cmake:
unused variable (changing definition) 'CMAKE_CURRENT_LIST_DIR'
Call Stack (most recent call first):
CMakeLists.txt:3 (project)
This warning is for project developers. Use -Wno-dev to suppress it.
CMake Warning (dev) at build/CMakeFiles/3.15.4/CMakeSystem.cmake:1 (set):
unused variable (changing definition) 'CMAKE_HOST_SYSTEM'
Call Stack (most recent call first):
CMakeLists.txt:3 (project)
This warning is for project developers. Use -Wno-dev to suppress it.
CMake Warning (dev) at build/CMakeFiles/3.15.4/CMakeSystem.cmake:2 (set):
unused variable (changing definition) 'CMAKE_HOST_SYSTEM_NAME'
Call Stack (most recent call first):
CMakeLists.txt:3 (project)
This warning is for project developers. Use -Wno-dev to suppress it.
CMake Warning (dev) at build/CMakeFiles/3.15.4/CMakeSystem.cmake:3 (set):
unused variable (changing definition) 'CMAKE_HOST_SYSTEM_VERSION'
Call Stack (most recent call first):
CMakeLists.txt:3 (project)
This warning is for project developers. Use -Wno-dev to suppress it.
[This and similar stuff goes on for 6000+ lines]
I expected CMake to only warn about myVar (it does warn about it as well among all that noise). Do I have to filter the output by myself or is there some kind of additional flag I have to pass or configuration I have to change in order to limit the warnings to my CMake files? With -Wno-dev it also suppresses the warning about myVar which I want to keep.

LightGBM Installation issue on cmake

I would like to download LightGbm and i followed this website for doing it. But suddenly stopped with an error. Please post a solution.
Thankshttps://lightgbm.readthedocs.io/en/latest/Installation-Guide.html#macos
Error:
cmake ..
CMake Error at /usr/local/Cellar/cmake/3.13.0/share/cmake/Modules/CMakeDetermineCCompiler.cmake:48 (message):
Could not find compiler set in environment variable CC:
gcc-7.
Call Stack (most recent call first):
CMakeLists.txt:7 (PROJECT)
CMake Error: CMAKE_C_COMPILER not set, after EnableLanguage
CMake Error: CMAKE_CXX_COMPILER not set, after EnableLanguage
-- Configuring incomplete, errors occurred!
See also "/Users/kj/LightGBM/build/CMakeFiles/CMakeOutput.log".
Your environment variable CC is set to gcc-7 but this compiler can't be access with your $PATH variable.
Try to write gcc-7 in a terminal you should get a Command not found error.