Cmake tests do not run from install path - unit-testing

I am on a pi trying to teach myself cmake for a pico project. I'm following the CMAKE tutorial on cmake.org.
I'm confused by the results at Step 4 Installing and Testing.
After I build the project, I can run ctest -N and ctest -VV in the build directory and all tests run and pass 100%.
After I cmake --install . --prefix "../install" I can run ctest -n ../install/bin and the tests will run and pass. However the tutorial says to cd into the bin directory and run the tests. If I do that, no tests are found.
Part of me is satisfied that the tests are working, but I do not get how running the tests in /install/bin would find no tests to run.
cmake version: 3.18.4
raspberry pi4: bullseye
Mon

cmake --install is not going to copy the CMakeLists.txt to ../install. It copies the files you tell it to install with the install() directive.
CMakeLists.txt is what tells ctest what tests there are to run. So when you're in your source folder, ctest sees what tests to run. When you're in your install directory, it won't find any tests to run.

Related

How to build PythonQt in ubutnu

I want to embed the python script in my c++ Qt application, By searching on the net I found that PythonQt is exactly what I am looking for but when I went to it's github repo there is build description given for windows system but not for ubuntu system so after cloning the repo if I include it's src in my Qt .pro file it gives me output that
Python.h not found, I think the reason is that I didn't build it in my system. Is there anyone who could tell me that how to build PythonQt in ubuntu. The link for their repo is this: https://github.com/MeVisLab/pythonqt
If this didn't work you can also suggest me some other thing which will help me to embed python scripts into my Qt c++ application.
First clone the repo by using the following command
https://github.com/MeVisLab/pythonqt.git
After that cd into the clone folder and execute the below command to build it into your system.
qmake
This command will generate the MakeFile into your current directory run the following command to completely build the PythonQt in your system.
sudo make all
sudo make install
While executing those commands if you get the following error
fatal error: 'private/qmetaobjectbuilder_p.h'
Run the below command to solve this
sudo apt install qtbase5-private-dev

creating an auto installer in ubuntu

I am trying to install and run this software https://github.com/mit-biomimetics/Cheetah-Software
it's for a project but it can t compile for missing dependancies (eigen3).
I would like to create an auto install script to run it.
I have already do the most but i think i have problems in linking path in cmake and qt5.10 and eigen...
The autoinstall.sh code:
Install dependancies
sudo apt install mesa-common-dev freeglut3-dev coinor-libipopt-dev libblas-dev liblapack-dev gfortran liblapack-dev coinor-libipopt-dev cmake gcc build-essential libglib2.0-dev default-jdk python-all-dev liblua5.1-dev golang doxygen python-epydoc
Clone MIT Minicheetah software
git clone https://github.com/mit-biomimetics/Cheetah-Software.git
cd Cheetah-Software
Eigen library
wget https://gitlab.com/libeigen/eigen/-/archive/3.3.7/eigen-3.3.7.zip
unzip eigen-3.3.7.zip
lcm library
wget https://github.com/lcm-proj/lcm/releases/download/v1.4.0/lcm-1.4.0.zip
unzip lcm-1.4.0.zip
cd lcm-1.4.0
mkdir build
cd build
cmake ..
make
sudo make install
cd ..
cd ..
Qt
wget http://mirrors.ukfast.co.uk/sites/qt.io/archive/qt/5.10/5.10.0/qt-opensource-linux-x64-5.10.0.run
chmod +x qt-opensource-linux-x64-5.10.0.run
./qt-opensource-linux-x64-5.10.0.run
build
cd scripts # for now, you must actually go into this folder
./make_types.sh # you may see an error like `rm: cannot remove...` but this is okay
cd ..
mkdir build
cd build
cmake .. # there are still some warnings here
make -j
configure or setup.py or anything relqted in INSTALL or README.MD ( mandatory )
make
make install
but really you did not choose the most straitforward job, even as a developper I've been surprised many times when using cloned sources.
You should give a try to precompiled ROS for your robots or any distribution that let you install from binary yet you can still cross-compile when dev is done.
So i was able to compile and run it after several research and asking forums, it was a problem of compatibility with lcm library and openjdk, so download oracle jdk, do some linking manually and it was all good, absolutely no error in compilation.
Cheetah-Sofware-Ubuntu 18.04-AutoInstall.sh :
https://github.com/STRATOS-ROBOTICS/LeopardMK1/blob/master/install.sh

CMake does not create make file [duplicate]

This question already has an answer here:
Why isn't the command "cmake ." generating a makefile? [closed]
(1 answer)
Closed 3 years ago.
I am using cmake to build the project. I am new to c++ so there can be mistakes as i am unaware of how it internally works.
When i run cmake command in build directory then the response does not give any error. The output is as shown in next image.image after cmake command
Now when i go to the test directory then i see these files.
image of test directory
As i already said i don't know how it internally works but following some online tutorials i expect that there should be a make file but i'm not getting that.
Any help would be great for as i am stucked in this setup from 3 days.
This is what is want to do next:
First, standard build files should be created from
these configuration files:
cd test/ && mkdir build && cd build,
cmake ..
Note that you have to run these commands only once. Next, you can use your platform’s native build tools
for the actual building:
make -j10
And train a single decision tree or bagging classifier with:
./DecisionTreeTest, and
./BaggingTest,
If you have Visual Studio 2019 you will want to run your cmake (from the build directory) as
cmake -G "Visual Studio 16 2019" ..
and you will get a new configuration and .sln generated in your build folder.
From there you can open the .sln in visual studio, or run (in your build directory)
cmake --build .
to begin compilation of a debug build or
cmake --build . --config Release
for a release build.

C++ Travis CI and Qt5

I am trying to configure my project on GitHub using continuous integration and would like to use Travis CI to do so. However, I am getting a build error with the current configuration of my travis.yml. My project uses Qt5, SQLite, and is in C++.
This is the yml:
language: cpp
compiler: gcc
before_install:
- sudo apt-get update -qq
- sudo apt-get install -qq sqlite3 qt5-dev-tools
before_script:
- mkdir build
- cd build
- cmake
script: make
I am new to this and I tried reading up on the documentation on their site, but I'm still having an issue understanding it. If anyone has an example, I would greatly appreciate it. OS is Windows.
Error:
make: *** No targets specified and no makefile found. Stop.
The command "make && make test" exited with 2.
I'd say that CMake has a non-intuitive error reporting here:
before_script:
- mkdir build
- cd build
- cmake
It returns success, although it hasn't configured anything in the build/ directory because it didn't know where the sources are.
Try cmake .. instead. Or cmake <your source directory>

using CMake to build Google Test

I am trying to use CMake to build Google Test.
As mentioned in the README of Google Test,
I have issued following commands:
mkdir mybuild # Create a directory to hold the build output.
cd mybuild
cmake D:\gtest-1.6.0 # (in the README this was set as:cmake ${GTEST_DIR}, but since on my machine D:\gtest-1.6.0 is where I have downloaded gtest, I have used that in command prompt.
And here is the error I get:
Any help? any help would be greatly appreciated as I am stuck with it and can't move forward...... Thanks.
ps. I have Visual Studio 10 installed on my machine.
If you use Visual c++ compiler with cmake you must launch it from the Visual c++ command prompt. Otherwise cmake will not found your compiler.