I have a CMakeLists.txt which works on my x64 machine but not an ARM64 machine.
The problem is this call:
find_library(UnitTest++ REQUIRED)
I can find libUnitTest++.so in /usr/lib/aarch64-linux-gnu/, but CMake doesn't find it:
CMake Error at test/CMakeLists.txt:8 (find_library):
Could not find UnitTest++ using the following names:
-- Configuring incomplete, errors occurred!
I have tried all sorts of fiddles, such as
set(CMAKE_FIND_ROOT_PATH /usr/lib/aarch64-linux-gnu)
After ages I found the answer is simply to use the newer-style version of find_library:
find_library(UINTTESTPP NAMES UnitTest++ REQUIRED)
How annoying is that!
I hope this helps someone else with the same issue.
Related
I've tried on my windows PC and in wsl, but it doesn't work, and I'm using the Doxyfile.in it gives in eigen-3.4.0\doc
error: tag HTML_HEADER: header file '${Eigen_BINARY_DIR}/doc/eigendoxy_header.html' does not exist
It seems that it can't understand the Eigen_BINARY_DIR or something like that. Does it related to my OS? Do I need to try it in macOS?
I know where I'm wrong, I didn't process the file before using Doxygen, so I was confused by the difference between Doxyfile and Doxyfile.in and think it may related to my OS.
I tried to use CMake but there is still a problem...
I went to Eigen website and try to learn how to use CMake, I try cmake . in WSL(in eigen-3.4.0/doc) but it reports an error, which said:
CMake Error at CMakeLists.txt:14 (check_cxx_compiler_flag):
Unknown CMake command "check_cxx_compiler_flag".
-- Configuring incomplete, errors occurred!
See also "/mnt/c/eigen-3.4.0/doc/CMakeFiles/CMakeOutput.log".
Very new to make files here, so please forgive me if this is a noob question. I can't seem to find the answer on the internet.
I've forked a public repository from github, and it repository itself is supposed to be download, make and run, but I've already fixed a half dozen errors in their make files trying to get it running. Now I'm down to this one, which seems to be something to do with CMake not finding the right QT4 command.
When I'm in a build folder, the instructions (according to the owner of the repository) says to type "cmake .." - which is an obvious reference to CMakeList.txt in the parent folder. The file is hosted on Github, the line that throws the error is line 94, it says:
QT4_ADD_RESOURCES(OFFNAO_RES_SRCS ${OFFNAO_RES})
I am trying to build this program on Ubuntu 14.04.5 (because that's the OS it was originally built on, I can work on upgrading that after it is working).
The error text it spits out is:
CMake Error at CMakeLists.txt:94(QT$_ADD_RESOURCES):
Unknown CMake command "QT4_ADD_RESOURCES".
-- Configuring incomplete, errors occurred!
I have installed qt4-dev-tools (which also installs all qt4 libraries).
I can't seem to find how to get CMake to recognise QT4 and its commands.
I'm new to CMake and this is the first time I've come across QT4 so I don't know what I'm looking for. Happy to provide any more info if needed. All help is appreciated.
EDIT:
Here's the contents of the offnao CMakeList.txt:
cmake_minimum_required(VERSION 2.8.0 FATAL_ERROR)
PROJECT(OFFNAO)
INCLUDE_DIRECTORIES("${CMAKE_CURRENT_BINARY_DIR}")
INCLUDE_DIRECTORIES(${Boost_INCLUDE_DIR})
INCLUDE_DIRECTORIES(${CTC_DIR}/libnaoqi/include)
INCLUDE_DIRECTORIES(${CTC_DIR}/zlib/include)
INCLUDE_DIRECTORIES(${CTC_DIR}/../sysroot_legacy/usr/include)
SET(OFFNAO_CXX_SRCS
utils/OverlayPainter.cpp
// contents skipped for brevity
tabs/teamBallTab.cpp
)
SET(OFFNAO_MOC
readers/reader.hpp
// contents skipped for brevity
tabs/teamBallTab.hpp
)
if(CMAKE_TOOLCHAIN_FILE)
list(APPEND OFFNAO_CXX_SRCS tabs/cameraTab.cpp)
list(APPEND OFFNAO_MOC tabs/cameraTab.hpp)
endif(CMAKE_TOOLCHAIN_FILE)
SET(OFFNAO_UI
visualiser.ui
ConnectionBar.ui
tabs/LogTab.ui
tabs/LogsTab.ui
)
SET(OFFNAO_RES
resources/visualiser_resources.qrc
)
# build cxx files for resources
QT4_ADD_RESOURCES(OFFNAO_RES_SRCS ${OFFNAO_RES})
# build ui_XXX files from the XML-style .ui files
QT4_WRAP_UI(OFFNAO_UI_SRCS ${OFFNAO_UI})
# this moc's the above variable and appends to the cxx sources
QT4_WRAP_CPP(OFFNAO_MOC_SRCS ${OFFNAO_MOC})
ADD_EXECUTABLE(offnao.bin ${OFFNAO_CXX_SRCS} ${OFFNAO_RES_SRCS} ${OFFNAO_MOC_SRCS} ${OFFNAO_UI_SRCS})
cotire(offnao.bin)
set_source_files_properties(
tabs/graphTab.cpp
tabs/plots.cpp
tabs/walkTab.cpp
tabs/zmpTab.cpp
main.cpp
visualiser.cpp
${OFFNAO_MOC_SRCS} #too lazy to split and list them
PROPERTIES COMPILE_FLAGS "-I${QWT_INCLUDE_DIR}")
find_library ( QGLVIEWER_LIBRARY NAMES QGLViewer qglviewer-qt4 )
find_package ( OpenGL REQUIRED )
find_package ( PNG REQUIRED )
TARGET_LINK_LIBRARIES(
offnao.bin
${QT_LIBRARIES}
${QWT_LIBRARY}
${QGLVIEWER_LIBRARY}
Furthermore, the README that states to build this is rather vague, it doesn't actually say what folder to run these commands from. It states:
Welcome to Off-Nao, the rUNSWift debugging toolsuite.
To build this project, either:
You get lucky and bin/build_setup.sh just works :D
(verified under Ubuntu 14.04.1 LTS both natively and in VMs;
but builds successfully then segfaults at runtime in libGL.so.1
under fresh download of 14.04.3 LTS # 15/9/2015
according to gdb - so much for Ubuntu being stable).
---OR---
You need Qt4 and probably a bunch of other things like QGLViewer to build it natively:
$ mkdir build
$ cd build
$ cmake ..
$ make
$ ./offnao
Once you have performed the steps above once, in future you only need to:
$ make
$ ./offnao
In the 'build' directory
I do get the segfault as mentioned in the README at LibGL.so.1 so I've attempted to follow the instruction below it. I can only get the the "cmake .." stage and that's where I get the error.
Reformulating my previous comment as answer:
To use macros QT4_ADD_RESOURCES, QT4_WRAP_UI, QT4_WRAP_CPP and others you need to call find_package(Qt4 REQUIRED) first in your CMakeLists.txt. See the documentation for the FindQt4.cmake module (https://cmake.org/cmake/help/v3.0/module/FindQt4.html).
I am trying to cmake curlpp using Cmake version 3.4.1 and I get an error in cmake saying: " Error in configuration process [...]". So all I did is in cmake-gui open the curlpp source (version 0.7.3), selected the destination folder and chose mingw. Here is the output in the gui http://pastebin.com/1gKyqd32.
It said Configuring incomplete, errors occurred!
See also "C:/c++/libraries/curlpp_built/CMakeFiles/CMakeOutput.log".
CMakeOutput.log
I setup CMake correctly and I could compile glfw library.
Quoting the relevant part of the output
CMake Error at src/utilspp/CMakeLists.txt:4 (add_subdirectory):
add_subdirectory given source "singleton" which is not an existing
directory.
The project's CMakeLists.txt in src/utilspp is broken.
The bug is already reported in curlpp's issue tracker:
https://github.com/jpbarrette/curlpp/issues/7
You can work around this bug by removing line 4 from src/utilspp/CMakeLists.txt it should contain something like add_subdirectory(singleton). If you are lucky, everything works; but other errors might pop up.
I'm trying to generate Visual Studio 2013 projects files for MathGL 2.3.3 with CMake.
For some reason cmake does not understand my PNG_PNG_INCLUDE_DIR statement.
cmake "-DZLIB_INCLUDE_DIR=c:\users\chenning\projects\zlib-1.2.8\" "-DZLIB_LIBRARY_DEBUG=c:\users\chenning\projects\zlib-1.2.8\zlib.lib" "-DZLIB_LIBRARY_Release=c:\users\chenning\projects\zlib-1.2.8\zlib.lib" "-DPNG_PNG_INCLUDE_DIR=C:\Users\chenning\projects\lpng1620\" "-DPNG_LIBRARY_DEBUG=C:\Users\chenning\projects\lpng1620\projects\vstudio\x64\Debug\libpng16.lib" "-DPNG_LIBRARY_Release=C:\Users\chenning\projects\lpng1620\projects\vstudio\x64\Release\libpng16.lib" .
The Path exists and the variable is really called PNG_PNG_INCLUDE_DIR with two PNG.
cmake is telling me:
-- Found ZLIB: c:\users\chenning\projects\zlib-1.2.8\zlib.lib
-- Could NOT find PNG (missing: PNG_PNG_INCLUDE_DIR)
CMake Error at CMakeLists.txt:341 (message):
Couldn't find PNG library.
-- Configuring incomplete, errors occurred!
See also "C:/Users/chenning/projects/mathgl-2.3.3/CMakeFiles/CMakeOutput.log".
See also "C:/Users/chenning/projects/mathgl-2.3.3/CMakeFiles/CMakeError.log".
When I set the paths with cmake-gui all works fine.
Any ideas what's wrong?
I installed Ogre3D 1.8.1 (the source package) on Ubuntu 12.04 and everything went fine (I managed to run some samples on the Ogre interface). However, I hit a problem while I was compiling an external project (that one) that needed the OpenCV, ArUco and Ogre librarys. When I run the CMake of the project, I receive the following:
CMake Error at CMakeLists.txt:46 (find_package):
By not providing "FindOGRE.cmake" in CMAKE_MODULE_PATH this project has
asked CMake to find a package configuration file provided by "OGRE", but
CMake did not find one.
Could not find a package configuration file provided by "OGRE" with any of
the following names:
OGREConfig.cmake
ogre-config.cmake
Add the installation prefix of "OGRE" to CMAKE_PREFIX_PATH or set
"OGRE_DIR" to a directory containing one of the above files. If "OGRE"
provides a separate development package or SDK, be sure it has been
installed.
-- Configuring incomplete, errors occurred!
I know where the FindOGRE.cmake is, it's in the /usr/local/lib/OGRE/cmake, but I don't know how to say to CMake to look for that folder and fix this problem.
You just need to use the -D command line option along with the CMAKE_MODULE_PATH variable:
cmake . -DCMAKE_MODULE_PATH=/usr/local/lib/OGRE/cmake
Just for the record, an alternative solution would be to add the module path directly in the CMakeLists.txt. For example (tested on Debian 9):
set(CMAKE_MODULE_PATH "/usr/share/OGRE/cmake/modules/;${CMAKE_MODULE_PATH}")
Just make sure to add the line before find_package is called.
For me, it only works to set the following in CMakeLists.txt before find_package:
set(OGRE_DIR /usr/share/OGRE/build/sdk/CMake)
Note that the CMake directory is the one containing OGREConfig.cmake. For some reason, my CMake ignores CMAKE_MODULE_PATH.
Maybe, of some help for someone
For me, this solution work on manjaro:
set(CMAKE_MODULE_PATH "/usr/lib/OGRE/cmake;${CMAKE_MODULE_PATH}")
find_package(OGRE QUIET)
if (OGRE_FOUND)
include_directories( ${ogre_INCLUDE_DIR})
link_directories(${OGRE_LIBRARIES})
message(STATUS "OGRE: FOUND")
else()
message(STATUS "OGRE: NOT FOUND")
endif()