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

Fixed the cmake commit which reverted most of the branding

git-svn-id: http://www.openflipper.org/svnrepo/OpenFlipper/branches/Free@17087 383ad7c9-94d9-4d36-a494-682f7c89f535
parent 0d833cc2
......@@ -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
......@@ -78,8 +78,8 @@ if (QT5_FOUND)
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})
acg_qt4_autouic (uic_targets ${ui})
acg_qt4_automoc (moc_targets ${headers})
endif()
if (WIN32)
......@@ -110,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
......@@ -161,7 +161,6 @@ target_link_libraries (OpenFlipper
${GLUT_LIBRARIES}
${FTGL_LIBS}
${COREAPP_ADDITIONAL_LINK_LIBRARIES}
)
if (APPLE)
......@@ -175,28 +174,34 @@ if (APPLE)
MACOSX_BUNDLE_ICON_FILE "OpenFlipper.icns"
)
if ( EXISTS ${CMAKE_SOURCE_DIR}/branding )
if ( EXISTS ${CMAKE_SOURCE_DIR}/branding )
IF ( NOT APPLE_BUNDLE_ICON )
# 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" )
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 )
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 )
else()
IF ( NOT APPLE_BUNDLE_ICON )
# option to set the used Icon for OpenFlipper
set ( APPLE_BUNDLE_ICON "${CMAKE_CURRENT_SOURCE_DIR}/../Icons/OpenFlipper_Icon.icns" CACHE FILEPATH "Path to the Bundle Icon" )
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()
ENDIF(NOT APPLE_BUNDLE_ICON )
IF ( NOT APPLE_INFO_PLIST )
......@@ -205,22 +210,21 @@ 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"
)
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 (
# 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 ()
......@@ -242,17 +246,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" "${CMAKE_BINARY_DIR}/Build/${ACG_PROJECT_DATADIR}/Icons")
if ( WIN32 )
acg_copy_after_build (OpenFlipper "${CMAKE_SOURCE_DIR}/branding/win/Icons" "${CMAKE_BINARY_DIR}/Build/${ACG_PROJECT_DATADIR}/Icons")
elseif( APPLE )
acg_copy_after_build (OpenFlipper "${CMAKE_SOURCE_DIR}/branding/mac" "${CMAKE_BINARY_DIR}/Build/${ACG_PROJECT_DATADIR}/Icons")
acg_copy_after_build (OpenFlipper "${CMAKE_SOURCE_DIR}/branding/mac/Icons" "${CMAKE_BINARY_DIR}/Build/${ACG_PROJECT_DATADIR}/Icons")
elseif()
acg_copy_after_build (OpenFlipper "${CMAKE_SOURCE_DIR}/branding/linux" "${CMAKE_BINARY_DIR}/Build/${ACG_PROJECT_DATADIR}/Icons")
acg_copy_after_build (OpenFlipper "${CMAKE_SOURCE_DIR}/branding/linux/Icons" "${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 )
......@@ -277,7 +281,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
......@@ -286,7 +290,7 @@ if ( APPLE )
endif()
endif()
endforeach ()
elseif(WIN32)
......@@ -321,15 +325,17 @@ 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 )
if ( WIN32 )
if ( EXISTS ${CMAKE_SOURCE_DIR}/branding/win )
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()
......@@ -2,13 +2,6 @@ include(plugin)
find_package(Qwt5)
if(Qwt5_Qt4_FOUND)
add_definitions(-DWITH_QWT)
openflipper_plugin(INCDIRS ${Qwt5_INCLUDE_DIR} LIBRARIES ${Qwt5_Qt4_LIBRARY})
else()
openflipper_plugin()
endif()
if (EXISTS ${CMAKE_SOURCE_DIR}/ObjectTypes/PolyhedralMesh)
add_definitions (-DENABLE_OPENVOLUMEMESH_SUPPORT)
add_definitions (-DENABLE_OPENVOLUMEMESH_POLYHEDRAL_SUPPORT)
......@@ -18,3 +11,20 @@ if (EXISTS ${CMAKE_SOURCE_DIR}/ObjectTypes/HexahedralMesh)
add_definitions (-DENABLE_OPENVOLUMEMESH_SUPPORT)
add_definitions (-DENABLE_OPENVOLUMEMESH_HEXAHEDRAL_SUPPORT)
endif()
if(Qwt5_Qt4_FOUND)
add_definitions(-DWITH_QWT)
openflipper_plugin(INCDIRS ${Qwt5_INCLUDE_DIR} LIBRARIES ${Qwt5_Qt4_LIBRARY})
else()
openflipper_plugin()
endif()
......@@ -937,8 +937,8 @@ void TextureControlPlugin::doUpdateTextureOVM ( Texture& _texture, VolumeMeshT&
OpenVolumeMesh::VertexPropertyT< double > texture = _mesh.template request_vertex_property<double>(_texture.name().toStdString());
copyTexture(_texture, _mesh, _obj, texture);
VolumeMeshDrawModesContainer drawModes;
_obj.setObjectDrawMode(drawModes.facesTextured);
VolumeMeshDrawModesContainer drawModesVolumeMesh;
_obj.setObjectDrawMode(drawModesVolumeMesh.facesTextured);
}
else if ( _texture.dimension() == 2 )
......@@ -951,8 +951,8 @@ void TextureControlPlugin::doUpdateTextureOVM ( Texture& _texture, VolumeMeshT&
OpenVolumeMesh::VertexPropertyT< ACG::Vec2d > texture = _mesh.template request_vertex_property<ACG::Vec2d>(_texture.name().toStdString());
copyTexture(_texture, _mesh, _obj, texture);
VolumeMeshDrawModesContainer drawModes;
_obj.setObjectDrawMode(drawModes.facesTextured);
VolumeMeshDrawModesContainer drawModesVolumeMesh;
_obj.setObjectDrawMode(drawModesVolumeMesh.facesTextured);
}
else
......@@ -967,7 +967,7 @@ void TextureControlPlugin::doUpdateTextureOVM ( Texture& _texture, VolumeMeshT&
void TextureControlPlugin::slotDrawModeChanged(int _viewerId ) {
#ifdef ENABLE_OPENVLUMEMESH_SUPPORT
VolumeMeshDrawModesContainer drawModes;
VolumeMeshDrawModesContainer drawModesVolumeMesh;
#endif
// Only update if we have a relevant draw mode
......@@ -978,8 +978,8 @@ void TextureControlPlugin::slotDrawModeChanged(int _viewerId ) {
#ifdef ENABLE_OPENVLUMEMESH_SUPPORT
||
( PluginFunctions::drawMode(_viewerId) &= drawModes.facesTextured) ||
( PluginFunctions::drawMode(_viewerId) &= drawModes.facesTexturedShaded)
( PluginFunctions::drawMode(_viewerId) &= drawModesVolumeMesh.facesTextured) ||
( PluginFunctions::drawMode(_viewerId) &= drawModesVolumeMesh.facesTexturedShaded)
#endif
)) {
return;
......
......@@ -43,7 +43,9 @@ endif()
# read version from file
macro (acg_get_version)
if (EXISTS "${CMAKE_CURRENT_SOURCE_DIR}/${ARGN}/VERSION")
if (EXISTS "${CMAKE_CURRENT_SOURCE_DIR}/branding/VERSION")
file (READ "${CMAKE_CURRENT_SOURCE_DIR}/branding/VERSION" _file)
elseif (EXISTS "${CMAKE_CURRENT_SOURCE_DIR}/${ARGN}/VERSION")
file (READ "${CMAKE_CURRENT_SOURCE_DIR}/${ARGN}/VERSION" _file)
else ()
file (READ "${CMAKE_CURRENT_SOURCE_DIR}/VERSION" _file)
......@@ -182,7 +184,7 @@ add_definitions (-DINCLUDE_TEMPLATES)
macro (acg_qt4)
if (NOT QT4_FOUND)
set (QT_MIN_VERSION ${ARGN})
set (QT_MIN_VERSION ${ARGN})
find_package (Qt4 COMPONENTS QtCore QtGui )
......@@ -302,7 +304,7 @@ macro (acg_openmp)
if (NOT OPENMP_NOTFOUND)
# Set off OpenMP on Darwin architectures
# since it causes crashes sometimes
# if(NOT APPLE)
# if(NOT APPLE)
find_package(OpenMP)
if (OPENMP_FOUND)
set (CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} ${OpenMP_CXX_FLAGS}")
......@@ -407,7 +409,7 @@ macro (acg_qt4_automoc moc_SRCS)
add_file_dependencies (${_abs_FILE} ${_moc})
set (${moc_SRCS} ${${moc_SRCS}} ${_moc})
endif ()
endif ()
endforeach ()
......@@ -475,7 +477,7 @@ macro (acg_qt4_autouic uic_SRCS)
set (_outfile ${CMAKE_CURRENT_BINARY_DIR}/ui_${_basename}.hh)
set (_header ${_basename}.hh)
set (_source ${_abs_PATH}/${_cbasename}.cc)
add_custom_command (OUTPUT ${_outfile}
COMMAND ${QT_UIC_EXECUTABLE}
ARGS -o ${_outfile} ${_abs_FILE}
......@@ -483,7 +485,7 @@ macro (acg_qt4_autouic uic_SRCS)
add_file_dependencies (${_source} ${_outfile})
set (${uic_SRCS} ${${uic_SRCS}} ${_outfile})
endif ()
endforeach ()
endmacro ()
......@@ -536,11 +538,11 @@ macro (acg_qt4_autoqrc qrc_SRCS)
get_filename_component (_basename ${_current_FILE} NAME_WE)
set (_outfile ${CMAKE_CURRENT_BINARY_DIR}/qrc_${_basename}.cpp)
add_custom_command (OUTPUT ${_outfile}
COMMAND ${QT_RCC_EXECUTABLE}
ARGS -o ${_outfile} ${_abs_FILE}
DEPENDS ${_abs_FILE})
DEPENDS ${_abs_FILE})
add_file_dependencies (${_source} ${_outfile})
set (${qrc_SRCS} ${${qrc_SRCS}} ${_outfile})
......@@ -648,7 +650,7 @@ function (acg_add_library _target _libtype)
set (_and_static 1)
else ()
set (_and_static 0)
endif ()
endif ()
else ()
set (_type ${_libtype})
set (_and_static 0)
......@@ -664,9 +666,9 @@ function (acg_add_library _target _libtype)
# set common target properties defined in common.cmake
acg_set_target_props (${_target}Static)
if (NOT APPLE)
set_target_properties (${_target}Static PROPERTIES
set_target_properties (${_target}Static PROPERTIES
LIBRARY_OUTPUT_DIRECTORY "${CMAKE_LIBRARY_OUTPUT_DIRECTORY}"
)
endif ()
......@@ -752,10 +754,10 @@ function (acg_add_library _target _libtype)
${CMAKE_BINARY_DIR}/Build/${ACG_PROJECT_LIBDIR}/lib${fullname}.a)
endif ()
# Block installation of libraries by setting ACG_NO_LIBRARY_INSTALL
if ( NOT ACG_NO_LIBRARY_INSTALL )
if ( NOT ACG_NO_LIBRARY_INSTALL )
if (NOT ACG_PROJECT_MACOS_BUNDLE OR NOT APPLE)
if (${_type} STREQUAL SHARED OR ${_type} STREQUAL STATIC )
install (TARGETS ${_target}
......@@ -801,15 +803,15 @@ function (acg_add_translations _target _languages _sources)
if (QT5_FOUND)
#qt5_create_translation(_qm_files ${_sources} ${_new_ts_files})
elseif (QT4_FOUND)
qt4_create_translation(_qm_files ${_sources} ${_new_ts_files})
endif()
qt4_create_translation(_qm_files ${_sources} ${_new_ts_files})
endif ()
endif ()
if ( _ts_files )
if (QT5_FOUND)
#qt5_add_translation(_qm_files2 ${_ts_files})
elseif (QT4_FOUND)
qt4_add_translation(_qm_files2 ${_ts_files})
qt4_add_translation(_qm_files2 ${_ts_files})
endif()
list (APPEND _qm_files ${_qm_files2})
endif ()
......@@ -845,7 +847,7 @@ function (generate_qhp_file files_loc plugin_name)
set(qhp_file "${files_loc}/${plugin_name}.qhp")
# Read in template file
file(STRINGS "${CMAKE_SOURCE_DIR}/OpenFlipper/Documentation/QtHelpResources/QtHelpProject.qhp" qhp_template)
# Initialize new project file
file(WRITE ${qhp_file} "")
foreach (_line ${qhp_template})
......
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