Make the cmake tests work with a namespace build.

Change-Id: I6858c324548373c57963b5ef137772a1f780ec78
Reviewed-by: Oswald Buddenhagen <oswald.buddenhagen@nokia.com>
Reviewed-by: Clinton Stimpson <clinton@elemtech.com>
Reviewed-by: Stephen Kelly <stephen.kelly@kdab.com>
This commit is contained in:
Stephen Kelly 2012-02-10 16:40:12 +01:00 committed by Qt by Nokia
parent b800d8b94a
commit c455674555
7 changed files with 14 additions and 0 deletions

View File

@ -11,3 +11,6 @@ list(APPEND Qt5Core_INCLUDE_DIRS \"${_qt5_corelib_install_prefix}/mkspecs/defaul
if (NOT \"$${CMAKE_ADD_FPIE_FLAGS}\" STREQUAL \"\")
set(Qt5Core_COMPILE_FLAGS "-fPIE")
endif()
list(APPEND Qt5Core_DEFINITIONS -DQT_NAMESPACE=$$QT_NAMESPACE)
list(APPEND Qt5Core_COMPILE_DEFINITIONS QT_NAMESPACE=$$QT_NAMESPACE)

View File

@ -7,6 +7,8 @@ find_package(Qt5Core REQUIRED)
include_directories(${Qt5Core_INCLUDE_DIRS})
add_definitions(${Qt5Core_DEFINITIONS})
qt5_wrap_cpp(moc_files myobject.h)
# Test options. The -binary option generates a binary to dlopen instead of

View File

@ -7,6 +7,8 @@ find_package(Qt5Core REQUIRED)
include_directories(${Qt5Core_INCLUDE_DIRS})
add_definitions(${Qt5Core_DEFINITIONS})
# Test options. The -i option removes the include "myobject.h" from the moc file
# causing a compile failure. -> Options work
qt5_wrap_cpp(moc_files myobject.h OPTIONS -i)

View File

@ -9,6 +9,8 @@ find_package(Qt5Widgets REQUIRED)
include_directories(${Qt5Core_INCLUDE_DIRS} ${Qt5Gui_INCLUDE_DIRS} ${Qt5Widgets_INCLUDE_DIRS})
add_definitions(${Qt5Core_DEFINITIONS})
set(CMAKE_INCLUDE_CURRENT_DIR ON)
qt5_wrap_cpp(moc_files mywidget.h)

View File

@ -7,6 +7,8 @@ find_package(Qt5Core REQUIRED)
include_directories(${Qt5Core_INCLUDE_DIRS})
add_definitions(${Qt5Core_DEFINITIONS})
qt5_wrap_cpp(moc_files myobject.h)
qt5_add_resources(rcc_files "pass2.qrc")

View File

@ -8,6 +8,8 @@ find_package(Qt5Widgets REQUIRED)
include_directories(${Qt5Widgets_INCLUDE_DIRS})
add_definitions(${Qt5Core_DEFINITIONS})
set(CMAKE_INCLUDE_CURRENT_DIR ON)
qt5_wrap_cpp(moc_files mywidget.h)

View File

@ -6,5 +6,6 @@ project(pass7)
find_package(Qt5Core REQUIRED)
include_directories(${Qt5Core_INCLUDE_DIRS})
add_definitions(${Qt5Core_DEFINITIONS})
add_executable(myobject main.cpp)