0
$\begingroup$

Rosanswers logo

Hi,

will there be a version of qt_build in Jade? Or how do I replace it?

Greetings, Stephan

Edit

Thanks for the solutions. I actually didn't made it work with Qt5, because of some changes in namespaces between Qt4 and Qt5. So my solution is based on CMake's Documentation about Qt4. This is probably quite similar to you answer, so I marked it as a solution.

Thanks for your help!


Originally posted by Stopfer on ROS Answers with karma: 112 on 2015-07-08

Post score: 0

$\endgroup$

1 Answer 1

0
$\begingroup$

Rosanswers logo

if you use CMake 2.8.11 or newer (allowed in Jade and I think also Indigo) it gets even easier: http://doc.qt.io/qt-5/cmake-manual.html

cmake_minimum_required(VERSION 2.8.11)

project(testproject)

# Find includes in corresponding build directories
set(CMAKE_INCLUDE_CURRENT_DIR ON)
# Instruct CMake to run moc automatically when needed.
set(CMAKE_AUTOMOC ON)

# Find the QtWidgets library
find_package(Qt5Widgets)

# Tell CMake to create the helloworld executable
add_executable(helloworld WIN32 main.cpp)

# Use the Widgets module from Qt 5.
target_link_libraries(helloworld Qt5::Widgets)

if you replace every 5 by a 4 you will get it build against qt4. Mixing is not allowed for the same target but inside the same CMakeLists.txt is ok


Originally posted by Simon Schmeisser with karma: 229 on 2015-07-09

This answer was ACCEPTED on the original site

Post score: 2

$\endgroup$

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.