[cmake-developers] [CMake 0014292]: CMake does not add QT_NO_DEBUG definition for non-debug builds
Mantis Bug Tracker
mantis at public.kitware.com
Mon Jul 15 11:26:50 EDT 2013
The following issue has been SUBMITTED.
======================================================================
http://public.kitware.com/Bug/view.php?id=14292
======================================================================
Reported By: Nikita Krupen'ko
Assigned To:
======================================================================
Project: CMake
Issue ID: 14292
Category: CMake
Reproducibility: always
Severity: major
Priority: normal
Status: new
======================================================================
Date Submitted: 2013-07-15 11:26 EDT
Last Modified: 2013-07-15 11:26 EDT
======================================================================
Summary: CMake does not add QT_NO_DEBUG definition for
non-debug builds
Description:
I created Qt5 CMake project and use the code like the following:
cmake_minimum_required(VERSION 2.8.11)
find_package(Qt5Core REQUIRED)
target_link_libraries(${PROJECT_NAME} Qt5::Core)
The problem is that CMake does not defines QT_NO_DEBUG for release build, like
qmake does. If I build qml-plugin, I can't use release build of it, because Qt
takes it for debug build and I get the following error:
"The plugin uses incompatible Qt library. (Cannot mix debug and release
libraries.)"
The workaround is simple:
if(NOT CMAKE_BUILD_TYPE STREQUAL "Debug")
add_definitions(-DQT_NO_DEBUG)
endif()
It works, but I think this should be done in CMake.
======================================================================
Issue History
Date Modified Username Field Change
======================================================================
2013-07-15 11:26 Nikita Krupen'koNew Issue
======================================================================
More information about the cmake-developers
mailing list