View Issue Details Jump to Notes ] Print ]
IDProjectCategoryView StatusDate SubmittedLast Update
0014292CMakeCMakepublic2013-07-15 11:262013-12-02 08:51
ReporterNikita Krupenko 
Assigned ToStephen Kelly 
PrioritynormalSeveritymajorReproducibilityalways
StatusclosedResolutionfixed 
Platformx86OSWindowsOS Version7
Product VersionCMake 2.8.11.2 
Target VersionFixed in VersionCMake 2.8.12 
Summary0014292: CMake does not add QT_NO_DEBUG definition for non-debug builds
DescriptionI 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.


TagsNo tags attached.
Attached Files

 Relationships

  Notes
(0033540)
Clinton Stimpson (developer)
2013-07-15 12:41

No change required to CMake.

Qt5 comes with its own CMake config files maintained by Qt developers.
Any bugs in those files need to be submitted to them.

By the way, it has already been fixed for Release builds, and there is already a bug report for RelWithDebInfo builds.
https://bugreports.qt-project.org/browse/QTBUG-32403 [^]
(0033541)
Stephen Kelly (developer)
2013-07-15 12:52

Actually this is a CMake bug. The Qt5::Core IMPORTED target has the appropriate INTERFACE_COMPILE_DEFINITIONS, but CMake is not processing it correctly.

I've merged the fix-mapped-config-genex branch to next to fix that.
(0034655)
Robert Maynard (manager)
2013-12-02 08:51

Closing resolved issues that have not been updated in more than 4 months.

 Issue History
Date Modified Username Field Change
2013-07-15 11:26 Nikita Krupenko New Issue
2013-07-15 12:41 Clinton Stimpson Note Added: 0033540
2013-07-15 12:41 Clinton Stimpson Status new => resolved
2013-07-15 12:41 Clinton Stimpson Resolution open => no change required
2013-07-15 12:41 Clinton Stimpson Assigned To => Clinton Stimpson
2013-07-15 12:52 Stephen Kelly Assigned To Clinton Stimpson => Stephen Kelly
2013-07-15 12:52 Stephen Kelly Note Added: 0033541
2013-07-15 12:52 Stephen Kelly Status resolved => feedback
2013-07-15 12:52 Stephen Kelly Resolution no change required => reopened
2013-07-15 12:52 Stephen Kelly Status feedback => assigned
2013-07-24 11:20 Stephen Kelly Status assigned => resolved
2013-07-24 11:20 Stephen Kelly Fixed in Version => CMake 2.8.12
2013-07-24 11:20 Stephen Kelly Resolution reopened => fixed
2013-12-02 08:51 Robert Maynard Note Added: 0034655
2013-12-02 08:51 Robert Maynard Status resolved => closed


Copyright © 2000 - 2018 MantisBT Team