Commit a179e7e0 authored by Jan Möbius's avatar Jan Möbius

Extended branding to track packages with branding.

parent 8e19217a
Pipeline #1128 passed with stage
......@@ -31,23 +31,61 @@ include (ACGCommon)
acg_get_version (OpenFlipper)
# ========================================================================
# Branding Flags
# Branding
# ========================================================================
if ( EXISTS ${CMAKE_SOURCE_DIR}/branding/branding.cmake )
include(${CMAKE_SOURCE_DIR}/branding/branding.cmake)
# search all branding dirs in the packages and in toplevel
file (
GLOB _local_branding_in
RELATIVE "${CMAKE_SOURCE_DIR}"
"${CMAKE_SOURCE_DIR}/branding"
"${CMAKE_SOURCE_DIR}/Package-*/branding"
)
# Get number of found branding dirs
list(LENGTH _local_branding_in branding_dir_count)
# Check if we found at least one branding directory
if ( ${branding_dir_count} GREATER 0 )
list(GET _local_branding_in 0 BRANDING_DIRECTORY_TMP)
set( BRANDING_DIRECTORY "${CMAKE_SOURCE_DIR}/${BRANDING_DIRECTORY_TMP}" CACHE PATH "Path to the branding files")
if ( ${branding_dir_count} GREATER 1 )
message(WARNING "Found multiple branding dirs in : ${_local_branding_in}")
message(WARNING "Using only first branding directory: ${BRANDING_DIRECTORY}")
endif()
elseif()
set( BRANDING_DIRECTORY "branding" CACHE PATH "Path to the branding files")
endif()
if ( EXISTS ${BRANDING_DIRECTORY}/branding.cmake )
include(${BRANDING_DIRECTORY}/branding.cmake)
endif()
if ( EXISTS ${BRANDING_DIRECTORY}/branding.h )
set( BRANDING_HEADER true CACHE String "Indicate there is a branding.h inside the branding folder that should be included.")
endif()
#Initialize with defaults, if not already set via branding cmake file
set( OPENFLIPPER_PRODUCT_STRING "OpenFlipper" CACHE String "Product string used e.g. to determine the config file path. Should only contain alphanumeric characters (no spaces)." )
set( OPENFLIPPER_PRODUCT_NAME "OpenFlipper" CACHE String "Product name used in all visible places (e.g. about box)." )
set( BRANDING_HEADER false CACHE String "Indicate there is a branding.h inside the branding folder.")
add_definitions(-DPRODUCT_STRING=${OPENFLIPPER_PRODUCT_STRING})
add_definitions(-DPRODUCT_NAME=${OPENFLIPPER_PRODUCT_NAME})
if (BRANDING_HEADER)
add_definitions(-DBRANDING_HEADER)
endif ()
add_definitions(-DPRODUCT_STRING=${OPENFLIPPER_PRODUCT_STRING})
add_definitions(-DPRODUCT_NAME=${OPENFLIPPER_PRODUCT_NAME})
# ========================================================================
# ========================================================================
include (package)
include (ACGOutput)
......@@ -79,7 +117,6 @@ else()
endif()
acg_openmp ()
#acg_ftgl ()
# check for OpenGL, GLEW and GLUT as our required dependencies
find_package (OpenGL)
......
......@@ -91,12 +91,12 @@ endif()
set(RC_SRC "")
if ( EXISTS ${CMAKE_SOURCE_DIR}/branding/branding.qrc )
if ( EXISTS ${BRANDING_DIRECTORY}/branding.qrc )
if ( QT5_FOUND )
QT5_ADD_RESOURCES(BRANDING_RC_SRC "${CMAKE_SOURCE_DIR}/branding/branding.qrc")
QT5_ADD_RESOURCES(BRANDING_RC_SRC "${BRANDING_DIRECTORY}/branding.qrc")
list(APPEND RC_SRC ${BRANDING_RC_SRC})
else()
QT4_ADD_RESOURCES(BRANDING_RC_SRC "${CMAKE_SOURCE_DIR}/branding/branding.qrc")
QT4_ADD_RESOURCES(BRANDING_RC_SRC "${BRANDING_DIRECTORY}/branding.qrc")
list(APPEND RC_SRC ${BRANDING_RC_SRC})
endif()
endif()
......@@ -230,31 +230,31 @@ target_link_libraries (${OPENFLIPPER_PRODUCT_STRING}
if (APPLE)
if ( EXISTS ${CMAKE_SOURCE_DIR}/branding )
if ( EXISTS ${BRANDING_DIRECTORY} )
# Take bundle icon from branding dir
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" )
set ( APPLE_BUNDLE_ICON "${BRANDING_DIRECTORY}\\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 )
if ( EXISTS ${BRANDING_DIRECTORY}/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 )
set ( APPLE_INFO_PLIST "${BRANDING_DIRECTORY}\\mac\\Info.plist" CACHE FILEPATH "Path to the Info.plist file for Bundle" )
else ( EXISTS ${BRANDING_DIRECTORY}/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( EXISTS ${BRANDING_DIRECTORY}/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" )
if ( EXISTS ${BRANDING_DIRECTORY}/Icons/OpenFlipper_Icon.icns )
set ( APPLE_BUNDLE_ICON " ${BRANDING_DIRECTORY}/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()
......@@ -304,13 +304,13 @@ acg_copy_after_build (${OPENFLIPPER_PRODUCT_STRING} "${CMAKE_CURRENT_SOURCE_DIR}
acg_copy_after_build (${OPENFLIPPER_PRODUCT_STRING} "${CMAKE_CURRENT_SOURCE_DIR}/../Fonts" "${CMAKE_BINARY_DIR}/Build/${ACG_PROJECT_DATADIR}/Fonts")
acg_copy_after_build (${OPENFLIPPER_PRODUCT_STRING} "${CMAKE_CURRENT_SOURCE_DIR}/../Documentation/QtHelpResources" "${CMAKE_BINARY_DIR}/Build/${ACG_PROJECT_DATADIR}/Help")
if ( EXISTS ${CMAKE_SOURCE_DIR}/branding )
if ( EXISTS ${BRANDING_DIRECTORY} )
if ( WIN32 )
acg_copy_after_build (${OPENFLIPPER_PRODUCT_STRING} "${CMAKE_SOURCE_DIR}/branding/win/Icons" "${CMAKE_BINARY_DIR}/Build/${ACG_PROJECT_DATADIR}/Icons")
acg_copy_after_build (${OPENFLIPPER_PRODUCT_STRING} "${BRANDING_DIRECTORY}/win/Icons" "${CMAKE_BINARY_DIR}/Build/${ACG_PROJECT_DATADIR}/Icons")
elseif( APPLE )
acg_copy_after_build (${OPENFLIPPER_PRODUCT_STRING} "${CMAKE_SOURCE_DIR}/branding/mac/Icons" "${CMAKE_BINARY_DIR}/Build/${ACG_PROJECT_DATADIR}/Icons")
acg_copy_after_build (${OPENFLIPPER_PRODUCT_STRING} "${BRANDING_DIRECTORY}/mac/Icons" "${CMAKE_BINARY_DIR}/Build/${ACG_PROJECT_DATADIR}/Icons")
elseif()
acg_copy_after_build (${OPENFLIPPER_PRODUCT_STRING} "${CMAKE_SOURCE_DIR}/branding/linux/Icons" "${CMAKE_BINARY_DIR}/Build/${ACG_PROJECT_DATADIR}/Icons")
acg_copy_after_build (${OPENFLIPPER_PRODUCT_STRING} "${BRANDING_DIRECTORY}/linux/Icons" "${CMAKE_BINARY_DIR}/Build/${ACG_PROJECT_DATADIR}/Icons")
endif()
endif()
......@@ -385,17 +385,17 @@ if (NOT APPLE)
acg_install_dir ("${CMAKE_BINARY_DIR}/Build/QtPlugins/" "${ACG_PROJECT_DATADIR}/QtPlugins")
endif(WIN32)
if ( EXISTS ${CMAKE_SOURCE_DIR}/branding/win )
if ( EXISTS ${BRANDING_DIRECTORY}/win )
if ( WIN32 )
acg_install_dir ( "${CMAKE_SOURCE_DIR}/branding/win" "${ACG_PROJECT_DATADIR}/Icons")
acg_install_dir ( "${BRANDING_DIRECTORY}/win" "${ACG_PROJECT_DATADIR}/Icons")
endif()
endif()
endif ()
if ( EXISTS ${CMAKE_SOURCE_DIR}/branding/Icons )
if ( EXISTS ${BRANDING_DIRECTORY}/Icons )
# Overwrite generic Icons with branded ones.
acg_copy_after_build (${OPENFLIPPER_PRODUCT_STRING} "${CMAKE_SOURCE_DIR}/branding/Icons" "${CMAKE_BINARY_DIR}/Build/${ACG_PROJECT_DATADIR}/Icons")
acg_install_dir ("${CMAKE_SOURCE_DIR}/branding/Icons" "${ACG_PROJECT_DATADIR}/Icons")
acg_copy_after_build (${OPENFLIPPER_PRODUCT_STRING} "${BRANDING_DIRECTORY}/Icons" "${CMAKE_BINARY_DIR}/Build/${ACG_PROJECT_DATADIR}/Icons")
acg_install_dir ("${BRANDING_DIRECTORY}/Icons" "${ACG_PROJECT_DATADIR}/Icons")
endif()
......@@ -79,31 +79,31 @@ endforeach ()
if (WIN32)
if ( EXISTS ${CMAKE_SOURCE_DIR}/branding )
if ( EXISTS ${BRANDING_DIRECTORY} )
IF ( NOT WINDOWS_INSTALLER_ICON )
# option to set the used Icon for OpenFlipper
set ( WINDOWS_INSTALLER_ICON "${CMAKE_SOURCE_DIR}\\branding\\win\\OpenFlipper_Icon_128x128x32.ico" CACHE FILEPATH "Path to the Executables Icon" )
set ( WINDOWS_INSTALLER_ICON "${BRANDING_DIRECTORY}\\win\\OpenFlipper_Icon_128x128x32.ico" CACHE FILEPATH "Path to the Executables Icon" )
ENDIF(NOT WINDOWS_INSTALLER_ICON )
IF ( NOT WINDOWS_INSTALLER_IMAGE_ICON )
# option to set the used Icon for OpenFlipper
set ( WINDOWS_INSTALLER_IMAGE_ICON "${CMAKE_SOURCE_DIR}/branding/win/installer.bmp" CACHE FILEPATH "Path to the Installer Image Icon ( This has to be a bmp )" )
set ( WINDOWS_INSTALLER_IMAGE_ICON "${BRANDING_DIRECTORY}/win/installer.bmp" CACHE FILEPATH "Path to the Installer Image Icon ( This has to be a bmp )" )
ENDIF(NOT WINDOWS_INSTALLER_IMAGE_ICON )
IF ( NOT WINDOWS_LICENSE_FILE )
# option to set the used License file for OpenFlipper
set ( WINDOWS_LICENSE_FILE "${CMAKE_SOURCE_DIR}\\branding\\win\\License.txt" CACHE FILEPATH "Path to the License file for installer" )
set ( WINDOWS_LICENSE_FILE "${BRANDING_DIRECTORY}\\win\\License.txt" CACHE FILEPATH "Path to the License file for installer" )
ENDIF(NOT WINDOWS_LICENSE_FILE )
IF ( NOT WINDOWS_WELCOME_FILE )
# option to set the used License file for OpenFlipper
set ( WINDOWS_WELCOME_FILE "${CMAKE_SOURCE_DIR}\\branding\\win\\Welcome.txt" CACHE FILEPATH "Path to the welcome file for installer" )
set ( WINDOWS_WELCOME_FILE "${BRANDING_DIRECTORY}\\win\\Welcome.txt" CACHE FILEPATH "Path to the welcome file for installer" )
ENDIF(NOT WINDOWS_WELCOME_FILE )
IF ( NOT WINDOWS_DESCRIPTION_FILE )
# option to set the used License file for OpenFlipper
set ( WINDOWS_DESCRIPTION_FILE "${CMAKE_SOURCE_DIR}\\branding\\win\\Description.txt" CACHE FILEPATH "Path to the description file for installer" )
set ( WINDOWS_DESCRIPTION_FILE "${BRANDING_DIRECTORY}\\win\\Description.txt" CACHE FILEPATH "Path to the description file for installer" )
ENDIF(NOT WINDOWS_DESCRIPTION_FILE )
else()
......@@ -217,20 +217,20 @@ if (WIN32)
elseif (APPLE)
if ( EXISTS ${CMAKE_SOURCE_DIR}/branding )
if ( EXISTS ${BRANDING_DIRECTORY} )
IF ( NOT APPLE_INSTALLER_ICON )
# option to set the used Icon for OpenFlipper
set ( APPLE_INSTALLER_ICON "${CMAKE_SOURCE_DIR}\\branding\\mac\\OpenFlipper_Icon_128x128x32.ico" CACHE FILEPATH "Path to the Executables Icon" )
set ( APPLE_INSTALLER_ICON "${BRANDING_DIRECTORY}\\mac\\OpenFlipper_Icon_128x128x32.ico" CACHE FILEPATH "Path to the Executables Icon" )
ENDIF(NOT APPLE_INSTALLER_ICON )
IF ( NOT APPLE_INSTALLER_IMAGE_ICON )
# option to set the used Icon for OpenFlipper
set ( APPLE_INSTALLER_IMAGE_ICON "${CMAKE_SOURCE_DIR}/branding/mac/installer.bmp" CACHE FILEPATH "Path to the Installer Image Icon ( This has to be a bmp )" )
set ( APPLE_INSTALLER_IMAGE_ICON "${BRANDING_DIRECTORY}/mac/installer.bmp" CACHE FILEPATH "Path to the Installer Image Icon ( This has to be a bmp )" )
ENDIF(NOT APPLE_INSTALLER_IMAGE_ICON )
IF ( NOT APPLE_LICENSE_FILE )
# option to set the used License file for OpenFlipper
set ( APPLE_LICENSE_FILE "${CMAKE_SOURCE_DIR}\\branding\\mac\\License.txt" CACHE FILEPATH "Path to the License file for installer" )
set ( APPLE_LICENSE_FILE "${BRANDING_DIRECTORY}mac\\License.txt" CACHE FILEPATH "Path to the License file for installer" )
ENDIF(NOT APPLE_LICENSE_FILE )
else()
......
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