CMake generates error with project statement in CLion - cmake

I'm trying to load a project into CLion (using Windows 10 and Cygwin). When CLion processes the CMakeLists.txt file, the following errors are generated
C:\Users\doobop\.CLion2017.2\system\cygwin_cmake\bin\cmake.exe -DCMAKE_BUILD_TYPE=Debug -G "CodeBlocks - Unix Makefiles" /cygdrive/m/stream
CMake Error at /cygdrive/c/Users/doobop/.CLion2017.2/system/cygwin_cmake/share/cmake-3.8.2/Modules/CMakeDetermineSystem.cmake:180 (configure_file):
configure_file Problem configuring file
Call Stack (most recent call first):
CMakeLists.txt:12 (project)
-- The C compiler identification is GNU 5.4.0
CMake Error at /cygdrive/c/Users/doobop/.CLion2017.2/system/cygwin_cmake/share/cmake-3.8.2/Modules/CMakeDetermineCCompiler.cmake:175 (configure_file):
configure_file Problem configuring file
Call Stack (most recent call first):
CMakeLists.txt:12 (project)
-- The CXX compiler identification is GNU 5.4.0
CMake Error at /cygdrive/c/Users/doobop/.CLion2017.2/system/cygwin_cmake/share/cmake-3.8.2/Modules/CMakeDetermineCXXCompiler.cmake:170 (configure_file):
configure_file Problem configuring file
Call Stack (most recent call first):
CMakeLists.txt:12 (project)
CMake Error at /cygdrive/c/Users/doobop/.CLion2017.2/system/cygwin_cmake/share/cmake-3.8.2/Modules/CMakeDetermineRCCompiler.cmake:55 (configure_file):
configure_file Problem configuring file
Call Stack (most recent call first):
/cygdrive/c/Users/doobop/.CLion2017.2/system/cygwin_cmake/share/cmake-3.8.2/Modules/Platform/CYGWIN-GNU.cmake:50 (enable_language)
/cygdrive/c/Users/doobop/.CLion2017.2/system/cygwin_cmake/share/cmake-3.8.2/Modules/Platform/CYGWIN-GNU-C.cmake:2 (__cygwin_compiler_gnu)
/cygdrive/c/Users/doobop/.CLion2017.2/system/cygwin_cmake/share/cmake-3.8.2/Modules/CMakeCInformation.cmake:48 (include)
CMakeLists.txt:12 (project)
What is at line 12?
project( SWP )
Why would the project assignment cause all these errors?

Related

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

I use cmake to compile vorbis file. It is pop up an error when configure file

Selecting Windows SDK version 10.0.18362.0 to target Windows 10.0.19041.
Configuring vorbis 1.3.7
CMake Error at C:/Program Files/CMake/share/cmake-3.19/Modules/FindPackageHandleStandardArgs.cmake:218 (message):
Could NOT find Ogg (missing: OGG_LIBRARY OGG_INCLUDE_DIR)
Call Stack (most recent call first):
C:/Program Files/CMake/share/cmake-3.19/Modules/FindPackageHandleStandardArgs.cmake:577 (_FPHSA_FAILURE_MESSAGE)
cmake/FindOgg.cmake:73 (find_package_handle_standard_args)
CMakeLists.txt:65 (find_package)

Do I have FREETYPE_LIBRARY installed?

I ran a cmake command and got the following error:
CMake Error at /usr/share/cmake/Modules/FindPackageHandleStandardArgs.cmake:137 (message):
Could NOT find Freetype (missing: FREETYPE_LIBRARY FREETYPE_INCLUDE_DIRS)
Call Stack (most recent call first):
/usr/share/cmake/Modules/FindPackageHandleStandardArgs.cmake:378 (_FPHSA_FAILURE_MESSAGE)
/usr/share/cmake/Modules/FindFreetype.cmake:156 (find_package_handle_standard_args)
CMakeLists.txt:125 (find_package)
This thread says that I need to specify the .so file corresponding to FREETYPE_LIBRARY and the path to FREETYPE_INCLUDE_DIRS.
My question is how do I know if I have FREETYPE_LIBRARY installed and how to get these paths ?
My OS is Fedora release 28 (Twenty Eight).

Libwebrtc and cmake

I got WebRTC native package by following this https://webrtc.org/native-code/development/ and depot_tools at C:\depot_tools location. Then wanted to try this https://github.com/aisouard/libwebrtc to make development process easier but while following steps for windows at cmake -G "Visual Studio 14 2015 Win64" step i get error
CMake Error at C:/Program Files/CMake/share/cmake-3.12/Modules/FindPackageHandle
StandardArgs.cmake:137 (message):
Could NOT find Git (missing: GIT_EXECUTABLE)
Call Stack (most recent call first):
C:/Program Files/CMake/share/cmake-3.12/Modules/FindPackageHandleStandardArgs.
cmake:378 (_FPHSA_FAILURE_MESSAGE)
C:/Program Files/CMake/share/cmake-3.12/Modules/FindGit.cmake:83 (find_package
_handle_standard_args)
CMakeLists.txt:11 (find_package)
I would appreciate any help.

Compiling Caffe with Cmake and Ninja fails

I tried compiling Caffe on windows with CMAKE_BUILD_SHARED_LIBS option on, but it failed and stated I need to use Ninja. When I set Ninja to 1 in the config file (build_win.cmd), and run the script, it complains and gives the following error message:
CMake Error: CMake was unable to find a build program corresponding to
"Ninja". CMAKE_MAKE_PROGRAM is not set. You probably need to select
a different build tool. CMake Error: CMAKE_C_COMPILER not set, after
EnableLanguage CMake Error: CMAKE_CXX_COMPILER not set, after
EnableLanguage
-- Configuring incomplete, errors occurred! ERROR: Configure failed
I don't know what other steps I need to take in order to have a successful compilation process. All I did was to download Ninja, extract it somewhere and add it to my environment variable.
Do I need to install gcc as well?
Update
As suggested in the comments, I checked my path and noticed it was ill-configured. I fixed that now I get these errors, it seems it can't find the needed libraries:
-- The C compiler identification is GNU 6.3.0
-- The CXX compiler identification is GNU 6.3.0
-- Check for working C compiler: C:/Users/Master/gcc/bin/gcc.exe
-- Check for working C compiler: C:/Users/Master/gcc/bin/gcc.exe -- works
-- Detecting C compiler ABI info
-- Detecting C compiler ABI info - done
-- Detecting C compile features
-- Detecting C compile features - done
-- Check for working CXX compiler: C:/Users/Master/gcc/bin/c++.exe
-- Check for working CXX compiler: C:/Users/Master/gcc/bin/c++.exe -- works
-- Detecting CXX compiler ABI info
-- Detecting CXX compiler ABI info - done
-- Detecting CXX compile features
-- Detecting CXX compile features - done
CMake Warning at C:/Program Files/CMake/share/cmake-3.7/Modules/FindBoost.cmake:744 (message):
Imported targets not available for Boost version
Call Stack (most recent call first):
C:/Program Files/CMake/share/cmake-3.7/Modules/FindBoost.cmake:848 (_Boost_COMPONENT_DEPENDENCIES)
C:/Program Files/CMake/share/cmake-3.7/Modules/FindBoost.cmake:1435 (_Boost_MISSING_DEPENDENCIES)
cmake/Dependencies.cmake:8 (find_package)
CMakeLists.txt:79 (include)
CMake Warning at C:/Program Files/CMake/share/cmake-3.7/Modules/FindBoost.cmake:744 (message):
Imported targets not available for Boost version
Call Stack (most recent call first):
C:/Program Files/CMake/share/cmake-3.7/Modules/FindBoost.cmake:848 (_Boost_COMPONENT_DEPENDENCIES)
C:/Program Files/CMake/share/cmake-3.7/Modules/FindBoost.cmake:1435 (_Boost_MISSING_DEPENDENCIES)
cmake/Dependencies.cmake:8 (find_package)
CMakeLists.txt:79 (include)
CMake Warning at C:/Program Files/CMake/share/cmake-3.7/Modules/FindBoost.cmake:744 (message):
Imported targets not available for Boost version
Call Stack (most recent call first):
C:/Program Files/CMake/share/cmake-3.7/Modules/FindBoost.cmake:848 (_Boost_COMPONENT_DEPENDENCIES)
C:/Program Files/CMake/share/cmake-3.7/Modules/FindBoost.cmake:1435 (_Boost_MISSING_DEPENDENCIES)
cmake/Dependencies.cmake:8 (find_package)
CMakeLists.txt:79 (include)
-- Looking for pthread.h
-- Looking for pthread.h - not found
-- Found Threads: TRUE
CMake Error at C:/Program Files/CMake/share/cmake-3.7/Modules/FindBoost.cmake:1793 (message):
Unable to find the requested Boost libraries.
Unable to find the Boost header files. Please set BOOST_ROOT to the root
directory containing Boost or BOOST_INCLUDEDIR to the directory containing
Boost's headers.
Call Stack (most recent call first):
cmake/Dependencies.cmake:8 (find_package)
CMakeLists.txt:79 (include)
-- Could NOT find GFlags (missing: GFLAGS_INCLUDE_DIR GFLAGS_LIBRARY)
-- Could NOT find Glog (missing: GLOG_INCLUDE_DIR GLOG_LIBRARY)
CMake Error at C:/Program Files/CMake/share/cmake-3.7/Modules/FindPackageHandleStandardArgs.cmake:138 (message):
Could NOT find Protobuf (missing: Protobuf_LIBRARIES Protobuf_INCLUDE_DIR)
Call Stack (most recent call first):
C:/Program Files/CMake/share/cmake-3.7/Modules/FindPackageHandleStandardArgs.cmake:378 (_FPHSA_FAILURE_MESSAGE)
C:/Program Files/CMake/share/cmake-3.7/Modules/FindProtobuf.cmake:393 (FIND_PACKAGE_HANDLE_STANDARD_ARGS)
cmake/ProtoBuf.cmake:9 (find_package)
cmake/Dependencies.cmake:48 (include)
CMakeLists.txt:79 (include)
-- Configuring incomplete, errors occurred!
See also "G:/caffe_latest2/build/CMakeFiles/CMakeOutput.log".
See also "G:/caffe_latest2/build/CMakeFiles/CMakeError.log".
ERROR: Configure failed
I found the cause. I had installed GCC on my system, and cmake would try to use that instead of Visual C++ compiler.
All that is needed is just downloading Ninja, placing it in your Path Variable and you are good to go.
Change the needed settings in the build_win.cmd to use Ninja and you are done