How to place header and ui file in different folders using autouic in cmake - c++

According to the documentation, regarding autouic:
If a preprocessor #include directive is found which matches ui_.h, and a .ui file exists, then uic will be executed to generate the appropriate file.
But what if the .ui file is in another folder? I currently get the following error when trying to build:
AUTOUIC : error : process for ui_module.h failed:
File 'C:/app/source/headers/module.ui' is not valid
The ui file is actually located here:
C:/app/source/forms/module.ui
I've tried to add the C:/app/source/forms/ to the include_directories()-macro without success. Any ideas?

Issue mentioned in this answer is now resolved.
This worked in CMake v3.9.0-rc6:
set(CMAKE_AUTOUIC_SEARCH_PATHS your/folder/here)
See documentation of AUTOUIC_SEARCH_PATHS.

Update
A search path, CMAKE_AUTOUIC_SEARCH_PATHS, has been added to CMake
version 3.9.
After further investigation, it seems like it's not possible to do. There is an open issue in their tracking system, but it is so far not implemented:
Add Search path for AUTOUIC

Related

LNK1181 Error while compiling the core after adding a module

I'm trying to compile my core with some modules but i'm getting the following error when building worldserver:
cannot open input file '..\..\..\modules\RelWithDebInfo\modules.lib' worldserver
This error only happens when compiling with the mod-gain-honor-guard module. I've installed a repack before that came with this module pre-installed, which makes me think that i'm the one missing something.
Any ideas?
Thanks!
I've compiled the core succesfully with only one module, then i've added the one mentioned before and that error came up. CMake didn't show me any error when i regenerated the source for building after adding the module
You always need to regenerate the source in CMake when you add or remove any files to the source.
Did you get the module via git clone? If not, and it's a direct download, you need to remove the -master or any other branch name from the folder name.

I get an error message while I try to make doxygen file show the source files according to the directories

When I try to create a configuration file to use doxygen for the documentation, I receive this error message in the first step.
I wanna know how we can document our files using doxygen. How can we use doxygen? I'm new at documentation. Also, I'm new at doxygen. I hope you can help me about that
When I try to create a configuration file, I took this error message.
EDIT: I almost solved the problem. I have another problem now.
I have another problem. I created an empty folder to use doxygen properly. I work on Ubuntu. How can I make doxygen file reach to the source codes. Because my doxygen file does not see the source files. That's why, I got some error messages.
I receive this error message. According to the message the system cannot find the source files

MiXiM include error

I created a project, which includes MiXiM.
The problem is that when I build the project I get this error:
/MiXiM/src/base/connectionManager/ConnectionManagerAccess.h:40:26: fatal error: BaseMobility.h: No such file or directory
I don't understand. The problem seems related to the MiXiM library but if I close my project, I can successfully compile every MiXiM example.
Is it a bug or am I doing smomething wrong?
You are probably trying to build MiXiM with a recent version of OMNeT++ (5.0 or later?). Since 5.0 OMNeT++ does NOT add all directories in the source tree as an include dir one by one. Only the root of the source folder is added. It means that ALL files that include other headers from a directory other than the current one MUST be prefixed with the path relative to the source folder root. Adding all directories to the include path was a very bad idea and was removed from OMNeT 5.
This leads to the next question: Why are you using MiXiM which is abandoned long ago and most of its functionality was merged into INET 3.x? Why not INET?
I don't know,if I can help you or not;but I had the same experience.
If you try to execute an old project in MIXIM with different version,you get this error.
For example,in MIXIM-2.2.1 there is BaseMobility;but in MIXIM-2.3 there is MobilityBase.Therefore,If your project was written in MIXIM-2.2.1,you should change it according to MIXIM-2.3.

Compile and Execute QxORM qxBlog example

I'm actually in a project in which I use Qt and I need to use an ORM. I found QxORM. In the process of getting started with this ORM, I need to be able to compile and execute the qxBlog example provided with it. I have thoroughly followed
the QxORM installation tutorial : http://www.qxorm.com/qxorm_en/tutorial_3.html
the qxBlog example test tutorial http://www.qxorm.com/qxorm_en/tutorial_1.html
But when I execute the project (qxBlog) with QtCreator, I get this error
C:\Users\HP\dev\libraries\qxorm\QxOrm_1.4.2\test\qxBlog\include\precompiled.h:4: erreur : C1083: Cannot open include file: 'QxOrm.h': No such file or directory
Following this error, I compiled the QxORM library with all its dependencies to get the qxormd.dll and put either in bin or lib folder (that I created) but it didn't work.
Can anyone help me with this issue?
Thanks in advance!
I have changed the "#include " line in precompiled.h to "#include <../../include/QxOrm.h>" (relative path to QxOrm.h file) but I still get a similar error because of the includes in that file (QxOrm.h).
C:\Users\HP\dev\libraries\qxorm\QxOrm_1.4.2\include\QxOrm.h:58: erreur : C1083: Cannot open include file: 'QxPrecompiled.h': No such file or directory
I don't want to put the QxORM library in the same folder as the project. How can I successfully include Qxorm.h with all its dependencies without putting the entire library in the same folder as my project ?
Thanks in advance !
Thanks for you answer. I have added an include path in my .pro file. I get no such previous errors. Nevertheless, I get this error
"LNK1104: cannot open file 'QxOrmd.lib'"
Can anyone help me with this?
Thanks in advance.
I found an answer to my question with #drescherjm help.
All I had to do was to add an include path to my .pro file. I did it by adding the following line :
INCLUDEPATH += ../../../QxOrm/include/

Compiling C++ file with CMAKE (Unrecognized '-rdynamic')

I am trying to add a single C++ file to a working CMAKE project.
The project is building fine when I only have C files in the project. However, as soon as I add a cpp file to the ADD_EXECUTABLE section of CMakeLists.txt I get the following error: arm-none-eabi-gcc: error: unrecognized command line option '-rdynamic'.
Does anyone have any idea what might be going on here? Or what I could do to fix it?
Thanks so much for the help!
PS - I have a section at the top of the CMakeLists.txt that says SET(CMAKE_SHARED_LIBRARY_LINK_C_FLAGS) # get rid of -rdynamic, but it doesn't seem to be doing that.
Check the armgcc.cmake (or equivalent). I found a field there named CMAKE_SYSTEM_NAME and CMAKE_SYSTEM. These need to be renamed to 'Generic'. This took care of the problem for me.