I downloaded a package called QtIOCompressor, I need to use the functionality like zipping a directory gzipping a directory etc etc in a application I am coding. But I dont know how to add this package into Qt or how to configure this package by which i can use it with my application which i may code in future!
InfO: http://doc.qt.nokia.com/solutions/4/qtiocompressor/qtiocompressor.html
download: http://qt.nokia.com/products/appdev/add-on-products/catalog/4/Utilities/qtiocompressor/
step: read the INSTALL.TXT that comes with the package and follow the instructions. Basically that is just: qmake and nmake
step: look at the .pro files in the example directory for usage in your program. (you just have to include src/qtiocompressor.pri
Related
I am trying to figure out how to get SFML to work with CMake and Visual Studio 2022 on Windows 10.
So far I have
Downloaded and installed Visual Studio 2022
Downloaded a zip file containing what I believe to be the SFML libs and headers which I need to include/link against
Compiled a hello world program with VS2022
There is a file in my sfml folder SFMLConfig.cmake. I need to use this in combination with find_package (cmake) but I have no idea how to do this.
I don't understand where I am supposed to put the SFML folder which I downloaded. I have put it in the root directory of my project (or at least one level lower) it seems like the root is just a place for the first CMakeLists.txt file to live, which just calls add_subdirectory.
I've added a screenshot of VS and the sfml folder containing the .cmake files.
The sfml folder is structured something like this - if you've used SFML before you are probably familiar with it.
sfml/
bin/
openal32.dll
...
include/
sfml/
Audio/
Graphics/
...
lib/
cmake/
SFML/
SFMLConfig.cmake
...
sfml-audio.lib
sfml-audio-d.lib
...
share/
You just need to set SFML_ROOT to X:\REDACTED\source\repos\REDACTED\REDACTED\sfml. It is not appropriate to hard-code such a path in the CMakeLists.txt, but you can put it in a preset. This works either as a CMake variable or as an environment variable.
Please read the full documentation for find_package, the Config-Mode Search Procedure in particular: https://cmake.org/cmake/help/latest/command/find_package.html
Also worth noting: it is much easier to manage dependencies on Windows using vcpkg than littering dubious ("what I believe to be") binaries across your filesystem.
First of all, I’m not an expert in build libraries from the source with cmake and all this stuff. But unfortunately I have to. I followed up the steps mention in the INSTALL document of the libssh and read a few archived mails but nothing helps me out. It sounds so easy on the web, but I didn’t bring it to work. Here is what I’ve done so far:
Download source from (Version 0.7.5) from libssh git
As mentioned in INSTALL file, download and install cmake (Version 3.9.1)
As mentioned in INSTALL file, download and install OpenSSL (Version 1.0.2)
Ignore zlib, because its optional
Everything is installed in the default paths. Now starts cmake-gui.exe and set source code to …/src folder and binaries to …/build folder, press ‘Configure’ button, with Visual Studio 12 2013 Win64.
Now the first error is generated: install Library TARGETS given no DESTINATION. Okay, checks make file which use variable LIB_INSTALL_DIR to set the path, in my case the path is empty. Add item to cmake-gui named LIB_INSTALL_DIR with path to ../build dir.
Fine, configuration works, generate works, open project works. Try to build ‘ALL_BUILD’ ends up in error: C1083: Cannot open include file: 'config.h': No such file or directory. Searched my whole disk for the file, nothing found. I believe cmake have to generate this file, guessing right? Or is this file missing? Hope someone can help me out! Or maybe have a link to an already compiled lib? Doesn’t understand why libssh doesn’t offers a download, x64 is quite normal today.
Initial inspiration is often the right one, the missing config.h is normally generated by cmake.
If you using cmake-gui.exe, it expects an path to the source, heading is ‘Where is the source code:’. I thought this means the path to the source code files, which are located under …/src, but this is wrong. I need to the set the path to the root folder, in my case … and everything works like a charm.
Also need to change back to OpenSSL version 1.0.2, because somewhere around 30 function declarations has changed.
For making a very simple Qt app "installable" on other systems, I'm using Qt Installer Framework following this link.
In bottom, in Setting up Qt Installer Framework, number 1 orders to have Qt Installer Framework source code. I downloaded it from here. (qt-installer-framework-opensource-2.0.1-src.zip)
Now I don't understand the next instruction there :(
It says:
2- Build the tools by running the "qmake" from the static Qt, followed by "make" or "nmake".
My question is, first what does it mean?
And from what path?
I don't know how to do it:(
qmake comes with the qt-framework and is a make file generator. (an alternative to cmake).
You call qmake on a .pro file from your project. This .pro file have to contain your source code files project dependencies and more.
Consider that you have a project folder with your source code and the .pro file. Then you call the qmake command in this folder. qmake is an program itself, which you can find in the bin folder of your qt-installation. If qmake is in your path variable, you go to the terminal, navigate to the specific folder and just write:
qmake
After that qmake will create a makefile. Then you could call makeand your program will be build.
I hope my answer helps you. You can learn more about qmake on the website of Qt. Here is also a very good qmake tutorial: klick
edit:
how to call make on windows:
download and install cygwin from
http://www.cygwin.com/setup-x86.exe - 32 bit installer or
http://www.cygwin.com/setup-x86_64.exe - 64 bit installer.
then start the Cygwin terminal (Cygwin.bat) and navigate to your folder and call
make
and that will build your qt-installer!
I have a problem using libclang:
I built libclang locally. It resides somewhere like clang-llvm/…/libclang.3.4.dylib.
Then I developed a foundation tool using that dylib. (exactly: I copied a version to my project folder and linked against this.) The foundation tool works fine. But, of course, at load time it uses the dylib in my local build folder. This is unacceptable, because the user of the tool has to install clang to use my tool.
So I copied libclang.3.4.dylib to a location inside /usr/…/libclang.3.4.dylib and changed the installation path to that location using install_name_path -id /usr/…/libclang.3.4.dylib /usr/…/libclang.3.4.dylib.
After that my tool finds the dylib there but does not work since the parser cannot find stdarg.h any more in the file, that is parsed by my tool.
/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.9.sdk/System/Library/Frameworks/CoreFoundation.framework/Headers/CoreFoundation.h:12:10: fatal error: 'stdarg.h' file not found
How can I set the installation path of libclang.3.4.dylib to something public?
Amin, my good friend.
<sarcasm>
From what you wrote it should be OBVIOUS to EVERYONE that you have to create a release build of your tool and NOT a debug build. Xcode should have told you that in the form of CLEAR and EASY to understand error messages.
</sarcasm>
Solution: Use a release build of your tool instead of a debug build.
:)
I just switched to CMake. And yet found it very useful and realized some simple apps and libs.
Somewhere I read that it's possible to query git to checkout repositories from within cmake scripts.
I'd like to check for the existence of a package with my Find(package).cmake
If it doesn't exist i'd like to initiate a checkout and add the new directory to the cmake script as subdirectory.
That way all my dependencies will get installed automatically.
Does somebody know how to accomplish this idea? Thank you!
Bye, Arthur
You're probably thinking about the ExternalProject module added in CMake 2.8. It's documented at http://www.cmake.org/cmake/help/cmake-2-8-docs.html#module:ExternalProject with an intro to it at page 14 of http://www.kitware.com/products/archive/kitware_quarterly1009.pdf. It allows you checkout/download a project and build it automatically.
I would try to find the package with find_package and if the package_FOUND variable is not set you have to call git manually with execute_process. If the source already contains a CMakeLists.txt simply add it by using add_subdirectory otherwise you have to write your own CMake instructions to build that package first.