Commit 8eb02007 authored by Matthias Möller's avatar Matthias Möller

add qt5 cmake files

refs #1359

git-svn-id: http://www.openflipper.org/svnrepo/OpenFlipper/branches/Free@17083 383ad7c9-94d9-4d36-a494-682f7c89f535
parent ec77395d
...@@ -73,8 +73,14 @@ acg_append_files (ui "*.ui" ${directories}) ...@@ -73,8 +73,14 @@ acg_append_files (ui "*.ui" ${directories})
acg_drop_templates (sources) acg_drop_templates (sources)
# genereate uic and moc targets # genereate uic and moc targets
acg_qt4_autouic (uic_targets ${ui}) if (QT5_FOUND)
acg_qt4_automoc (moc_targets ${headers}) set(CMAKE_AUTOMOC ON)
acg_qt5_autouic (uic_targets ${ui})
acg_qt5_automoc (moc_targets ${headers})
else ()
acg_qt4_autouic (uic_targets ${ui})
acg_qt4_automoc (moc_targets ${headers})
endif()
if (WIN32) if (WIN32)
# add app icon rc file to windows build # add app icon rc file to windows build
...@@ -155,6 +161,7 @@ target_link_libraries (OpenFlipper ...@@ -155,6 +161,7 @@ target_link_libraries (OpenFlipper
${GLUT_LIBRARIES} ${GLUT_LIBRARIES}
${FTGL_LIBS} ${FTGL_LIBS}
${COREAPP_ADDITIONAL_LINK_LIBRARIES} ${COREAPP_ADDITIONAL_LINK_LIBRARIES}
) )
if (APPLE) if (APPLE)
...@@ -170,13 +177,11 @@ if (APPLE) ...@@ -170,13 +177,11 @@ if (APPLE)
if ( EXISTS ${CMAKE_SOURCE_DIR}/branding ) if ( EXISTS ${CMAKE_SOURCE_DIR}/branding )
# Take bundle icon from branding dir
IF ( NOT APPLE_BUNDLE_ICON ) IF ( NOT APPLE_BUNDLE_ICON )
# option to set the used Icon for OpenFlipper # option to set the used Icon for OpenFlipper
set ( APPLE_BUNDLE_ICON "${CMAKE_SOURCE_DIR}\\branding\\mac\\OpenFlipper_Icon.icns" CACHE FILEPATH "Path to the Bundle Icon" ) set ( APPLE_BUNDLE_ICON "${CMAKE_SOURCE_DIR}\\branding\\mac\\OpenFlipper_Icon.icns" CACHE FILEPATH "Path to the Bundle Icon" )
ENDIF(NOT APPLE_BUNDLE_ICON ) ENDIF(NOT APPLE_BUNDLE_ICON )
# Take plist from branding
IF ( NOT APPLE_INFO_PLIST ) IF ( NOT APPLE_INFO_PLIST )
if ( EXISTS ${CMAKE_SOURCE_DIR}/branding/mac/Info.plist ) if ( EXISTS ${CMAKE_SOURCE_DIR}/branding/mac/Info.plist )
# option to configure the custom Info.plist # option to configure the custom Info.plist
...@@ -191,11 +196,7 @@ if (APPLE) ...@@ -191,11 +196,7 @@ if (APPLE)
IF ( NOT APPLE_BUNDLE_ICON ) IF ( NOT APPLE_BUNDLE_ICON )
# option to set the used Icon for OpenFlipper # option to set the used Icon for OpenFlipper
if ( EXISTS ${CMAKE_SOURCE_DIR}/branding/Icons/OpenFlipper_Icon.icns )
set ( APPLE_BUNDLE_ICON " ${CMAKE_SOURCE_DIR}/branding/Icons/OpenFlipper_Icon.icns" CACHE FILEPATH "Path to the Bundle Icon" )
else()
set ( APPLE_BUNDLE_ICON "${CMAKE_CURRENT_SOURCE_DIR}/../Icons/OpenFlipper_Icon.icns" CACHE FILEPATH "Path to the Bundle Icon" ) set ( APPLE_BUNDLE_ICON "${CMAKE_CURRENT_SOURCE_DIR}/../Icons/OpenFlipper_Icon.icns" CACHE FILEPATH "Path to the Bundle Icon" )
endif()
ENDIF(NOT APPLE_BUNDLE_ICON ) ENDIF(NOT APPLE_BUNDLE_ICON )
IF ( NOT APPLE_INFO_PLIST ) IF ( NOT APPLE_INFO_PLIST )
...@@ -205,6 +206,7 @@ if (APPLE) ...@@ -205,6 +206,7 @@ if (APPLE)
endif() endif()
add_custom_command(TARGET OpenFlipper POST_BUILD add_custom_command(TARGET OpenFlipper POST_BUILD
COMMAND ${CMAKE_COMMAND} -E copy_if_different "${APPLE_BUNDLE_ICON}" "${CMAKE_BINARY_DIR}/Build/${ACG_PROJECT_DATADIR}/OpenFlipper.icns" COMMAND ${CMAKE_COMMAND} -E copy_if_different "${APPLE_BUNDLE_ICON}" "${CMAKE_BINARY_DIR}/Build/${ACG_PROJECT_DATADIR}/OpenFlipper.icns"
) )
...@@ -241,11 +243,11 @@ acg_copy_after_build (OpenFlipper "${CMAKE_CURRENT_SOURCE_DIR}/../Documentation/ ...@@ -241,11 +243,11 @@ acg_copy_after_build (OpenFlipper "${CMAKE_CURRENT_SOURCE_DIR}/../Documentation/
if ( EXISTS ${CMAKE_SOURCE_DIR}/branding ) if ( EXISTS ${CMAKE_SOURCE_DIR}/branding )
if ( WIN32 ) if ( WIN32 )
acg_copy_after_build (OpenFlipper "${CMAKE_SOURCE_DIR}/branding/win/Icons" "${CMAKE_BINARY_DIR}/Build/${ACG_PROJECT_DATADIR}/Icons") acg_copy_after_build (OpenFlipper "${CMAKE_SOURCE_DIR}/branding/win" "${CMAKE_BINARY_DIR}/Build/${ACG_PROJECT_DATADIR}/Icons")
elseif( APPLE ) elseif( APPLE )
acg_copy_after_build (OpenFlipper "${CMAKE_SOURCE_DIR}/branding/mac/Icons" "${CMAKE_BINARY_DIR}/Build/${ACG_PROJECT_DATADIR}/Icons") acg_copy_after_build (OpenFlipper "${CMAKE_SOURCE_DIR}/branding/mac" "${CMAKE_BINARY_DIR}/Build/${ACG_PROJECT_DATADIR}/Icons")
elseif() elseif()
acg_copy_after_build (OpenFlipper "${CMAKE_SOURCE_DIR}/branding/linux/Icons" "${CMAKE_BINARY_DIR}/Build/${ACG_PROJECT_DATADIR}/Icons") acg_copy_after_build (OpenFlipper "${CMAKE_SOURCE_DIR}/branding/linux" "${CMAKE_BINARY_DIR}/Build/${ACG_PROJECT_DATADIR}/Icons")
endif() endif()
endif() endif()
...@@ -320,16 +322,14 @@ if (NOT APPLE) ...@@ -320,16 +322,14 @@ if (NOT APPLE)
acg_install_dir ("${CMAKE_BINARY_DIR}/Build/QtPlugins/" "${ACG_PROJECT_DATADIR}/QtPlugins") acg_install_dir ("${CMAKE_BINARY_DIR}/Build/QtPlugins/" "${ACG_PROJECT_DATADIR}/QtPlugins")
endif(WIN32) endif(WIN32)
if ( EXISTS ${CMAKE_SOURCE_DIR}/branding/win ) if ( EXISTS ${CMAKE_SOURCE_DIR}/branding )
if ( WIN32 ) if ( WIN32 )
acg_install_dir ( "${CMAKE_SOURCE_DIR}/branding/win" "${ACG_PROJECT_DATADIR}/Icons") acg_install_dir ( "${CMAKE_SOURCE_DIR}/branding/win" "${ACG_PROJECT_DATADIR}/Icons")
endif() endif()
endif() endif()
#todo install splash file for windows and Linux branding
endif () endif ()
if ( EXISTS ${CMAKE_SOURCE_DIR}/branding/Icons )
# Overwrite generic Icons with branded ones.
acg_copy_after_build (OpenFlipper "${CMAKE_SOURCE_DIR}/branding/Icons" "${CMAKE_BINARY_DIR}/Build/${ACG_PROJECT_DATADIR}/Icons")
endif()
...@@ -99,14 +99,24 @@ acg_append_files_recursive (ui "*.ui" ${CMAKE_SOURCE_DIR}/ObjectTypes) ...@@ -99,14 +99,24 @@ acg_append_files_recursive (ui "*.ui" ${CMAKE_SOURCE_DIR}/ObjectTypes)
acg_drop_templates (sources) acg_drop_templates (sources)
# genereate uic and moc targets # genereate uic and moc targets
acg_qt4_autouic (uic_targets ${ui}) if (QT5_FOUND)
acg_qt4_automoc (moc_targets ${headers}) acg_qt5_autouic (uic_targets ${ui})
acg_qt5_automoc (moc_targets ${headers})
elseif (QT4_FOUND)
acg_qt4_autouic (uic_targets ${ui})
acg_qt4_automoc (moc_targets ${headers})
endif ()
#======================================================= #=======================================================
# Create library # Create library
#======================================================= #=======================================================
acg_add_library (OpenFlipperPluginLib SHARED ${uic_targets} ${sources} ${headers} ${moc_targets}) if (QT5_FOUND)
acg_add_library (OpenFlipperPluginLib SHARED ${uic_targets} ${sources} ${headers} ${moc_targets})
elseif (QT4_FOUND)
acg_add_library (OpenFlipperPluginLib SHARED ${uic_targets} ${sources} ${headers} ${moc_targets})
endif ()
if( ADDITIONAL_PLUGINLIB_COMPILER_FLAGS ) if( ADDITIONAL_PLUGINLIB_COMPILER_FLAGS )
set_target_properties ( set_target_properties (
OpenFlipperPluginLib PROPERTIES OpenFlipperPluginLib PROPERTIES
......
...@@ -294,8 +294,13 @@ macro (_plugin_licensemanagement) ...@@ -294,8 +294,13 @@ macro (_plugin_licensemanagement)
acg_append_files (keygen_ui "*.ui" "${CMAKE_SOURCE_DIR}/OpenFlipper/LicenseManager/keyGen") acg_append_files (keygen_ui "*.ui" "${CMAKE_SOURCE_DIR}/OpenFlipper/LicenseManager/keyGen")
# genereate uic and moc targets # genereate uic and moc targets
if (QT5_FOUND)
acg_qt5_autouic (keygen_uic ${keygen_ui})
acg_qt5_automoc (keygen_moc ${keygen_hdr})
else ()
acg_qt4_autouic (keygen_uic ${keygen_ui}) acg_qt4_autouic (keygen_uic ${keygen_ui})
acg_qt4_automoc (keygen_moc ${keygen_hdr}) acg_qt4_automoc (keygen_moc ${keygen_hdr})
endif()
add_executable (Plugin-${plugin}-keygen ${keygen_uic} ${keygen_moc} ${keygen_hdr} ${keygen_src}) add_executable (Plugin-${plugin}-keygen ${keygen_uic} ${keygen_moc} ${keygen_hdr} ${keygen_src})
...@@ -491,9 +496,15 @@ function (_build_openflipper_plugin plugin) ...@@ -491,9 +496,15 @@ function (_build_openflipper_plugin plugin)
endif () endif ()
# genereate uic and moc targets # genereate uic and moc targets
if (QT5_FOUND)
acg_qt5_autouic (uic_targets ${ui})
acg_qt5_automoc (moc_targets ${headers})
acg_qt5_autoqrc (qrc_targets ${qrc})
else ()
acg_qt4_autouic (uic_targets ${ui}) acg_qt4_autouic (uic_targets ${ui})
acg_qt4_automoc (moc_targets ${headers}) acg_qt4_automoc (moc_targets ${headers})
acg_qt4_autoqrc (qrc_targets ${qrc}) acg_qt4_autoqrc (qrc_targets ${qrc})
endif ()
......
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