How to create CMake cross-compiling toolchain for VxWorks? - c++

I want to generate vxworks 6.x makefiles and workspace via CMake, and there is no support for VxWroks in CMake. How do I create a relevant generator for my platform anf the correct toolchain?
I'm new to CMake. I managed to create some test project that generate for windows VS 2015 and Ubuntu.
I tried to create one for VxWorks 6.x with GNU and DIAB compiler, but there is no support for it in CMake.
I read about something called toolchain, cross-compiling and platform files (.cmake) but I don't understand how to write it and where to put it.
I saw many examples in the internet but didn't understand if I need to rebuild the CMake with the new platform files or just reference to them form the toolchain or from CMakeLists.
I'm using the gui version of CMake 3.14.
I setting the generator as: Eclipse CDT4 - Unix Makefiles.
When I choosing the option of cross-compiling and provide name VxWorks, version, c++ compiler (gnu/4.1.2-vxworks-6.6/x86-win32/bin/c++ppc.exe), it write that the compiler is unknown and that I need to create Platform/VxWroks. It cannot build a simple test program.
I saw some post of someone who succeeded to create all required files :
Do (Cross-compile) platform files require an include guard?
But I couldn't download some examples to test it and a tutorial of how to do it.
I would like to be able to cgreate a generator with CMake for VxWorks 6.x to cimpile libraries and exacutable (.vxe) but don't know what to do.

CMake is not well supported in VxWorks 6, but CMake is supported from the Workbench/Eclipse GUI environment in VxWorks 7. Neither version supports command line cmake, e.g. "cmake ."

Related

What is an easy way to install a unix terminal with a C++ mingw compiler?

I'm going to teach students to use SFML with C++, and I'm afraid the school doesn't have visual studio C++ installed, or will be a bit heavy to use for those students.
I want to have a plan B and have the option of a simple makefile that I can build on windows with SFML.
https://www.sfml-dev.org/download/sfml/2.5.1/ this page offers binaries compiled with different, specific versions of mingw with their respective mingw package links, unfortunately mingw doesn't include an unix terminal, like the one included with git-bash, so I can run a makefile.
What are the steps required to have a problem unix terminal, running in windows, minsys, msys2 or not, that can work well with those mingw packages? I have trouble finding help or proper instructions.
You want https://www.msys2.org/
It provides bash terminal and already contains mingw compiler. Perhaps it even has SFML packages already.

Headers for Clang from VS build tools and LLVM

I was experimenting with different compilers, build managers and IDEs for my new project in C++. I am using VSCode(v1.52) on a windows 10 machine. I installed VS build tools 2019 and also included C++ Clang Compiler for Windows and C++ Clang-cl for v142 build tools (x64/x86). The project uses CMake as build manager and a plug-in CMake tools have been installed as well. Setup works fine as it is now.
However, I just want to know what are the differences to include Clang compiler from VSCode build tools 2019 and from LLVM. Does Clang that comes with VSCode build tools uses its own headers or the headers from VS? I do not want to use if Clang uses headers from VS..!
VSCode build tools (C++ Clang tools for Windows) will link the Clang compiler with Microsoft implementation of the Standard Library
Also, VSCode build tools has a component called: "C++ Clang-cl for v142" that gives you the freedom of using your own Compiler/Settings
Regarding header files, on Windows you should use clang with either GCC (Open Source) or MSVC header files.
I could not find the exact source of the header files in VS Build tools. However, as said above, it will link the compiler with Microsoft STL.
To install Clang with GCC header files (Works on VsCode):
go to https://www.msys2.org/ and install mysys2
then open mysys2 terminal and copy those commands to install Clang:
pacman -S mingw-w64-x86_64-clang
pacman -S mingw-w64-x86_64-clang-tools-extra
dont forget to add \msys64\mingw64\bin to the SYSTEM PATH variable
I have also made a video, with step by step: https://youtu.be/5OSO8IRlyXc

How do I set up OpenCV for MinGW project?

I regularly use Code::Blocks and MinGW for my C/C++ projects. I would like to be able to use OpenCV, since it has a nice library for computer vision projects. They have dropped support for MinGW. I have heard you can build it on your own somehow, but I have no experience doing this with 3rd party libraries. Can someone explain how to build it in a simple way for MinGW?
There is, or at least there was at least until 2.4.6, precompiled version of opencv that works out of the box with mingw as long as you use the dw2(standard) version of mingw.
since i needed sjlj support i had to build my own version of openCV 2.4.6
I did he following - i am pretty sure it will work for the current openCV version as well
Setup your preferred Mingw Environment - i would strongly recommend to use gcc 4.5 or newer
Intstall Msys
Intall Cmake - you can get a binary package
Start the Cmake GUI
Select the openCV source folder
Click Configure and select MSYS-Makfiles
Errors in the first run of Configure might be resolved if you run Configure again
Click Generate
use MSYS make to run the generated makefile
Copy all desired libraries and include files to your mingw-installation or your project

Installing C++ Boost library on Windows without Visual Studio

I would like to install Boost library without the need of Visual Studio compiler, preferably by downloading the pre-compiled binaries. We are working on a cross-platform C++ project in Eclipse, so VS is out of option.
About a year ago, I found an installer, but it does not longer exists.
The best match I have found so far is from:
http://www.boostpro.com/download/
but it seems like this one includes a lot of stuff related to VS.
If there is no installer available, is there an easy way of compiling it like the on *NIX platforms?
(I know that the majority of the library is header-only, but I would like some parts which are not)
Whichever toolchain that you are going to use on Windows, you can use that toolchain to compile Boost easily.
For example, if you use Eclipse CDT for C++ on Windows, you can use either MinGW or Cygwin toolchain. Then simply start the command prompt that has those toolchains (make, gcc, ...) in your path. Go to the Boost folder you downloaded. Run the bootstrap file to generate bjam. Then run bjam.
On a side note, if you want a cross-platform C++ project, you don't have to use a cross-platform IDE. You can use CMake as your build generator and then use any IDE you want.
One option is to get the full Boost source and then compile your own application to statically link in everything from Boost. If you manage to do this correctly, there will be no need to bundle the Boost binaries on any platform.

Compiling a shared library with Qt on Ubuntu 9.10

I am new to both Qt and Linux C++ development (although I have many years C and C++ development experience on Windows).
I have some legacy C projects (source files and headers - [not using Qt]) that I want to compile into shared libs on Linux.
I am proposing to store my projects under the following structure:
/home/username/Projects/project_name
/home/username/Projects/project_name/src
/home/username/Projects/project_name/build
Can anyone tell me how to do the following (using Qt to simplify the build process)
Create different build configurations (debug, release etc)
Build a configuration to create the appropriate shared library
As an aside, I have only recently installed Ubuntu 9.10 and the only C/C++ development tool I have installed (using SPM) in Qt - so I dont know if I need to install some other GNU C++ tools.
BTW I have already checked and have gcc (v4.4.1) available on my machine. I do not appear to have g++ though - I do not know whether this is significant or not.
An Ubuntu system doesn't come with build tool chain by default. Instead it has a meta package that you will need to install:
sudo apt-get install build-essential
This will install, among other the g++ compiler, although I am not sure about the Qt headers an such. For them you will need the qt4-dev package (I assume you wish to work with qt4 rather then qt3).
As for the bould structure, you will want to consult the qmake manual, or you might want to consider using CMake (apt-get install cmake) instead. CMake allow for out of build sources, as you require, and personally, I can't recommend it enough.