CMake/Tests/QtAutogen/MocOsMacros/CMakeLists.txt
Sebastian Holtermann 2ef640819f Autogen: Tests: Differentiate between Qt core and Qt gui tests
Some AUTOGEN tests require the Qt core libraries only and
some require the Qt gui libraries to function.
This replaces the AutogenTest.cmake script with two specific
AutogenCoreTest.cmake and AutogenGuiTest.cmake scripts that
are included on demand.
2018-11-28 12:51:19 +01:00

33 lines
928 B
CMake

cmake_minimum_required(VERSION 3.11)
project(MocOsMacros)
include("../AutogenCoreTest.cmake")
# Tests if moc processes Q_OS_XXX macros
message( "Qt5Core_VERSION: ${Qt5Core_VERSION}" )
message(
"CMAKE_CXX_COMPILER_PREDEFINES_COMMAND: "
${CMAKE_CXX_COMPILER_PREDEFINES_COMMAND} )
# On some platforms (e.g. MAC) Q_OS_XXX requires moc to include moc_predefs.h
# which is supported since Qt 5.8 and requires
# CMAKE_CXX_COMPILER_PREDEFINES_COMMAND to be defined.
if( ( ${Qt5Core_VERSION} VERSION_GREATER_EQUAL "5.8" ) AND
DEFINED CMAKE_CXX_COMPILER_PREDEFINES_COMMAND
)
message( "Test enabled!" )
message(
"CMAKE_CXX_IMPLICIT_INCLUDE_DIRECTORIES: "
${CMAKE_CXX_IMPLICIT_INCLUDE_DIRECTORIES} )
set(CMAKE_AUTOMOC True)
add_executable(mocOsMacros
main.cpp
TestClass.cpp
TestClass.hpp
)
target_link_libraries(mocOsMacros PRIVATE ${QT_QTCORE_TARGET})
else()
message( "Test disabled!" )
endif()