QCA Build on QT5
-
Use sources from KDE http://websvn.kde.org/trunk/kdesupport/qca/. Soon they will be ported to Qt5.
-
I finally used Cmake and this fixed my issue:
- Download Cmake nightly here: http://www.cmake.org/files/dev/?C=M;O=D
- Install it
- In QT Creator: Tools -> Options -> Build & Run -> Cmake -> Browse... and find you cmake executable (mine is C:\Program Files (x86)\CMake 2.8\bin\cmake.exe)
- Download svn://svn.kde.org/trunk/kdesupport/qca/
- Download git://anongit.kde.org/extra-cmake-modules
- In QT Creator, File -> Open File or project: select the CMakeLists.txt from the extra-cmake-module repository, compile it
- In QT Creator, File -> Open File or project: select the CMakeLists.txt from the qca repository, in the arguments, add -DECM_MODULE_PATH C:/extra-cmake-modules-build (replace it with the location of your built extra-cmake-modules)
- You have a working QCA, you only need to copy the lib and include folder in your GCC compiler directory (mine is C:\Qt\Qt5.0.1\5.0.1\mingw47_32)
- Follow the same steps to compile plugins, QT will tell you that some package can't be found (for example OpenSSL), then define the variable where cmake is supposed to find the package (-DMY_CMAKE_PACKAGE_LOCATION C:/it/is/here)
Have fun!
-
Hey noname120, thanks for the tutorial. Unfortunately, I'm stuck at step 7. I added an argument -DECM_MODULE_PATH=D:/programowanie/_lib/extra-cmake-modules-build/ and I got an error:
@Building with Qt5 support
CMake Error at D:/programowanie/_lib/extra-cmake-modules-build/ECMConfig.cmake:42 (include):
include could not find load file:D://share/ECM-0.0.8/modules//ECMUseFindModules.cmake
Call Stack (most recent call first):
CMakeLists.txt:12 (find_package)CMake Error at CMakeLists.txt:14 (find_package):
By not providing "FindQt5Transitional.cmake" in CMAKE_MODULE_PATH this
project has asked CMake to find a package configuration file provided by
"Qt5Transitional", but CMake did not find one.Could not find a package configuration file provided by "Qt5Transitional"
with any of the following names:Qt5TransitionalConfig.cmake qt5transitional-config.cmake
Add the installation prefix of "Qt5Transitional" to CMAKE_PREFIX_PATH or
set "Qt5Transitional_DIR" to a directory containing one of the above files.
If "Qt5Transitional" provides a separate development package or SDK, be
sure it has been installed.Configuring incomplete, errors occurred!@
I can't see Qt5Transitional* files in extra-cmake-modules directories. Do you have any suggestions?
-
This is inconsistent because it checks in some location for the ECM_MODULE_PATH and in another for the share folder.
I knew about this issue but one of the maintainers of the repository told me he would quickly fix it so I thought it was done.
The workaround is to copy the compiled ECM files to the "D:/share/ECM-0.0.8/" directory. (in your case because your OS is installed on D:/, other users should copy it to the "C:/users/share/ECM-0.0.8/" directory)
-
My happiness was premature. Apps can't load QCA plugins, like QCA-OSSL. For instance running examples\rsatest.exe ends with an error "RSA not supported!".
While compiling QCA, the plugins were built as well, so I didn't do the 9th step. I can see libqca-logger, libqca-ossl and libqca-softstore DLLs in D:\Qt\Qt5.0.2\5.0.2\mingw47_32\plugins\crypto.
I tested it also on a virtual machine without Qt environment. Have the plugins been compiled incorrectly?
-
The library is a runtime library: it'll check for necessary DLLs and then tell "feature X is supported" and "feature Y is not supported".
That's why you need to modify your makefile to copy the plugin DLLs in the right directory of the compiled program. (I think it should in your case be something like yourprog/crypto/qca-ossl2.dll)
-
I had myapp/crypto/qca-ossl.dll.
I recompiled QCA and tested my app in debug build - it works partially. QCA::supporedFeatures displays:
@random,md5,sha1,keystorelist,log,sha0,ripemd160,md4,sha224,sha256,sha384,sha512,
hmac(md5),hmac(sha1),hmac(sha224),hmac(sha256),hmac(sha384),hmac(sha512),
hmac(ripemd160),aes128-ecb,aes128-cfb,aes128-cbc,aes128-cbc-pkcs7,aes128-ofb,
aes192-ecb,aes192-cfb,aes192-cbc,aes192-cbc-pkcs7,aes192-ofb,aes256-ecb,aes256-cbc,
aes256-cbc-pkcs7,aes256-cfb,aes256-ofb,blowfish-ecb,blowfish-cbc-pkcs7,blowfish-cbc,
blowfish-cfb,blowfish-ofb,tripledes-ecb,tripledes-cbc,des-ecb,des-ecb-pkcs7,des-cbc,
des-cbc-pkcs7,des-cfb,des-ofb,cast5-ecb,cast5-cbc,cast5-cbc-pkcs7,cast5-cfb,cast5-ofb,
pbkdf1(sha1),pbkdf2(sha1),pkey,dlgroup,rsa,dsa,dh,cert,csr,crl,certcollection,pkcs12,tls,
cms,ca@While release mode displays this:
@random,md5,sha1,keystorelist@
Also, the debug build crashes on accessing Random context (for function nextByte()), the context is set to 0xbaadf00d ;-)
-
Update - the debug mode no longer crashes, it works perfectly. However, the release one still doesn't. The simplest code to test it is rsatest example in QCA.
What I did so far is similar to steps in OP, but I'm using CMake-GUI for makefile generation and console for compiling instead of Qt Creator.
General steps:
For extra-cmake-modules:- get from svn://anonsvn.kde.org/home/kde/trunk/kdesupport/qca/ (address in OP is incorrect)
- add Qt 5 bin and OpenSSL bin folders to PATH
- open CMake-Gui
- set source and build folders
- set gcc and g++
- set make
- set CMAKE_INSTALL_PREFIX
- configure and generate
- open console, go to ECM build folder
- make and make install
For QCA:
- copy ECM-build\share to root (i.e. C:) due to bug
- set CMAKE_INSTALL_PREFIX
- set ECM_DIR
- (optionally) disable BUILD_TESTS
- set CMAKE_BUILD_TYPE to debug or release
- set OPENSSL_INCLUDE_DIR (assuming you have OpenSSL installed)
- configure and generate
- open console, go to QCA build folder
- make and make install
results
- bin\libqcad.dll.a or bin\libqca.dll.a - wrong name, correct it to libqcad.a or libqca.a
- plugins are in root\crypto (i.e. C:\crypto) instead of INSTALL_PREFIX\plugins\crypto
- LIB path in crypto.prf is incorrect, fix it
finish
- move crypto.prf and crypto folder to proper Qt folders - mkspecs\features and plugins, respectively
- add QCA bin to PATH (or move dlls to QCA lib?)