Commit 651cfe5c 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 fe1833e3
...@@ -8,7 +8,23 @@ if ( ${PROJECT_NAME} MATCHES "OpenFlipper") ...@@ -8,7 +8,23 @@ if ( ${PROJECT_NAME} MATCHES "OpenFlipper")
endif() endif()
acg_qt4 (REQUIRED 4.5)
if (NOT FORCE_QT4)
# try to use QT5 if possible otherwise stick to QT4
acg_qt5 ()
else()
set (QT_MAX_VERSION 4.9.9)
set (QT5_FOUND false)
endif()
if (NOT QT5_FOUND)
message(STATUS "Using QT4 for ACG")
acg_qt4 (REQUIRED 4.5)
else ()
message(STATUS "Using QT5 for ACG")
endif ()
acg_openmp () acg_openmp ()
acg_ftgl () acg_ftgl ()
...@@ -48,10 +64,10 @@ find_package(Qwt5) ...@@ -48,10 +64,10 @@ find_package(Qwt5)
if(Qwt5_Qt4_FOUND) if(Qwt5_Qt4_FOUND)
add_definitions(-DWITH_QWT) add_definitions(-DWITH_QWT)
set(INCLUDE_DIRS ${INCLUDE_DIRS} ${Qwt5_INCLUDE_DIR} ) set(INCLUDE_DIRS ${INCLUDE_DIRS} ${Qwt5_INCLUDE_DIR} )
set(ADDITIONAL_LINK_LIBRARIES ${ADDITIONAL_LINK_LIBRARIES} ${Qwt5_Qt4_LIBRARY}) set(ADDITIONAL_LINK_LIBRARIES ${ADDITIONAL_LINK_LIBRARIES} ${Qwt5_Qt4_LIBRARY})
endif() endif()
find_package( Freetype) find_package( Freetype)
if (NOT FREETYPE_FOUND) if (NOT FREETYPE_FOUND)
message (MESSAGE "FREETYPE not found! Disabled ftgl support!") message (MESSAGE "FREETYPE not found! Disabled ftgl support!")
else (NOT FREETYPE_FOUND) else (NOT FREETYPE_FOUND)
...@@ -60,7 +76,7 @@ else (NOT FREETYPE_FOUND) ...@@ -60,7 +76,7 @@ else (NOT FREETYPE_FOUND)
message (MESSAGE "FTGL not found! Disabled ftgl support!") message (MESSAGE "FTGL not found! Disabled ftgl support!")
else () else ()
set(INCLUDE_DIRS ${INCLUDE_DIRS} ${FREETYPE_INCLUDE_DIR_freetype2} ${FREETYPE_INCLUDE_DIR_ft2build} ) set(INCLUDE_DIRS ${INCLUDE_DIRS} ${FREETYPE_INCLUDE_DIR_freetype2} ${FREETYPE_INCLUDE_DIR_ft2build} )
set( ADDITIONAL_LINK_LIBRARIES ${ADDITIONAL_LINK_LIBRARIES} ${FTGL_LIBS} ${FREETYPE_LIBRARIES} ) set( ADDITIONAL_LINK_LIBRARIES ${ADDITIONAL_LINK_LIBRARIES} ${FTGL_LIBS} ${FREETYPE_LIBRARIES} )
endif () endif ()
endif () endif ()
...@@ -103,7 +119,7 @@ endif(GTEST_FOUND) ...@@ -103,7 +119,7 @@ endif(GTEST_FOUND)
#=================================================================== #===================================================================
# source code directories # source code directories
set (directories set (directories
. .
Geometry Geometry
Config Config
...@@ -133,10 +149,20 @@ acg_append_files (ui "*.ui" ${directories}) ...@@ -133,10 +149,20 @@ 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}) 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()
acg_add_library (ACG SHARED ${uic_targets} ${sources} ${headers} ${moc_targets}) if (QT5_FOUND)
acg_add_library (ACG SHARED ${uic_targets} ${sources} ${headers} ${moc_targets})
elseif (QT4_FOUND)
acg_add_library (ACG SHARED ${uic_targets} ${sources} ${headers} ${moc_targets})
endif()
if ( NOT WIN32 ) if ( NOT WIN32 )
set_target_properties (ACG PROPERTIES VERSION ${ACG_VERSION_MAJOR}.${ACG_VERSION_MINOR} set_target_properties (ACG PROPERTIES VERSION ${ACG_VERSION_MAJOR}.${ACG_VERSION_MINOR}
SOVERSION ${ACG_VERSION_MAJOR}.${ACG_VERSION_MINOR}) SOVERSION ${ACG_VERSION_MAJOR}.${ACG_VERSION_MINOR})
...@@ -156,4 +182,3 @@ target_link_libraries ( ACG OpenMeshCore ...@@ -156,4 +182,3 @@ target_link_libraries ( ACG OpenMeshCore
${GLEW_LIBRARY} ${GLEW_LIBRARY}
${GLUT_LIBRARIES} ${GLUT_LIBRARIES}
${ADDITIONAL_LINK_LIBRARIES} ) ${ADDITIONAL_LINK_LIBRARIES} )
...@@ -26,8 +26,23 @@ acg_get_version (OpenFlipper) ...@@ -26,8 +26,23 @@ acg_get_version (OpenFlipper)
include (package) include (package)
include (ACGOutput) include (ACGOutput)
# try to use QT5 if possible otherwise stick to QT4
set (FORCE_QT4 ON CACHE BOOL "Use Qt4 even if Qt5 was found")
if (NOT FORCE_QT4)
acg_qt5 ()
else()
set (QT5_FOUND false)
endif()
if (NOT QT5_FOUND)
message(STATUS "Using QT4 for OpenFlipper")
acg_qt4 (4.7.0)
else ()
message(STATUS "Using QT5 for OpenFlipper")
endif ()
acg_qt4 (4.7.0)
acg_openmp () acg_openmp ()
acg_ftgl () acg_ftgl ()
...@@ -97,12 +112,12 @@ add_subdirectory (OpenFlipper/PluginLib) ...@@ -97,12 +112,12 @@ add_subdirectory (OpenFlipper/PluginLib)
add_subdirectory (tests) add_subdirectory (tests)
# ======================================================================== # ========================================================================
# Documentation generators # Documentation generators
# ======================================================================== # ========================================================================
# Create dirs to make doxygen happy # Create dirs to make doxygen happy
file(MAKE_DIRECTORY ${CMAKE_BINARY_DIR}/Build/${ACG_PROJECT_DATADIR}/Doc ) file(MAKE_DIRECTORY ${CMAKE_BINARY_DIR}/Build/${ACG_PROJECT_DATADIR}/Doc )
file(MAKE_DIRECTORY ${CMAKE_BINARY_DIR}/Build/${ACG_PROJECT_DATADIR}/Help ) file(MAKE_DIRECTORY ${CMAKE_BINARY_DIR}/Build/${ACG_PROJECT_DATADIR}/Help )
# Add the deocumentation targets # Add the deocumentation targets
add_subdirectory (OpenFlipper/Documentation/DeveloperTarget) add_subdirectory (OpenFlipper/Documentation/DeveloperTarget)
...@@ -110,12 +125,11 @@ add_subdirectory (OpenFlipper/Documentation/DeveloperQtHelpTarget) ...@@ -110,12 +125,11 @@ add_subdirectory (OpenFlipper/Documentation/DeveloperQtHelpTarget)
add_subdirectory (OpenFlipper/Documentation/UserTarget) add_subdirectory (OpenFlipper/Documentation/UserTarget)
add_subdirectory (OpenFlipper/Documentation/UserQtHelpTarget) add_subdirectory (OpenFlipper/Documentation/UserQtHelpTarget)
# ======================================================================== # ========================================================================
# Build all additional libraries # Build all additional libraries
# ======================================================================== # ========================================================================
# search all libs in the libs directory # search all libs in the libs directory
# (required and optional libraries # (required and optional libraries
file ( file (
GLOB _local_libs_in GLOB _local_libs_in
...@@ -152,7 +166,7 @@ foreach (_localLib ${REMAINING_LOCAL_LIBS}) ...@@ -152,7 +166,7 @@ foreach (_localLib ${REMAINING_LOCAL_LIBS})
# If the library is in the required folder, we have to build it anyway, so # If the library is in the required folder, we have to build it anyway, so
# detect it here # detect it here
SET(REQUIRED FALSE) SET(REQUIRED FALSE)
if ( _localLib MATCHES ".*libs_required.*" ) if ( _localLib MATCHES ".*libs_required.*" )
SET(REQUIRED TRUE ) SET(REQUIRED TRUE )
endif() endif()
...@@ -160,7 +174,7 @@ foreach (_localLib ${REMAINING_LOCAL_LIBS}) ...@@ -160,7 +174,7 @@ foreach (_localLib ${REMAINING_LOCAL_LIBS})
# Extract upper case library dir name for the human readable entries in the cmake config # Extract upper case library dir name for the human readable entries in the cmake config
string(TOUPPER ${_local_lib_dir} _local_lib_dir_upper) string(TOUPPER ${_local_lib_dir} _local_lib_dir_upper)
string(REGEX REPLACE "LIBS[/\\]" "" _local_lib_dir_upper ${_local_lib_dir_upper} ) string(REGEX REPLACE "LIBS[/\\]" "" _local_lib_dir_upper ${_local_lib_dir_upper} )
# Only generate setting if the lib is not required (otherwise, we will always build it) # Only generate setting if the lib is not required (otherwise, we will always build it)
if ( NOT DEFINED LIB_${_local_lib_dir_upper}_BUILD AND NOT REQUIRED) if ( NOT DEFINED LIB_${_local_lib_dir_upper}_BUILD AND NOT REQUIRED)
set( LIB_${_local_lib_dir_upper}_BUILD true CACHE BOOL "Enable or disable build of ${_local_lib_dir_upper} Library" ) set( LIB_${_local_lib_dir_upper}_BUILD true CACHE BOOL "Enable or disable build of ${_local_lib_dir_upper} Library" )
...@@ -176,7 +190,7 @@ endforeach () ...@@ -176,7 +190,7 @@ endforeach ()
# PolyLine extension special case # PolyLine extension special case
# ======================================================================== # ========================================================================
if ( EXISTS ${CMAKE_SOURCE_DIR}/libs/MeshIntegration ) if ( EXISTS ${CMAKE_SOURCE_DIR}/libs/MeshIntegration )
add_definitions( -DEXTENDED_POLY_LINE ) add_definitions( -DEXTENDED_POLY_LINE )
endif() endif()
...@@ -217,10 +231,10 @@ add_subdirectory (OpenFlipper/CoreApp) ...@@ -217,10 +231,10 @@ add_subdirectory (OpenFlipper/CoreApp)
if (WIN32 ) if (WIN32 )
# Plugins collected a list of required libdirs for getting # Plugins collected a list of required libdirs for getting
# their DLLS on windows: # their DLLS on windows:
get_property( WINDOWS_COPY_LIBDIRS GLOBAL PROPERTY WINDOWS_LIBRARY_DIR_LIST ) get_property( WINDOWS_COPY_LIBDIRS GLOBAL PROPERTY WINDOWS_LIBRARY_DIR_LIST )
if ( WINDOWS_COPY_LIBDIRS ) if ( WINDOWS_COPY_LIBDIRS )
list(REMOVE_DUPLICATES WINDOWS_COPY_LIBDIRS) list(REMOVE_DUPLICATES WINDOWS_COPY_LIBDIRS)
endif() endif()
...@@ -234,7 +248,7 @@ if (WIN32 ) ...@@ -234,7 +248,7 @@ if (WIN32 )
# let bundle generation depend on all targets # let bundle generation depend on all targets
add_dependencies (fixbundle OpenFlipper PluginLib ${OPENFLIPPER_PLUGINS}) add_dependencies (fixbundle OpenFlipper PluginLib ${OPENFLIPPER_PLUGINS})
endif(WIN32) endif(WIN32)
# ======================================================================== # ========================================================================
...@@ -250,18 +264,18 @@ if ( APPLE ) ...@@ -250,18 +264,18 @@ if ( APPLE )
# prepare bundle generation cmake file and add a build target for it # prepare bundle generation cmake file and add a build target for it
configure_file ("${CMAKE_SOURCE_DIR}/OpenFlipper/cmake/fixbundle.cmake.in" configure_file ("${CMAKE_SOURCE_DIR}/OpenFlipper/cmake/fixbundle.cmake.in"
"${CMAKE_BINARY_DIR}/fixbundle.cmake" @ONLY IMMEDIATE) "${CMAKE_BINARY_DIR}/fixbundle.cmake" @ONLY IMMEDIATE)
# Fixbundle is only necessary, when we wan't a shippable package. # Fixbundle is only necessary, when we wan't a shippable package.
# Otherwise the original rpaths are used # Otherwise the original rpaths are used
if ( OPENFLIPPER_CALL_FIX_BUNDLE ) if ( OPENFLIPPER_CALL_FIX_BUNDLE )
# Call fixbundle every time # Call fixbundle every time
add_custom_target (fixbundle ALL add_custom_target (fixbundle ALL
COMMAND ${CMAKE_COMMAND} -P "${CMAKE_BINARY_DIR}/fixbundle.cmake" COMMAND ${CMAKE_COMMAND} -P "${CMAKE_BINARY_DIR}/fixbundle.cmake"
) )
else() else()
# Call fixbundle only as a dependency # Call fixbundle only as a dependency
add_custom_target (fixbundle add_custom_target (fixbundle
COMMAND ${CMAKE_COMMAND} -P "${CMAKE_BINARY_DIR}/fixbundle.cmake" COMMAND ${CMAKE_COMMAND} -P "${CMAKE_BINARY_DIR}/fixbundle.cmake"
) )
endif() endif()
......
...@@ -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