Commit ba768c96 authored by Dennis Nienhüser's avatar Dennis Nienhüser
Browse files

Fix automoc related cmake warnings

Fixes warnings about using automoc in relaxed mode which was required
for keeping compatibility with older cmake versions. Minimum cmake
version is now 2.8.6.

REVIEW: 124333
parent 2c3e611a
......@@ -113,11 +113,8 @@ if(Qt5Core_FOUND)
include_directories( ${Qt5Test_INCLUDE_DIRS} )
include_directories( ${Qt5Xml_INCLUDE_DIRS} )
include_directories( ${Qt5Sql_INCLUDE_DIRS} )
SET(CMAKE_AUTOMOC TRUE)
SET(CMAKE_AUTOMOC_RELAXED_MODE TRUE)
else()
cmake_minimum_required(VERSION 2.6)
cmake_minimum_required(VERSION 2.8.6)
unset(QT_MOC_EXECUTABLE) # somehow the qt5 check sneaks in moc for qt5 even if qmake points to qt4
set(QT5BUILD FALSE)
set(WITH_KF5 FALSE)
......@@ -145,10 +142,7 @@ else()
endif()
endif()
if( NOT ${CMAKE_VERSION} STRLESS "2.8" AND NOT QT4BUILD)
SET(CMAKE_AUTOMOC TRUE)
SET(CMAKE_AUTOMOC_RELAXED_MODE TRUE)
endif()
SET(CMAKE_AUTOMOC TRUE)
# Use M_PI under Windows
if( WIN32 )
......
......@@ -19,14 +19,6 @@ else()
endmacro()
endif()
macro( marble_qt4_automoc )
if( ${CMAKE_VERSION} STRLESS "2.8" OR QT4BUILD)
qt4_automoc( ${ARGN} )
else()
# Just ignore it
endif()
endmacro()
macro(qt_add_resources)
if( QT4BUILD )
qt4_add_resources(${ARGN})
......@@ -55,7 +47,6 @@ endmacro()
# this is needed to minimize the amount of errors to do
macro( marble_add_plugin _target_name )
set( _src ${ARGN} )
marble_qt4_automoc( ${_src} )
add_library( ${_target_name} MODULE ${_src} )
target_link_libraries( ${_target_name} ${QT_QTCORE_LIBRARY}
${QT_QTDBUS_LIBRARY}
......@@ -83,7 +74,6 @@ set( _src ${ARGN} )
qt_add_resources( _src ../../../apps/marble-ui/marble.qrc )
marble_qt4_automoc( ${_src} )
add_library( ${_target_name} MODULE ${_src} )
target_link_libraries( ${_target_name} ${QT_QTCORE_LIBRARY}
${QT_QTDBUS_LIBRARY}
......@@ -106,7 +96,6 @@ endmacro( marble_add_designer_plugin _target_name )
macro( marble_add_declarative_plugin _target_name _install_path )
set( _src ${ARGN} )
marble_qt4_automoc( ${_src} )
add_library( ${_target_name} MODULE ${_src} )
target_link_libraries( ${_target_name} ${QT_QTCORE_LIBRARY}
${QT_QTDBUS_LIBRARY}
......
......@@ -24,7 +24,6 @@ marble_add_project_resources(${QML_FILES})
qt_add_resources(${TARGET}_SRCS marbleGame.qrc)
qt_wrap_ui(${TARGET}_SRCS game.ui)
marble_qt4_automoc(${${TARGET}_SRCS})
add_executable( ${TARGET} ${${TARGET}_SRCS} )
......
......@@ -167,4 +167,4 @@ void CountryByFlag::postQuestion( QObject *gameObject )
} // namespace Marble
#include "CountryByFlag.moc"
#include "moc_CountryByFlag.cpp"
......@@ -260,4 +260,4 @@ void CountryByShape::postQuestion( QObject *gameObject )
} // namespace Marble
#include "CountryByShape.moc"
#include "moc_CountryByShape.cpp"
......@@ -288,4 +288,4 @@ void MainWindow::resizeEvent(QResizeEvent* event)
} // namespace Marble
#include "GameMainWindow.moc"
#include "moc_GameMainWindow.cpp"
......@@ -11,7 +11,6 @@ if( QT4BUILD )
endif()
set( ${TARGET}_SRC squad-interpolation.cpp)
marble_qt4_automoc( ${${TARGET}_SRC} )
add_executable( ${TARGET} ${${TARGET}_SRC} )
target_link_libraries( ${TARGET} ${MARBLEWIDGET} )
......
......@@ -238,4 +238,4 @@ int main ( int argc, char** argv )
return app.exec();
}
#include "squad-interpolation.moc"
#include "moc_squad-interpolation.cpp"
......@@ -11,7 +11,6 @@ if( QT4BUILD )
endif()
set( ${TARGET}_SRC vehicletracking.cpp)
marble_qt4_automoc( ${${TARGET}_SRC} )
add_executable( ${TARGET} ${${TARGET}_SRC} )
target_link_libraries( ${TARGET} ${MARBLEWIDGET} )
......
......@@ -141,4 +141,4 @@ int main(int argc, char** argv)
return app.exec();
}
#include "vehicletracking.moc"
#include "moc_vehicletracking.cpp"
......@@ -133,4 +133,4 @@ void MainWindow::closeEvent( QCloseEvent *event )
}
}
#include "KdeMainWindow.moc"
#include "moc_KdeMainWindow.cpp"
......@@ -1930,4 +1930,4 @@ void MarblePart::changeRecordingState()
}
#include "marble_part.moc"
#include "moc_marble_part.cpp"
......@@ -23,7 +23,6 @@ set( marblemobile_SRCS
add_definitions(-DMARBLE_MOBILE_VERSION_STRING="1.7.20")
marble_qt4_automoc( ${marblemobile_SRCS} )
add_executable( marble-mobile ${marblemobile_SRCS} )
target_link_libraries( marble-mobile ${QT_QTCORE_LIBRARY} ${QT_QTGUI_LIBRARY} ${QT_QTMAIN_LIBRARY} marbleui ${MARBLEWIDGET})
install( TARGETS marble-mobile RUNTIME DESTINATION ${CMAKE_INSTALL_PREFIX}/bin )
......
......@@ -707,4 +707,4 @@ void MainWindow::fallBackToDefaultTheme()
}
}
#include "MobileMainWindow.moc"
#include "moc_MobileMainWindow.cpp"
......@@ -29,4 +29,4 @@ void StackableWindow::closeEvent ( QCloseEvent *event )
}
#include "StackableWindow.moc"
#include "moc_StackableWindow.cpp"
......@@ -11,7 +11,6 @@ if(MINGW AND QT4BUILD)
endif(MINGW AND QT4BUILD)
qt_wrap_ui(marble_SRCS ${marble_UI})
marble_qt4_automoc(${marble_SRCS})
if (WIN32)
add_executable (marble-qt WIN32 ${marble_SRCS})
......
......@@ -1632,4 +1632,4 @@ void MainWindow::changeViewSize( QAction* action )
}
}
#include "QtMainWindow.moc"
#include "moc_QtMainWindow.cpp"
......@@ -22,7 +22,6 @@ FILE (GLOB QML_FILES *.qml activities/*.qml plasma/*.qml harmattan/*.qml)
marble_add_project_resources(${QML_FILES})
qt_add_resources(my_SRCS meego.qrc harmattan/harmattan.qrc)
marble_qt4_automoc( ${my_SRCS} )
add_executable( marble-touch ${my_SRCS} )
if (QT4BUILD)
target_link_libraries( marble-touch ${QT_QTCORE_LIBRARY} ${QT_QTGUI_LIBRARY} ${QT_QTMAIN_LIBRARY} ${QT_QTDECLARATIVE_LIBRARY} ${MARBLEWIDGET} )
......
......@@ -12,7 +12,6 @@ endif(MINGW AND QT4BUILD)
qt_add_resources(marble_SRCS marble.qrc)
qt_wrap_ui(marble_SRCS ${marble_UI})
marble_qt4_automoc(${marble_SRCS})
add_library (marbleui STATIC ${marble_SRCS})
......
......@@ -905,4 +905,4 @@ void ControlView::closeEvent( QCloseEvent *event )
}
#include "ControlView.moc"
#include "moc_ControlView.cpp"
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment