This question already has answers here:
How to Trace CMakeLists.txt [duplicate]
(2 answers)
Closed 4 years ago.
I am getting some strange error from cmake :
loading initial cache file ../../Tweaks/compiler-rt/arm.txt
-- Performing Test COMPILER_RT_HAS_FPIE_FLAG
CMake Error at CMakeLists.txt:2 (set):
Syntax error in cmake code at
D:/Work/AcSo/Views/llvmSecond/build-arm/compiler-rt/CMakeFiles/CMakeTmp/CMakeLists.txt:2
when parsing string
D:/Work/AcSo/Views/llvmSecond/llvm/projects/compiler-rt/cmake;D:/Work/AcSo/Views/llvmSecond/llvm/projects/compiler-rt/cmake/Modules;D:/Work/AcSo/Views/llvmSecond/llvm/cmake;D:\Work\AcSo\Views\llvmSecond\build-host\Release\lib\cmake\llvm
Invalid character escape '\W'.
CMake Error: Internal CMake error, TryCompile configure of cmake failed
-- Configuring incomplete, errors occurred!
See also "D:/Work/AcSo/Views/llvmSecond/build-arm/compiler-rt/CMakeFiles/CMakeOutput.log".
All I could understand is that it gets a windows path somehow, and then complains about \W character sequence. Actually I've done what I could to give cmake Linux paths. So I don't know where the Windows path comes from. Nothing seems essential for this error in CMakeOutput.log
I would like to get more diagnostics from cmake, i.e. what and why it does, but searching for "cmake verbose" instead gives results about making the make verbose, not cmake itself.
Is there a way to force cmake verbose / get more diagnostics / debug or trace output? Or if you can tell what's the problem in my specific case, that's appreciated too.
In this particular situation, cmake flags --trace and --debug-output suggested for the questions linked in the comments, were not as helpful as --debug-trycompile flag, which keeps such files as CMakeFiles/CMakeTmp/CMakeLists.txt (so they don't get removed when cmake fails).
Related
System: Linux
I am getting the following error when trying to run a C++ code. When I run cmake .., I get -
srishti#ubuntu:~/realtimeKCF/build$ cmake ..
FINALLL TBB_LIBRARIES = 'optimized;/usr/lib/x86_64-linux-gnu/libtbb.so;debug;TBB_tbb_LIBRARY_DEBUG-NOTFOUND'
CMake Error: The following variables are used in this project, but they are set to NOTFOUND.
Please set them or make sure they are set and tested correctly in the CMake files:
TBB_tbb_LIBRARY_DEBUG (ADVANCED)
linked by target "DSKCFcpp" in directory /home/srishti/realtimeKCF
-- Configuring incomplete, errors occurred!
See also "/home/srishti/realtimeKCF/build/CMakeFiles/CMakeOutput.log".
I also searched for:
TBB_tbb_LIBRARY_DEBUG (ADVANCED)
but I can't find this anywhere. Can someone please help me with this? I am just having this error stopping me from running the code.
I am trying to run some code from my university, but when I do "cmake .." inside "build" I get the following error:
CMake Error: The following variables are used in this project, but
they are set to NOTFOUND. Please set them or make sure they are set
and tested correctly in the CMake files: iceutil_lib
linked by target "cppgui" in directory /Users/alej/Desktop/project1
linked by target "project1" in directory /Users/alej/Desktop/project1
-- Configuring incomplete, errors occurred!
Any of my friends are getting errors, can you help me?
CMake tries to find all the libraries necessary to create the library or executable you are trying to build from the code from your university.
The found paths to those libraries are stored in special variables in CMake. By default, those variables carry the value <Library-Name>-NOTFOUND. This NOTFOUND flag is what makes CMake prompt the error message.
In general there are two possible reasons, why CMake can not find the library for you:
The library is not installed on your system
The library is installed somewhere CMake did not search for it. In this case you can help CMake by setting the library installation path into the respective CMake variables. To do this, open the file CMakeCache.txt with a text editor and search for ICEUTIL_LIB. Replace the blabla-NOTFOUND value with the actual (absolute) path of the library. There might be other variables with the ICEUTIL prefix. One of them might be named like ICEUTIL_HEADERS or ICEUTIL_INCLUDE_DIR. Replace the value of this one with the absolute path of where the .h files for ICEUTIL are found. If the include path is not set, CMake might run fine without errors, but later you will run into compiler errors saying include file not found.
I have an issue with automoc in that moc fails with Parse error at "BOOST_JOIN". I tried the "least evil" hack outlined here, but to no avail (speficially, I added set(CMAKE_AUTOMOC_MOC_OPTIONS "-DBOOST_TT_HAS_OPERATOR_HPP_INCLUDED") to my CMakeLists.txt). Further, when I try to moc the offending file myself, it seems to work.
I'd like to know the exact command CMake is running so I can continue debugging this. If I do ninja -v, however (equivalent of make VERBOSE=1), I get something like:
cd projdir && cmake -E cmake_automoc projdir/CMakeFiles/proj_automoc.dir/ Debug
If I run that myself, sure enough I get the same Parse error at "BOOST_JOIN" message, but I still don't know how CMake is calling moc.
cmake --debug-output -E cmake_automoc ... throws a usage error.
Once you have done the cmake configure step and generated the build scripts (eithe VS solution files or Unix makefiles), you can use cmake with the build option as described in the manual cmake(1). If you are using Makefiles, then you can use:
make VERBOSE=1
For Visual Studio, see
Is there an option to produce more 'verbose' compiling? for details.
I am trying to follow some old instructions on a past project for compiling and installing a Maya plugin and I have ran into an error on a Mac. The instruction says, in terminal, use the command cmake -G "Unix Makefiles" "/CMakeLists.txt path"
There are no errors in finding the source files but I do get the error: /CMakeLists.txt:17:
Parse error. Expected a command name, got unquoted argument with text "//Path".
-- Configuring incomplete, errors occurred!
Here is the first part of the CMakeList.txt:
# This is the CMakeCache file.
# The syntax for the file is as follows:
# KEY:TYPE=VALUE
# KEY is the name of a variable in the cache.
# TYPE is a hint to GUI's for the type of VALUE, DO NOT EDIT TYPE!.
# VALUE is the current value for the KEY.
########################
# EXTERNAL cache entries
########################
//Path to a program.
CMAKE_AR:FILEPATH=/usr/bin/X11/ar
//Choose the type of build, options are: None(CMAKE_CXX_FLAGS or
// CMAKE_C_FLAGS used) Debug Release RelWithDebInfo MinSizeRel.
CMAKE_BUILD_TYPE:STRING
If I delete line 17 (//Path to a program.) the error just moves to the next line and so on. I've tried searching for answers but I've come up with no luck. Anyone know how to fix this?
I have checked out a version of project from SVN. Below are the different kinds of errors I got while trying to CMAKE a project from SVN. Could it be that some of the files are not checked out? Please, go through the three kinds of errors and help me out with it.
==================Type 1==================================
CMake Error at CMakeLists.txt:184 (add_subdirectory):
add_subdirectory given source "google/gmock" which is not an existing
directory.
==================Type 2==================================
Subversion executable was not found.
CMake Error at CMakeLists.txt:14 (UpLinqSVN_WC_INFO):
Unknown CMake command "UpLinqSVN_WC_INFO".
Call Stack (most recent call first):
CMakeLists.txt:207 (CreateVersionInfo)
========================TYPE 3==========================================
CMake Error: The following variables are used in this project, but they are set to NOTFOUND.
Please set them or make sure they are set and tested correctly in the CMake files:
FFMPEG_AVCODEC_LIB
linked by target "UpLinq" in directory C:/Users/Krishna/Desktop/2.5/GUI
FFMPEG_AVCORE_LIB
linked by target "UpLinq" in directory C:/Users/Krishna/Desktop/2.5/GUI
FFMPEG_AVDEVICE_LIB
linked by target "UpLinq" in directory C:/Users/Krishna/Desktop/2.5/GUI
Configuring incomplete, errors occurred!
Error 1 indeed indicates that the CMakeLists.txt expected there to be a directory called google/gmock (relative to the CMakeLists.txt which is calling add_subdirectory at line 184).
Without more info, there's no way to tell if this is an error in the CMakeLists file or in the repository.
The first part of error 2 (can't find Subversion exe) looks like a custom error message. It may be looking for a ".svn" folder in the project root, and assuming that Subversion is available. Presumably it then looks for the Subversion exe and fails to find it (not in path maybe?)
The second part of error2 (unknown CMake command) is saying that at line 14 of CMakeLists.txt, there's a command called UpLinqSVN_WC_INFO being invoked. It doesn't recognise this as a valid command, which probably means that it's defined as a function or macro in another CMake file somewhere. It would need to be defined before it's invoked at line 14. It could be that the CMakeLists.txt you're executing is expected to be run as part of a larger build, which would define this function before starting on your CMakeLists.txt.
Error 3 is saying that there's a CMake target called "UpLinq" (an exe or lib) which has a dependency on ${FFMPEG_AVCODEC_LIB}. At some point, there's probably been a find_library call looking for the avcodec library which has also failed. The result of the search is held in the variable FFMPEG_AVCODEC, and it shows that ${FFMPEG_AVCODEC} has a value of FFMPEG_AVCODEC-NOTFOUND.
If you need more help than this, you'll need to put up a copy of the relevant parts of the CMakeLists files involved, and a bit more info about your environment / directory structures.