MantisBT - CMake
View Issue Details
0014696CMakeCMakepublic2014-01-14 04:522014-06-02 08:38
Gerry Boland 
 
normalminoralways
closedno change required 
x86_64Ubuntu linux14.01
CMake 2.8.12.1 
 
0014696: CMake does not add QT_NO_DEBUG definition for RelWithDebInfo build type
In a Qt5 CMake project with code like the following:

cmake_minimum_required(VERSION 2.8.12)
find_package(Qt5Core REQUIRED)
target_link_libraries(${PROJECT_NAME} Qt5::Core)

Running with "cmake . -DCMAKE_BUILD_TYPE=RelWithDebInfo" I see that CMake does not define QT_NO_DEBUG.

I interpreted the distinction between the Debug build type from the RelWithDebInfo type as being that while RelWithDebInfo also does not strip symbols from the generated binaries, it does allow developers to disable debug helpers like run-time asserts or expensive printing statements. So for Qt, setting QT_NO_DEBUG for RelWithDebInfo makes sense.

I'd like to know if my interpretation is correct before proceeding with a fix, something like adding
    set_property(TARGET ${_target} APPEND PROPERTY COMPILE_DEFINITIONS_RELWITHDEBINFO QT_NO_DEBUG)
to Qt5CoreMacros.cmake around like 246.
No tags attached.
Issue History
2014-01-14 04:52Gerry BolandNew Issue
2014-01-14 09:00Brad KingNote Added: 0034933
2014-01-14 09:00Brad KingStatusnew => resolved
2014-01-14 09:00Brad KingResolutionopen => no change required
2014-06-02 08:38Robert MaynardNote Added: 0036081
2014-06-02 08:38Robert MaynardStatusresolved => closed

Notes
(0034933)
Brad King   
2014-01-14 09:00   
The Qt5 CMake files are provided by Qt, not CMake. This will have to be raised over there.
(0036081)
Robert Maynard   
2014-06-02 08:38   
Closing resolved issues that have not been updated in more than 4 months.