Compiling Dipha on Ubuntu with CMAKE - cmake

I have been trying to compile an application called Dipha. The advice from their instructions is to build the application with the CCMAKE command, you can press the letter c to configure the build. Then from the g Key to generate the build files. However, the g option isn't available so I can't build the app.
Am I missing some configuration?
https://github.com/DIPHA/dipha

Managed to get around this by just using cmake command.
Created a new directory to build the application, one level up outside of the main Dipha repo
cd into build directory
ran cmake ../dipha to generate build files
then make to compile everything.
Moved binaries into bin

Related

Cross-compiling Qtquick GUI application through command line

I am Developing a GUI using QT framework; QT-Creator for front-end development and building the app. I am cross-compiling the code that will be running on RaspberryPi and host machine Ubuntu20.04. I am able to build the application through QT-Creator but I want to compile the code through terminal i.e. write CMakeLists.txt that will detect the cross-compiler and build the source-code. Because I need to integrate my GUI code into my other source-code and have to compile from Source-code makefile.
Can anyone help me in this?
Once I have created a screen and compiled through command line. I have tried to compile from terminal through command:
cmake .
to configure the cmake into the current directory. But I am getting error into this
cmake --build . --target clean
(to clean the directory and remove the object files), and
cmake --build . --target all
(to build the executable into the current directory)
Ideally, this should run and binary file should be generated into the current directory that will be running on target board after copying to the board.

How to perform the "make install" step after building aws-sdk-cpp using Qt Creator and CMake

I am trying to add aws-sdk-cpp as a submodule in my Qt application using Qt Creator and CMake. I want it to build for any platform without doing the building and installing on the command line as described here.
My project structure and CMakeLists.txt files looks like this:
I have successfully built the entire aws-sdk-cpp using MSVC2019 in debug mode using Qt Creator. My projects build folder is now 15 GB containing all the built libraries. The current issue I'm now facing is this error:
CMake Error at app/CMakeLists.txt:23 (find_package):
By not providing "FindAWSSDK.cmake" in CMAKE_MODULE_PATH this project has
asked CMake to find a package configuration file provided by "AWSSDK", but
CMake did not find one.
Could not find a package configuration file provided by "AWSSDK" with any
of the following names:
AWSSDKConfig.cmake
awssdk-config.cmake
Add the installation prefix of "AWSSDK" to CMAKE_PREFIX_PATH or set
"AWSSDK_DIR" to a directory containing one of the above files. If "AWSSDK"
provides a separate development package or SDK, be sure it has been
installed.
I think what is missing is the make install step described here and to set the path to AWSSDK_DIR.
I'm very new to CMake and I have not found any way to perform the make install step in the CMakeLists.txt file and then be able to set the AWSSDK_DIR which points to the AWSSDKConfig.cmake or awssdk-config.cmake file missing.
I'm also not sure which CMakeLists.txt file this should be written or if there is an entire other way to do this? Currently I'm stuck getting nowhere..

CMake force install after add_subdirectory

We are converting a large Makefile based project to a CMake based system. I have numerous dependencies that I need to build prior to building our code. The first three dependencies are build using the following:
add_subdirectory(dependencies/libexpat/expat)
add_subdirectory(dependencies/libuuid-1.0.3)
add_subdirectory(dependencies/log4c-1.2.4)
expat has it's own CMakeLists.txt file and build with no problems. I would like to force expat to install to the staging directory before continuing. For libuuid I am using a ExternalProject_Add and as part of that process it does install into the staging directory.
Then when I build log4c, which needs expat, I can point it to the location of expat. Otherwise I would need to someone get access to the absolutely path for the temporary build location of expat.
I've tried to add the following after add_subdirectory:
add_subdirectory(dependencies/libexpat/expat)
add_subdirectory(dependencies/libuuid-1.0.3)
install(TARGETS expat LIBRARY DESTINATION ${CMAKE_INSTALL_PREFIX}/usr/lib)
add_subdirectory(dependencies/log4c-1.2.4)
Unfortunately CMake will not run expat's install code. How do I force expat to install after building but before it builds the rest of the project?
This looks like the primary use case for ExternalProject_Add, which is best used as a superbuild setup. This means that your top-level project (the "superbuild") does not build any actual code and instead consists only of ExternalProject_Add calls. Your "real" project is added as one of these "external" projects. This allows you to set up the superbuild with all dependencies, ordering, etc.
The workflow is then as follows:
Generate the superbuild project.
Build the superbuild project. This will build and install all dependencies, and also generate (and build) your real project.
Switch to the buildsystem generated for your real project and start doing further development using that. Your dependencies are already correctly set up and installed by the build of the superbuild project in the previous step.

Eclipse CDT and CMake + Ninja -- proper project organization

I have a static library libXY and a program exeA using it. I fail to find a proper project setup which allows me to use ninja from within Eclipse CDT to build only what is needed to build.
So far, I had one project with ninja build files created by cmake which defined several targets which was perfect for building from command line:
build everything if anything changed (aka ninja all)
build libXY if any source files changed (aka ninja libXY)
build libXY if any source files changed and build exeA if any source file changed and link (aka ninja exeA)
I imported the project (created with cmake's Eclipse CDT / Ninja generator) into Eclipse CDT, but there, I could only build everything (ninja all). I was unable to get Ctrl-B to build just the library and the proper target, I was unable to define targets within Eclipse.
As plan B, I created a setup where libXY and exeA are independent projects. I am unable to define the dependency from exeA to libXY so that the library is built automatically if any of its source files changed.
Help! What is the proper project architecture?

How to install library from add_subdirectory in current directory

I'm using LuaDist's LuaJIT and I'm trying to add it to my CMake project via add_subdirectory. It seems to build the solution, but it doesn't actually make the libs. How do I tell the sub_directory to also make and install? Do I need to edit that project's CMake, or can I do it from my CMake project (preferred)?
Additionally, when I build and install LuaJIT seperately it installs to C:\Program Files (x86). I don't want that when I build it from my project. I want it to install to my projects \lib\LuaJIT directory (or basically build in place).
# lua
message( STATUS "Building Lua")
include_directories(${PROJECT_SOURCE_DIR}/libs/luajit/src)
add_subdirectory(${PROJECT_SOURCE_DIR}/libs/luajit)