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) ...@@ -39,18 +39,18 @@ else (APPLE)
endif(APPLE) endif(APPLE)
# source code directories # source code directories
set (directories set (directories
.. ..
../Core ../Core
../Logging ../Logging
../Scripting ../Scripting
../Scripting/scriptPrototypes ../Scripting/scriptPrototypes
../Scripting/scriptWrappers ../Scripting/scriptWrappers
../SimpleOpt ../SimpleOpt
../widgets/aboutWidget ../widgets/aboutWidget
../widgets/addEmptyWidget ../widgets/addEmptyWidget
../widgets/loggerWidget ../widgets/loggerWidget
../widgets/coreWidget ../widgets/coreWidget
../widgets/helpWidget ../widgets/helpWidget
../widgets/processManagerWidget ../widgets/processManagerWidget
../widgets/loadWidget ../widgets/loadWidget
...@@ -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
...@@ -104,7 +110,7 @@ endif () ...@@ -104,7 +110,7 @@ endif ()
# ==================================================================================== # ====================================================================================
# Get list of ll plugin dependencies and handle special ones # 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 # linker problems
# ==================================================================================== # ====================================================================================
# Get the property containing the list of all dependencies of the plugins # Get the property containing the list of all dependencies of the plugins
...@@ -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)
...@@ -168,34 +175,28 @@ if (APPLE) ...@@ -168,34 +175,28 @@ if (APPLE)
MACOSX_BUNDLE_ICON_FILE "OpenFlipper.icns" 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 # 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 set ( APPLE_INFO_PLIST "${CMAKE_SOURCE_DIR}\\branding\\mac\\Info.plist" CACHE FILEPATH "Path to the Info.plist file for Bundle" )
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 )
else ( EXISTS ${CMAKE_SOURCE_DIR}/branding/mac/Info.plist ) # option to configure a custum Info.plist but configure with default one
# 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" )
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( EXISTS ${CMAKE_SOURCE_DIR}/branding/mac/Info.plist ) ENDIF(NOT APPLE_INFO_PLIST )
ENDIF(NOT APPLE_INFO_PLIST )
else() else()
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_CURRENT_SOURCE_DIR}/../Icons/OpenFlipper_Icon.icns" CACHE FILEPATH "Path to the Bundle Icon" )
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()
ENDIF(NOT APPLE_BUNDLE_ICON ) ENDIF(NOT APPLE_BUNDLE_ICON )
IF ( NOT APPLE_INFO_PLIST ) IF ( NOT APPLE_INFO_PLIST )
...@@ -204,21 +205,22 @@ if (APPLE) ...@@ -204,21 +205,22 @@ if (APPLE)
ENDIF(NOT APPLE_INFO_PLIST ) ENDIF(NOT APPLE_INFO_PLIST )
endif() 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 add_custom_command(TARGET OpenFlipper POST_BUILD
# toplevel CMakeLists.txt COMMAND ${CMAKE_COMMAND} -E copy_if_different "${APPLE_BUNDLE_ICON}" "${CMAKE_BINARY_DIR}/Build/${ACG_PROJECT_DATADIR}/OpenFlipper.icns"
set_target_properties ( )
# 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 OpenFlipper PROPERTIES
RUNTIME_OUTPUT_DIRECTORY "${CMAKE_BINARY_DIR}/Build" RUNTIME_OUTPUT_DIRECTORY "${CMAKE_BINARY_DIR}/Build"
MACOSX_BUNDLE_INFO_STRING "ACG OpenFlipper" MACOSX_BUNDLE_INFO_STRING "ACG OpenFlipper"
MACOSX_BUNDLE_ICON_FILE "OpenFlipper.icns" MACOSX_BUNDLE_ICON_FILE "OpenFlipper.icns"
MACOSX_BUNDLE_INFO_PLIST ${APPLE_INFO_PLIST} MACOSX_BUNDLE_INFO_PLIST ${APPLE_INFO_PLIST}
) )
endif () endif ()
...@@ -240,17 +242,17 @@ acg_copy_after_build (OpenFlipper "${CMAKE_CURRENT_SOURCE_DIR}/../Fonts" "${CMAK ...@@ -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") 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 ( 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()
if ( APPLE ) if ( APPLE )
# we need qt_menu.nib in our resources dir so try to get it # we need qt_menu.nib in our resources dir so try to get it
if ( EXISTS /opt/local/lib/Resources/qt_menu.nib ) if ( EXISTS /opt/local/lib/Resources/qt_menu.nib )
...@@ -275,7 +277,7 @@ if ( APPLE ) ...@@ -275,7 +277,7 @@ if ( APPLE )
endif() endif()
else () 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 # 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.*" ) if ( _file MATCHES ".*debug.*" )
add_custom_command(TARGET OpenFlipper POST_BUILD add_custom_command(TARGET OpenFlipper POST_BUILD
...@@ -284,7 +286,7 @@ if ( APPLE ) ...@@ -284,7 +286,7 @@ if ( APPLE )
endif() endif()
endif() endif()
endforeach () endforeach ()
elseif(WIN32) elseif(WIN32)
...@@ -319,17 +321,15 @@ if (NOT APPLE) ...@@ -319,17 +321,15 @@ if (NOT APPLE)
install( FILES "@CMAKE_BINARY_DIR@/Build/qt.conf" DESTINATION "${ACG_PROJECT_DATADIR}/" ) install( FILES "@CMAKE_BINARY_DIR@/Build/qt.conf" DESTINATION "${ACG_PROJECT_DATADIR}/" )
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()
...@@ -42,7 +42,7 @@ link_directories ( ...@@ -42,7 +42,7 @@ link_directories (
# generate dllexport macros on windows # generate dllexport macros on windows
if (WIN32) if (WIN32)
add_definitions ( add_definitions (
-DPLUGINLIBDLL -DPLUGINLIBDLL
-DACGDLL -DACGDLL
-DUSEACG -DUSEACG
) )
...@@ -66,7 +66,7 @@ if ( NOT DEFINED OPENFLIPPER_SETTINGS_DEBUG ) ...@@ -66,7 +66,7 @@ if ( NOT DEFINED OPENFLIPPER_SETTINGS_DEBUG )
endif() endif()
if ( OPENFLIPPER_SETTINGS_DEBUG ) if ( OPENFLIPPER_SETTINGS_DEBUG )
add_definitions(-DOPENFLIPPER_SETTINGS_DEBUG ) add_definitions(-DOPENFLIPPER_SETTINGS_DEBUG )
endif() endif()
#======================================================= #=======================================================
...@@ -74,13 +74,13 @@ endif() ...@@ -74,13 +74,13 @@ endif()
#======================================================= #=======================================================
# source code directories # source code directories
set (directories set (directories
../BasePlugin ../BasePlugin
../ACGHelper ../ACGHelper
../common ../common
../threads ../threads
../common/bsp ../common/bsp
../INIFile ../INIFile
../widgets/glWidget ../widgets/glWidget
../publicWidgets/objectSelectionWidget ../publicWidgets/objectSelectionWidget
) )
...@@ -99,17 +99,27 @@ acg_append_files_recursive (ui "*.ui" ${CMAKE_SOURCE_DIR}/ObjectTypes) ...@@ -99,17 +99,27 @@ 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
COMPILE_FLAGS ${ADDITIONAL_PLUGINLIB_COMPILER_FLAGS} COMPILE_FLAGS ${ADDITIONAL_PLUGINLIB_COMPILER_FLAGS}
) )
endif() endif()
......
...@@ -33,7 +33,7 @@ ...@@ -33,7 +33,7 @@
# LICENSEMANAGER = Compile plugin with license management # LICENSEMANAGER = Compile plugin with license management
# #
# Plugins can implement a acg_list_filter ("listname") macro to filter out # Plugins can implement a acg_list_filter ("listname") macro to filter out
# unneeded headers, sources and ui files from the autogenerated # unneeded headers, sources and ui files from the autogenerated
# build sources lists (see common.cmake drop_templates macro) # build sources lists (see common.cmake drop_templates macro)
# #
# Translations # Translations
...@@ -41,7 +41,7 @@ ...@@ -41,7 +41,7 @@
# The *.ts files there will be used for the translations # The *.ts files there will be used for the translations
# #
# Special DEPS: # Special DEPS:
# CUDA: # CUDA:
# If your plugin requires cuda, add "CUDA" to the list of dependencies # If your plugin requires cuda, add "CUDA" to the list of dependencies
# and create a subdir called Cuda in your plugin directory # and create a subdir called Cuda in your plugin directory
# The files in this directory will be compiled by nvcc and linked # The files in this directory will be compiled by nvcc and linked
...@@ -104,23 +104,23 @@ macro (_check_plugin_deps _prefix _optional ) ...@@ -104,23 +104,23 @@ macro (_check_plugin_deps _prefix _optional )
# This will contain the final list of all dependencies # This will contain the final list of all dependencies
list (APPEND FULL_DEPENDENCY_LIST "") list (APPEND FULL_DEPENDENCY_LIST "")
#====================================================================================== #======================================================================================
# Collect dependencies of dependencies # Collect dependencies of dependencies
# Recursive dependencies will be added here. # Recursive dependencies will be added here.
# The base package name will be used and the variables # The base package name will be used and the variables
# PACKAGE_DEPS : Mandatory recursive dependencies # PACKAGE_DEPS : Mandatory recursive dependencies
# PACKAGE_OPT_DEPS : Optional recursive dependencies # PACKAGE_OPT_DEPS : Optional recursive dependencies
#====================================================================================== #======================================================================================
foreach (_val ${ARGN}) foreach (_val ${ARGN})
string (TOUPPER ${_val} _VAL) string (TOUPPER ${_val} _VAL)
# First we try to find the dependencies directly # First we try to find the dependencies directly
find_package(${_val}) find_package(${_val})
# This will contain the list of all dependencies of the current base dependency ( including recursive dependencies for one level ) # This will contain the list of all dependencies of the current base dependency ( including recursive dependencies for one level )
set (CURRENT_DEPENDENCY_LIST "") set (CURRENT_DEPENDENCY_LIST "")
# Flag if all dependencies were found (Only mandatory ones) # Flag if all dependencies were found (Only mandatory ones)
set (ALL_REQUIRED_DEPENDENCIES_FOUND TRUE) set (ALL_REQUIRED_DEPENDENCIES_FOUND TRUE)
# Recursive dependencies which are not optional will also be added by default (Not optional, so error if not available!) # Recursive dependencies which are not optional will also be added by default (Not optional, so error if not available!)
...@@ -131,7 +131,7 @@ macro (_check_plugin_deps _prefix _optional ) ...@@ -131,7 +131,7 @@ macro (_check_plugin_deps _prefix _optional )
string (TOUPPER ${_rec_dep} _REC_DEP) string (TOUPPER ${_rec_dep} _REC_DEP)
find_package(${_rec_dep}) find_package(${_rec_dep})
if ( ${_REC_DEP}_FOUND ) if ( ${_REC_DEP}_FOUND )
list (APPEND CURRENT_DEPENDENCY_LIST ${_rec_dep} ) list (APPEND CURRENT_DEPENDENCY_LIST ${_rec_dep} )
add_definitions( -DENABLE_${_REC_DEP} ) add_definitions( -DENABLE_${_REC_DEP} )
...@@ -140,7 +140,7 @@ macro (_check_plugin_deps _prefix _optional ) ...@@ -140,7 +140,7 @@ macro (_check_plugin_deps _prefix _optional )
acg_set (_${_prefix}_MISSING_DEPS "${_${_prefix}_MISSING_DEPS} ${_VAL}_MISSING_MANDATORY_RECURSIVE_DEP_${_REC_DEP}") acg_set (_${_prefix}_MISSING_DEPS "${_${_prefix}_MISSING_DEPS} ${_VAL}_MISSING_MANDATORY_RECURSIVE_DEP_${_REC_DEP}")
endif() endif()
endforeach() endforeach()
endif() endif()
...@@ -154,7 +154,7 @@ macro (_check_plugin_deps _prefix _optional ) ...@@ -154,7 +154,7 @@ macro (_check_plugin_deps _prefix _optional )
find_package(${_rec_dep}) find_package(${_rec_dep})
# Optional so add if we found the dependency or we skip it. # Optional so add if we found the dependency or we skip it.
# Defines will be added due to the optional status # Defines will be added due to the optional status
if ( ${_REC_DEP}_FOUND ) if ( ${_REC_DEP}_FOUND )
list (APPEND CURRENT_DEPENDENCY_LIST ${_rec_dep} ) list (APPEND CURRENT_DEPENDENCY_LIST ${_rec_dep} )
add_definitions( -DENABLE_${_REC_DEP} ) add_definitions( -DENABLE_${_REC_DEP} )
...@@ -224,7 +224,7 @@ macro (_check_plugin_deps _prefix _optional ) ...@@ -224,7 +224,7 @@ macro (_check_plugin_deps _prefix _optional )
# Remove it again, if it was a duplicate # Remove it again, if it was a duplicate
list(REMOVE_DUPLICATES global_dependency_list) list(REMOVE_DUPLICATES global_dependency_list)
# Store the list in the global property # Store the list in the global property
set_property( GLOBAL PROPERTY GLOBAL_PLUGIN_DEPENDENCIES_LIST ${global_dependency_list} ) set_property( GLOBAL PROPERTY GLOBAL_PLUGIN_DEPENDENCIES_LIST ${global_dependency_list} )
...@@ -258,7 +258,7 @@ macro (_check_plugin_deps _prefix _optional ) ...@@ -258,7 +258,7 @@ macro (_check_plugin_deps _prefix _optional )
if (DEFINED ${_name}_LINKER_FLAGS) if (DEFINED ${_name}_LINKER_FLAGS)
# list (APPEND ${_prefix}_DEPS_LINKER_FLAGS "${${_name}_LINKER_FLAGS}") # list (APPEND ${_prefix}_DEPS_LINKER_FLAGS "${${_name}_LINKER_FLAGS}")
# this variable is used as a string later on (not as a list!!!) # this variable is used as a string later on (not as a list!!!)
set( ${_prefix}_DEPS_LINKER_FLAGS "${${_prefix}_DEPS_LINKER_FLAGS} ${${_name}_LINKER_FLAGS}") set( ${_prefix}_DEPS_LINKER_FLAGS "${${_prefix}_DEPS_LINKER_FLAGS} ${${_name}_LINKER_FLAGS}")
endif () endif ()
if (DEFINED ${_name}_COMPILER_FLAGS) if (DEFINED ${_name}_COMPILER_FLAGS)
# list (APPEND ${_prefix}_DEPS_COMPILER_FLAGS "${${_name}_COMPILER_FLAGS}") # list (APPEND ${_prefix}_DEPS_COMPILER_FLAGS "${${_name}_COMPILER_FLAGS}")
...@@ -292,10 +292,15 @@ macro (_plugin_licensemanagement) ...@@ -292,10 +292,15 @@ macro (_plugin_licensemanagement)
acg_append_files (keygen_hdr "*.hh" "${CMAKE_SOURCE_DIR}/OpenFlipper/LicenseManager/keyGen") acg_append_files (keygen_hdr "*.hh" "${CMAKE_SOURCE_DIR}/OpenFlipper/LicenseManager/keyGen")
acg_append_files (keygen_src "*.cc" "${CMAKE_SOURCE_DIR}/OpenFlipper/LicenseManager/keyGen") acg_append_files (keygen_src "*.cc" "${CMAKE_SOURCE_DIR}/OpenFlipper/LicenseManager/keyGen")
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
acg_qt4_autouic (keygen_uic ${keygen_ui}) if (QT5_FOUND)
acg_qt4_automoc (keygen_moc ${keygen_hdr}) acg_qt5_autouic (keygen_uic ${keygen_ui})
acg_qt5_automoc (keygen_moc ${keygen_hdr})
else ()
acg_qt4_autouic (keygen_uic ${keygen_ui})
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})
...@@ -340,7 +345,7 @@ function (_build_openflipper_plugin plugin) ...@@ -340,7 +345,7 @@ function (_build_openflipper_plugin plugin)
#============================================================================================ #============================================================================================
# parse parameters # parse parameters
#============================================================================================ #============================================================================================
_get_plugin_parameters (${_PLUGIN} ${ARGN}) _get_plugin_parameters (${_PLUGIN} ${ARGN})
#============================================================================================ #============================================================================================
...@@ -400,7 +405,7 @@ function (_build_openflipper_plugin plugin) ...@@ -400,7 +405,7 @@ function (_build_openflipper_plugin plugin)
"${CMAKE_SOURCE_DIR}/ObjectTypes/*/CMakeLists.txt" "${CMAKE_SOURCE_DIR}/ObjectTypes/*/CMakeLists.txt"
) )
# include all cmake files found for objecttypes here # include all cmake files found for objecttypes here
foreach ( _buildInfo ${_plugin_buildinfos}) foreach ( _buildInfo ${_plugin_buildinfos})
include ("${CMAKE_SOURCE_DIR}/${_buildInfo}") include ("${CMAKE_SOURCE_DIR}/${_buildInfo}")
...@@ -409,36 +414,36 @@ function (_build_openflipper_plugin plugin) ...@@ -409,36 +414,36 @@ function (_build_openflipper_plugin plugin)
link_directories ( link_directories (
${${_PLUGIN}_DEPS_LIBDIRS} ${${_PLUGIN}_DEPS_LIBDIRS}
${${_PLUGIN}_LIBDIRS} ${${_PLUGIN}_LIBDIRS}
${ADDITIONAL_PLUGINLIB_LINK_DIRS} ${ADDITIONAL_PLUGINLIB_LINK_DIRS}
) )
else (APPLE) else (APPLE)
link_directories ( link_directories (
${${_PLUGIN}_DEPS_LIBDIRS} ${${_PLUGIN}_DEPS_LIBDIRS}
${${_PLUGIN}_LIBDIRS} ${${_PLUGIN}_LIBDIRS}
) )
endif(APPLE) endif(APPLE)
set (directories set (directories
. .
${${_PLUGIN}_DIRS} ${${_PLUGIN}_DIRS}
) )
#============================================================================================ #============================================================================================
# User Documentation build # User Documentation build
#============================================================================================ #============================================================================================
# Only build the documentation if a userdoc subdirectory exists for the plugin # Only build the documentation if a userdoc subdirectory exists for the plugin
if(IS_DIRECTORY ${CMAKE_CURRENT_SOURCE_DIR}/userDoc) if(IS_DIRECTORY ${CMAKE_CURRENT_SOURCE_DIR}/userDoc)
set(plugin_html_doc_dir "${CMAKE_BINARY_DIR}/Build/${ACG_PROJECT_DATADIR}/Doc/UserHTML/Plugin-${plugin}") set(plugin_html_doc_dir "${CMAKE_BINARY_DIR}/Build/${ACG_PROJECT_DATADIR}/Doc/UserHTML/Plugin-${plugin}")
set(plugin_qt_help_dir "${CMAKE_BINARY_DIR}/Build/${ACG_PROJECT_DATADIR}/Help") set(plugin_qt_help_dir "${CMAKE_BINARY_DIR}/Build/${ACG_PROJECT_DATADIR}/Help")
find_package(Doxygen) find_package(Doxygen)
if ( DOXYGEN_FOUND ) if ( DOXYGEN_FOUND )
# Create user documentation target with our template doxy file # Create user documentation target with our template doxy file
acg_create_doc_target( doc-User-${plugin} "${CMAKE_SOURCE_DIR}/OpenFlipper/Documentation/PluginDoxyTemplate" ) acg_create_doc_target( doc-User-${plugin} "${CMAKE_SOURCE_DIR}/OpenFlipper/Documentation/PluginDoxyTemplate" )
# make doc builds this plugin's documentation as well # make doc builds this plugin's documentation as well
...@@ -452,7 +457,7 @@ function (_build_openflipper_plugin plugin) ...@@ -452,7 +457,7 @@ function (_build_openflipper_plugin plugin)
# Create directories in order to avoid doxygen warnings # Create directories in order to avoid doxygen warnings
if(NOT (IS_DIRECTORY ${plugin_qt_help_dir}) ) if(NOT (IS_DIRECTORY ${plugin_qt_help_dir}) )
file(MAKE_DIRECTORY ${plugin_qt_help_dir} ) file(MAKE_DIRECTORY ${plugin_qt_help_dir} )
endif() endif()
endif() endif()
...@@ -484,19 +489,25 @@ function (_build_openflipper_plugin plugin) ...@@ -484,19 +489,25 @@ function (_build_openflipper_plugin plugin)
set(${_PLUGIN}_LICENSE_DEFS "") set(${_PLUGIN}_LICENSE_DEFS "")
if (${_PLUGIN}_LICENSEMANAGER ) if (${_PLUGIN}_LICENSEMANAGER )
_plugin_licensemanagement () _plugin_licensemanagement ()
if ( OPENFLIPPER_ENABLE_LICENSE_MANAGER ) if ( OPENFLIPPER_ENABLE_LICENSE_MANAGER )
set(${_PLUGIN}_LICENSE_DEFS "-DWITH_LICENSE_MANAGER") set(${_PLUGIN}_LICENSE_DEFS "-DWITH_LICENSE_MANAGER")
endif() endif()
endif () endif ()
# 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_qt4_autoqrc (qrc_targets ${qrc}) acg_qt5_automoc (moc_targets ${headers})
acg_qt5_autoqrc (qrc_targets ${qrc})
else ()
acg_qt4_autouic (uic_targets ${ui})
acg_qt4_automoc (moc_targets ${headers})
acg_qt4_autoqrc (qrc_targets ${qrc})
endif ()
add_library (Plugin-${plugin} MODULE ${uic_targets} ${sources} ${headers} ${moc_targets} ${qrc_targets} ${${_PLUGIN}_ADDSRC}) add_library (Plugin-${plugin} MODULE ${uic_targets} ${sources} ${headers} ${moc_targets} ${qrc_targets} ${${_PLUGIN}_ADDSRC})
# add this plugin to build plugin list for dependency tracking