Add more platforms to an existing project - c++

I am creating a C++ shared library and targeting multiple platforms (Android, iOS and Windows). Usually, I use this step to the create the shared library. I first create a Console DLL Windows library project which creates dll share library I can use for testing on Windows.
The problem is that when I want to build the project to generate Android and iOS shared libraries, I have to create a new project then select "Dynamic Shard Library (Android)" and "Dynamic Shard Library (iOS)" and then manually copy the existing C++ header and source files to that new Project. I basically have to create new project for each platform. After this, I have to change some settings to match the settings from the original C++ Windows project.
This is tiresome and I can't continue to do it like this.
Is there a way to add more target platforms to an existing project without creating new project? I just want to be able to change the platform then build the project from one project only. Is this possible?

Related

Setting up C++ include settings for a large library such as Paraview and QT in Eclipse

I have an application where I am compiling against the libraries Qt (5.11) and Paraview (5.6). I am developing in C++ and I am also coding in Eclipse.
Yes, I am aware that Paraview is more of an application then a library. However, I will be using it as a library to intergrate Paraview in my application in order to visualize some data. I could use QT creator and that would take care of the QT library. However, I am not very familiar with QT creator as an IDE and my entire workflow has been based around eclipse. For this, I would like to utilize components that I am familiar with.
Now, as many of you know, the QT library is large, very large. So is Paraview. I could create a search path for each folder containing the header files I need in the C++ include settings. If I go in this direction, then my library search path will be long, very long. Also, there might be a situation where I need to change computers (for whatever reason), I would then need to edit the search paths for the new computer and that will take time.I had thought that I could only include the paths to the include files that I needed. And I have started to do that. However, when I compile my application, I noticed that the libraries would use include files that are located in a directory that Eclipse is not even searching in. At the end of the day, I would need to include all of the directories to which the header files are stored in.
I was wondering if there might be a better method to reference all of the files that my project needs? Both come with make files (I believe that Qt includes a QMake file?). Is there a simpler method to include all of the files instead of editing the C++ include path for eclipse? I did see an option for QMake in Eclipse, is there anything that I can do with that feature to compile to QT library with my application?
Thank you and any feedback is appreciated. Also, feel free to suggest edits or clarification so that my description is clear.
Note some good practices when working with eclipse and qt or other large library.
Include the directories with a headers
If you use option "Generate Makefile automatically", add group include path with GUI Eclipse:
copy the directories with a headers (via system explorer);
go to project properties/C/C++Build/Settings/Tool Settings/GCC C++
Compiler/Includes.
paste directories (Ctrl+V) into "Include paths" list.
If you are using a qt-eclipse-integration plugin, you can add folders via the Discovered scanner configuration. You can find it if open: project properties/C/C++ Include Paths and Symbols/Add Contributed...
Create new project
if you already have a customized project, you can use it as a template:
make a copy of the customized project and name "mytempate";
delete all files from "mytempate".
When you want to create a new project, copy the template and specify (in the copy dialog) the path where the source codes are located.
Now you have a finished new project with settings and code.
Change computers
Use one of the ways:
1. Export C/C++ project settings for use in another workspace via project properties/C/C++ General/Paths and symbols/Includes/Export Settings...
2. Pack in the archive eclipse and workspace and copy your another computer.

NetBeans create a static Library c++

I have already a project in C++ and I want to create a static library for this project. I placed in the NetBeans my C++ project via Drag and drop.
Now, how can I create a static library for this project?
I have 8.2 version NetBeans in Linux
If you don't have any project or build system configured yet, you can either create a netbeans project or a project based on a build tool like cmake or make. If you already have a running build system it's possible to use this from within NB.
New Netbeans Project
First create a Netbeans Project for a static library:
New Project --> C/C++
C/C++ Static Library
Copy your source to the project or set the paths to your source
Using a build system (eg. Cmake or Make)
This set applies to the case where you already have an existing build system or want to use one.
New Project --> C/C++
C/C++ Project with Existing Sources
Select the path of your source code and select what you need. Follow the wizard and you are done.
For using CMake you can get a detailed step to step guide here.

How do you create SDL2 Visual Studio 2015 or 2017 Solution For Windows and Android?

Visual Studio 2015 has integrated Android Emulator support. They even have a pre-made template to set up Windows Phone, Android, and iOS targets. It seems like there should be some way of setting up SDL 2.0 in the same solution to easily toggle between Android and Windows targets.
A valid answer to this question will simply be a set of steps to set up the targets for an example SDL2 program that compiles and creates a simple OpenGL/ES context rotating cube or similar which will either create a window and run as a windows .exe or execute in the android emulator depending on the target.
Please include all steps in the body of your answer in a numbered bullet list so that it is a complete stand-alone answer.
For android specific settings. (Setting up makefiles, the AndroidManifest.xml, etc.) refer to SDL2/docs/readme.android and general "command line android help" on the internet.
Setting up the VS2015 solution generally goes as follows:
Create new folder project
Put game source in project/src
Create shared items project in project/
Create an android makefile project into project/android
Create an android basic application(ANT) project into project/android
Copy the contents of SDL2/android-proj to project/android
In the solution explorer check "show all files" and "include in project" all files from SDL2/android-proj except jni to the basic application project.
In the references of the basic app project add the makefile project.
In the references of the makefile project add the shared items project.
Edit project/android/jni/src/Android.mk to compile your files in projects/src
After building the makefile project, add its resulting .so files from project/android/libs/ to the basic app project.
Create other project like usual except instead of including source, just include shared items project in references.
Here is where you can find the shared items project:

Create DLL From Existing Visual studio C++ project

I have a c++ project developed in visual studio. The project which is currently .exe depends on external libs (xerces c++ and system C libraries). I now need to create a dll file (taking into account all the external libraries if possible).
Is there a way to convert the existing project into a dll (a tool) ?
If I need to create a dll project from the scratch (which is crazy cos the project is large :( ) what happens to the external libs - i.e. will a user need
to configure those lib before using my dll?
Thanks guyz for your help
You can change the Configuration Type in the General page of the project properties. Select Dynamic Library (.dll). The library projects can be consumed as before.
If you need to keep the .EXE project you have to make copy, of course.

“Add to project list” is grayed out in Qt Project Management dialog

I'm trying to add a new statically linked library to a Qt-based application.
I used this guide: http://doc.qt.nokia.com/qtcreator-snapshot/creator-project-qmake-libraries.html
But when I get to step 4, which says "In the Add to project list, select a project. For example, myapp", I'm unable to do this because the Add to project list is disabled (gray) in the Project Management dialog.
What is required for Qt Creator to recognize other projects at this point, such that they appear in the list (which would then, presumably, no longer be disabled)?
I'm working on Linux/GNU, on a PC machine.
See the post here: http://lists.qt.nokia.com/pipermail/qt-creator/2010-December/008166.html
Your "library" project and your "application" project both need to be part of a "Subdirs" project.
First, create a Subdirs project, which will contain all the individual projects for your overall project (this is like a "Solution" in Visual Studio).
Then, create your library project, by right-clicking the "subdirs" project, and selecting "New Subproject...", and then follow the instructions from the QtCreator docs, and the overall project should be available in the drop-down.
Finally (assuming you want to create a dependency from an application to your library), create your application project as a sub-project of the overall project, and then you can add your library project as an "internal library" of your application project.