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
......@@ -39,18 +39,18 @@ else (APPLE)
endif(APPLE)
# source code directories
set (directories
..
set (directories
..
../Core
../Logging
../Scripting
../Scripting/scriptPrototypes
../Scripting/scriptWrappers
../SimpleOpt
../widgets/aboutWidget
../widgets/aboutWidget
../widgets/addEmptyWidget
../widgets/loggerWidget
../widgets/coreWidget
../widgets/coreWidget
../widgets/helpWidget
../widgets/processManagerWidget
../widgets/loadWidget
......@@ -73,8 +73,14 @@ acg_append_files (ui "*.ui" ${directories})
acg_drop_templates (sources)
# genereate uic and moc targets
acg_qt4_autouic (uic_targets ${ui})
acg_qt4_automoc (moc_targets ${headers})
if (QT5_FOUND)
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)
# add app icon rc file to windows build
......@@ -104,7 +110,7 @@ endif ()
# ====================================================================================
# Get list of ll plugin dependencies and handle special ones
# where we need to link the library directly into the core to prevent
# where we need to link the library directly into the core to prevent
# linker problems
# ====================================================================================
# Get the property containing the list of all dependencies of the plugins
......@@ -155,6 +161,7 @@ target_link_libraries (OpenFlipper
${GLUT_LIBRARIES}
${FTGL_LIBS}
${COREAPP_ADDITIONAL_LINK_LIBRARIES}
)
if (APPLE)
......@@ -168,34 +175,28 @@ if (APPLE)
MACOSX_BUNDLE_ICON_FILE "OpenFlipper.icns"
)
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
set ( APPLE_BUNDLE_ICON "${CMAKE_SOURCE_DIR}\\branding\\mac\\OpenFlipper_Icon.icns" CACHE FILEPATH "Path to the Bundle Icon" )
ENDIF(NOT APPLE_BUNDLE_ICON )
# Take plist from branding
IF ( NOT APPLE_INFO_PLIST )
if ( EXISTS ${CMAKE_SOURCE_DIR}/branding/mac/Info.plist )
# option to configure the custom Info.plist
set ( APPLE_INFO_PLIST "${CMAKE_SOURCE_DIR}\\branding\\mac\\Info.plist" CACHE FILEPATH "Path to the Info.plist file for Bundle" )
else ( EXISTS ${CMAKE_SOURCE_DIR}/branding/mac/Info.plist )
# option to configure a custum Info.plist but configure with default one
set ( APPLE_INFO_PLIST "${CMAKE_CURRENT_SOURCE_DIR}/../installer/mac/Info.plist" CACHE FILEPATH "Path to the Info.plist file for Bundle" )
endif( EXISTS ${CMAKE_SOURCE_DIR}/branding/mac/Info.plist )
ENDIF(NOT APPLE_INFO_PLIST )
ENDIF(NOT APPLE_BUNDLE_ICON )
IF ( NOT APPLE_INFO_PLIST )
if ( EXISTS ${CMAKE_SOURCE_DIR}/branding/mac/Info.plist )
# option to configure the custom Info.plist
set ( APPLE_INFO_PLIST "${CMAKE_SOURCE_DIR}\\branding\\mac\\Info.plist" CACHE FILEPATH "Path to the Info.plist file for Bundle" )
else ( EXISTS ${CMAKE_SOURCE_DIR}/branding/mac/Info.plist )
# option to configure a custum Info.plist but configure with default one
set ( APPLE_INFO_PLIST "${CMAKE_CURRENT_SOURCE_DIR}/../installer/mac/Info.plist" CACHE FILEPATH "Path to the Info.plist file for Bundle" )
endif( EXISTS ${CMAKE_SOURCE_DIR}/branding/mac/Info.plist )
ENDIF(NOT APPLE_INFO_PLIST )
else()
IF ( NOT APPLE_BUNDLE_ICON )
# 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" )
endif()
set ( APPLE_BUNDLE_ICON "${CMAKE_CURRENT_SOURCE_DIR}/../Icons/OpenFlipper_Icon.icns" CACHE FILEPATH "Path to the Bundle Icon" )
ENDIF(NOT APPLE_BUNDLE_ICON )
IF ( NOT APPLE_INFO_PLIST )
......@@ -204,21 +205,22 @@ if (APPLE)
ENDIF(NOT APPLE_INFO_PLIST )
endif()
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"
)
# create bundle in "Build" directory and set icon
# no install needed here, because the whole bundle will be installed in the
# toplevel CMakeLists.txt
set_target_properties (
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"
)
# create bundle in "Build" directory and set icon
# no install needed here, because the whole bundle will be installed in the
# toplevel CMakeLists.txt
set_target_properties (
OpenFlipper PROPERTIES
RUNTIME_OUTPUT_DIRECTORY "${CMAKE_BINARY_DIR}/Build"
MACOSX_BUNDLE_INFO_STRING "ACG OpenFlipper"
MACOSX_BUNDLE_ICON_FILE "OpenFlipper.icns"
MACOSX_BUNDLE_INFO_PLIST ${APPLE_INFO_PLIST}
)
)
endif ()
......@@ -240,17 +242,17 @@ acg_copy_after_build (OpenFlipper "${CMAKE_CURRENT_SOURCE_DIR}/../Fonts" "${CMAK
acg_copy_after_build (OpenFlipper "${CMAKE_CURRENT_SOURCE_DIR}/../Documentation/QtHelpResources" "${CMAKE_BINARY_DIR}/Build/${ACG_PROJECT_DATADIR}/Help")
if ( EXISTS ${CMAKE_SOURCE_DIR}/branding )
if ( WIN32 )
acg_copy_after_build (OpenFlipper "${CMAKE_SOURCE_DIR}/branding/win/Icons" "${CMAKE_BINARY_DIR}/Build/${ACG_PROJECT_DATADIR}/Icons")
if ( WIN32 )
acg_copy_after_build (OpenFlipper "${CMAKE_SOURCE_DIR}/branding/win" "${CMAKE_BINARY_DIR}/Build/${ACG_PROJECT_DATADIR}/Icons")
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()
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()
if ( APPLE )
if ( APPLE )
# we need qt_menu.nib in our resources dir so try to get it
if ( EXISTS /opt/local/lib/Resources/qt_menu.nib )
......@@ -275,7 +277,7 @@ if ( APPLE )
endif()
else ()
# In debug mode, we don't want release binaries in the bundle as it could cause crashes due to wrong linking or mixing of debug and release
if ( _file MATCHES ".*debug.*" )
add_custom_command(TARGET OpenFlipper POST_BUILD
......@@ -284,7 +286,7 @@ if ( APPLE )
endif()
endif()
endforeach ()
elseif(WIN32)
......@@ -319,17 +321,15 @@ if (NOT APPLE)
install( FILES "@CMAKE_BINARY_DIR@/Build/qt.conf" DESTINATION "${ACG_PROJECT_DATADIR}/" )
acg_install_dir ("${CMAKE_BINARY_DIR}/Build/QtPlugins/" "${ACG_PROJECT_DATADIR}/QtPlugins")
endif(WIN32)
if ( EXISTS ${CMAKE_SOURCE_DIR}/branding/win )
if ( WIN32 )
if ( EXISTS ${CMAKE_SOURCE_DIR}/branding )
if ( WIN32 )
acg_install_dir ( "${CMAKE_SOURCE_DIR}/branding/win" "${ACG_PROJECT_DATADIR}/Icons")
endif()
endif()
#todo install splash file for windows and Linux branding
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()
......@@ -42,7 +42,7 @@ link_directories (
# generate dllexport macros on windows
if (WIN32)
add_definitions (
-DPLUGINLIBDLL
-DPLUGINLIBDLL
-DACGDLL
-DUSEACG
)
......@@ -66,7 +66,7 @@ if ( NOT DEFINED OPENFLIPPER_SETTINGS_DEBUG )
endif()
if ( OPENFLIPPER_SETTINGS_DEBUG )
add_definitions(-DOPENFLIPPER_SETTINGS_DEBUG )
add_definitions(-DOPENFLIPPER_SETTINGS_DEBUG )
endif()
#=======================================================
......@@ -74,13 +74,13 @@ endif()
#=======================================================
# source code directories
set (directories
../BasePlugin
../ACGHelper
../common
set (directories
../BasePlugin
../ACGHelper
../common
../threads
../common/bsp
../INIFile
../common/bsp
../INIFile
../widgets/glWidget
../publicWidgets/objectSelectionWidget
)
......@@ -99,17 +99,27 @@ acg_append_files_recursive (ui "*.ui" ${CMAKE_SOURCE_DIR}/ObjectTypes)
acg_drop_templates (sources)
# genereate uic and moc targets
acg_qt4_autouic (uic_targets ${ui})
acg_qt4_automoc (moc_targets ${headers})
if (QT5_FOUND)
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
#=======================================================
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 )
set_target_properties (
OpenFlipperPluginLib PROPERTIES
OpenFlipperPluginLib PROPERTIES
COMPILE_FLAGS ${ADDITIONAL_PLUGINLIB_COMPILER_FLAGS}
)
endif()
......
This diff is collapsed.
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