User

Difference between revisions of "Sascha"

From Guiliani

 
(31 intermediate revisions by the same user not shown)
Line 1: Line 1:
<nowiki>
+
<!--
#include "ExampleControl.h"
 
#include "GfxWrap.h"
 
#include "GUIStreamReader.h"
 
#include "GUIStreamWriter.h"
 
#include "GUIStreamingException.h"
 
#include "GUIControlResource.h"
 
#include "GUIMemLeakWatcher.h" // <-- has to be the last include
 
  
#define EXAMPLE_CONTROL_CLASS_VERSION 1
+
https://developers.google.com/speed/webp/docs/riff_container
// The minimal class version allowed.
+
https://chromium.googlesource.com/webm/libvpx
#define EXAMPLE_CONTROL_CLASS_MIN_VERSION 1
 
  
ExampleControl::ExampleControl(
+
vera++ -> checkstlye output -> warnings next generation (input as logfile)
    CGUICompositeObject *const pParent,
 
    const eC_Value &vX, const eC_Value &vY,
 
    const eC_Value &vWidth, const eC_Value &vHeight,
 
    eC_UInt uiInnerColor, eC_UInt uiBorderColor,
 
    eC_Value vBorderWidth,
 
    const ObjectHandle_t &eID)
 
    : CGUICompositeObject(pParent, vX, vY, vWidth, vHeight, eID),
 
      m_uiInnerColor(uiInnerColor),
 
      m_uiBorderColor(uiBorderColor),
 
      m_vBorderWidth(vBorderWidth)
 
{
 
    SetXMLTag("ExampleControl");
 
}
 
  
ExampleControl::ExampleControl()
+
google code stylguide
: m_uiInnerColor(0), m_uiBorderColor(0), m_vBorderWidth(eC_FromInt(0))
+
https://google.github.io/styleguide/cppguide.html
{
 
    SetXMLTag("ExampleControl");
 
}
 
  
void ExampleControl::SetCenterColor(eC_UInt uiInnerColor)
+
google styleguide cpplint
{
+
https://github.com/google/styleguide
    if (uiInnerColor != m_uiInnerColor)
 
    {
 
        m_uiInnerColor = uiInnerColor;
 
        InvalidateArea();
 
    }
 
}
 
  
void ExampleControl::SetBorderColor(eC_UInt uiBorderColor)
+
find bugs plugin -> warnings next generation
{
 
    if (uiBorderColor != m_uiBorderColor)
 
    {
 
        m_uiBorderColor = uiBorderColor;
 
        InvalidateArea();
 
    }
 
}
 
  
void ExampleControl::SetBorderWidth(eC_Value vBorderWidth)
+
tags (e.g. TODO, FIXME, ...) can be found and listed
{
 
    if (vBorderWidth != m_vBorderWidth)
 
    {
 
        m_vBorderWidth = vBorderWidth;
 
        InvalidateArea();
 
    }
 
}
 
  
void ExampleControl::Flip(const eC_Bool& rbVertical)
+
-->
{
 
    if (rbVertical)
 
    {
 
        // flip vertical means swap left and right side
 
        CGUIObject* pkCurrentObject;
 
        for (int i = 0; i < GetNumberOfChildren(); ++i)
 
        {
 
            pkCurrentObject = GetChild(i);
 
            if (pkCurrentObject->IsCompositeObject())
 
                pkCurrentObject->IsAnimating(); //Flip(rbVertical);
 
            else
 
            {
 
                pkCurrentObject->SetRelXPos(GetWidth() - (pkCurrentObject->GetWidth() + pkCurrentObject->GetRelXPos()));
 
                pkCurrentObject->InvalidateArea();
 
            }
 
        }
 
    }
 
    else
 
    {
 
        // flip horizontal means swap top and bottom side
 
        CGUIObject* pkCurrentObject;
 
        for (int i = 0; i < GetNumberOfChildren(); ++i)
 
        {
 
            pkCurrentObject = GetChild(i);
 
            if (pkCurrentObject->IsCompositeObject())
 
                pkCurrentObject->IsAnimating(); //Flip(rbVertical);
 
            else
 
            {
 
                pkCurrentObject->SetRelYPos(GetHeight() - (pkCurrentObject->GetHeight() + pkCurrentObject->GetRelYPos()));
 
                pkCurrentObject->InvalidateArea();
 
            }
 
        }
 
 
 
    }
 
}
 
 
 
void ExampleControl::Rotate(const eC_Int& riDegrees)
 
{
 
    switch (riDegrees)
 
    {
 
        case 0:
 
        default:
 
            // do nothing
 
            break;
 
 
 
        case 90:
 
        {
 
            // rotate 90 degrees clockwise
 
            // width and height will be swapped
 
            // x and y of every object will be re-calculated and swapped
 
 
 
            CGUIRect r = GetRelRect();
 
            SetWidth(r.GetHeight());
 
            SetHeight(r.GetWidth());
 
            CGUIObject* pkCurrentObject;
 
            for (int i = 0; i < GetNumberOfChildren(); ++i)
 
            {
 
                pkCurrentObject = GetChild(i);
 
                r = pkCurrentObject->GetRelRect();
 
                pkCurrentObject->SetRelXPos(GetWidth() - (r.GetWidth() + r.GetY1()));
 
                pkCurrentObject->SetRelYPos(r.GetX1());
 
                pkCurrentObject->SetWidth(r.GetHeight());
 
                pkCurrentObject->SetHeight(r.GetWidth());
 
            }
 
            InvalidateArea();
 
            InvalidateChildren();
 
        }
 
            break;
 
 
 
        case 180:
 
            Flip(false);
 
            Flip(true);
 
            break;
 
 
 
        case 270:
 
        {
 
            // rotate 270 degrees clockwise
 
            // width and height will be swapped
 
            // x and y of every object will be swapped
 
 
 
            CGUIRect r = GetRelRect();
 
            SetWidth(r.GetHeight());
 
            SetHeight(r.GetWidth());
 
            CGUIObject* pkCurrentObject;
 
            for (int i = 0; i < GetNumberOfChildren(); ++i)
 
            {
 
                pkCurrentObject = GetChild(i);
 
                r = pkCurrentObject->GetRelRect();
 
                pkCurrentObject->SetRelXPos(r.GetY1());
 
                pkCurrentObject->SetRelYPos(r.GetX1());
 
                pkCurrentObject->SetWidth(r.GetHeight());
 
                pkCurrentObject->SetHeight(r.GetWidth());
 
            }
 
            InvalidateArea();
 
            InvalidateChildren();
 
        }
 
            break;
 
    }
 
}
 
 
 
eC_Bool ExampleControl::DoDraw()
 
{
 
    CGUIRect kAbsRect(GetAbsRect());
 
    if (m_vBorderWidth != eC_FromInt(0))
 
    {
 
        GETGFX.SetForegroundColor(m_uiBorderColor);
 
        GETGFX.FilledRect(kAbsRect);
 
        kAbsRect.Expand(-m_vBorderWidth);
 
    }
 
    GETGFX.SetForegroundColor(m_uiInnerColor);
 
    GETGFX.FilledRect(kAbsRect);
 
    return true;
 
}
 
 
 
#if defined(GUILIANI_STREAM_GUI)
 
void ExampleControl::ReadFromStream()
 
{
 
    ReadStreamingHeader(EXAMPLE_CONTROL_CLASS_VERSION, EXAMPLE_CONTROL_CLASS_MIN_VERSION);
 
 
 
    CGUICompositeObject::ReadFromStream();
 
 
 
    m_uiInnerColor  = GETINPUTSTREAM.READ_HEX("InnerColor");
 
    m_uiBorderColor = GETINPUTSTREAM.READ_HEX("BorderColor");
 
    m_vBorderWidth  = eC_FromFloat(GETINPUTSTREAM.READ_FLOAT("BorderWidth"));
 
}
 
#endif
 
 
 
#if defined(GUILIANI_WRITE_GUI)
 
void ExampleControl::WriteToStream(const eC_Bool bWriteClassID)
 
{
 
    WriteStreamingHeader(bWriteClassID, XMLTAG_CONTROLCLASSID, CTL_EXAMPLE, EXAMPLE_CONTROL_CLASS_VERSION);
 
 
 
    CGUICompositeObject::WriteToStream();
 
 
 
    GETOUTPUTSTREAM.WriteHex(m_uiInnerColor, "InnerColor");
 
    GETOUTPUTSTREAM.WriteHex(m_uiBorderColor, "BorderColor");
 
    GETOUTPUTSTREAM.WriteFloat(eC_ToFloat(m_vBorderWidth), "BorderWidth");
 
 
 
    WriteStreamingFooter(bWriteClassID);
 
}
 
#endif
 
 
 
----------------
 
 
 
    CGfxWrapeGML* pkWrap = dynamic_cast<CGfxWrapeGML*>(&GETGFX);
 
    if (NULL != pkWrap)
 
    {
 
        eGML_Screen* pkScreen = pkWrap->GetScreen();
 
        unsigned short* memory = (unsigned short*)pkScreen->Lock();
 
 
 
        eC_UInt uiWidth = pkScreen->GetWidth();
 
        eC_UInt uiHeight = pkScreen->GetHeight();
 
 
 
        memset(memory, 0xf1, uiWidth * uiHeight);
 
        for (eC_UInt y = 0; y < uiHeight; ++y)
 
        {
 
            for (eC_UInt x = 0; x < uiWidth; ++x)
 
            {
 
                unsigned short val = memory[y * uiWidth + x];
 
                memory[y * uiWidth + x] = (val + (x * y)) & 0xffff;
 
            }
 
        }
 
 
 
        pkScreen->Unlock();
 
 
 
//        pkScreen->DrawLine(eGML_Vector2(0, 0), eGML_Vector2(10, 10), 0xff004400, 0, 1, 1);
 
    }
 
 
 
----------------
 
 
 
- auto-stretch for text
 
- invalidate layout after resizing
 
 
 
------------------
 
 
 
 
 
#
 
# This is the CMakeLists.txt file for the GSE
 
#
 
 
 
 
 
# ========== Minimum cmake version required ==========
 
CMAKE_MINIMUM_REQUIRED(VERSION 3.0)
 
 
 
SET(CMAKE_CXX_STANDARD 11)
 
 
 
SET(PATH_COMMON "${CMAKE_CURRENT_SOURCE_DIR}/../CMake" CACHE PATH "CMake common files directory path")
 
 
 
# ========== Setup configurations ==========
 
INCLUDE("${PATH_COMMON}/Common_settings.cmake")
 
 
 
# Configuration for SDK Installer
 
IF(EXISTS "${CMAKE_CURRENT_SOURCE_DIR}/CPackConfiguration.cmake")
 
  # Only add SDK settings if cmake installer files exists
 
  SET(SDK_PACKAGE_GENERATOR CACHE BOOL "Generate Guiliani SDK Install Packages")
 
ELSE(EXISTS "${CMAKE_CURRENT_SOURCE_DIR}/CPackConfiguration.cmake")
 
  MESSAGE(STATUS "GSE SDK Project.")
 
  SET(GSE_SDK_PROJECT 1) # Variable for activating SKD build
 
ENDIF(EXISTS "${CMAKE_CURRENT_SOURCE_DIR}/CPackConfiguration.cmake")
 
 
 
#Activate OGL per default
 
SET(FORCE_ADD_OGL_PLATFORM 1)
 
 
 
#Activate RTTI
 
SET(FORCE_USE_RTTI 1)
 
 
 
# ========== Set project name and version number ==========
 
PROJECT(GSE
 
        VERSION "2.2.0")
 
 
 
 
 
# ========== Include correct platform file ==========
 
INCLUDE("${PATH_COMMON}/Platform.cmake")
 
 
 
# ========== Output some information ==========
 
INCLUDE("${PATH_COMMON}/Build_information.cmake")
 
 
 
# StreamRuntime root path to find the custom extension
 
SET(GSE_ROOT_PATH_STREAMRUNTIME "${PROJECT_SOURCE_DIR}/../StreamRuntime" CACHE PATH "StreamRuntime root path")
 
SET(GSE_STREAMRUNTIME_APPNAME "StreamRuntime" CACHE STRING "StreamRuntime appliation name")
 
SET(GSE_ROOT_PATH_RESOURCECOMPILER "${PROJECT_SOURCE_DIR}/GUIResourceCompiler" CACHE PATH "ResourceCompiler root path")
 
 
 
# if SDK_PACKAGE_GENERATOR is set PATH_GSE needs to be empty
 
IF(SDK_PACKAGE_GENERATOR)
 
  SET(PATH_GSE "" CACHE PATH
 
    "This path has to point to the GSE root directory. This path is set empty, so the variable GSE_PATH is used."
 
    FORCE
 
  )
 
  SET(SDK_PACKAGE_GENERATOR_ADDITIONAL_PACKAGE "" CACHE PATH "Path to additonal CPackPackages.cmake")
 
ENDIF(SDK_PACKAGE_GENERATOR)
 
 
 
# if we have an SDK path needs to point to GSE-folder
 
IF(GSE_SDK_PROJECT)
 
  SET(PATH_GSE "${PROJECT_SOURCE_DIR}" CACHE PATH "This path has to point to the GSE root directory.")
 
ENDIF(GSE_SDK_PROJECT)
 
 
 
LIST(APPEND PREPROCESSOR_DEFINES "PATH_GSE=\"${PATH_GSE}\"")
 
 
 
# ========== Set application specific includes ==========
 
INCLUDE_DIRECTORIES(
 
  "${PROJECT_SOURCE_DIR}/Include"
 
  "${PROJECT_SOURCE_DIR}/Include/Behaviour"
 
  "${PROJECT_SOURCE_DIR}/Include/Command"
 
  "${PROJECT_SOURCE_DIR}/Include/Control"
 
  "${PROJECT_SOURCE_DIR}/Include/Dialog"
 
  "${PROJECT_SOURCE_DIR}/Include/GUIConfig"
 
  "${PROJECT_SOURCE_DIR}/Include/Undo"
 
  "${GSE_ROOT_PATH_STREAMRUNTIME}/Include/CustomExtension"
 
  "${GSE_ROOT_PATH_STREAMRUNTIME}/Include/GUIConfigCustom"
 
)
 
 
 
IF(NOT GSE_SDK_PROJECT) #Default case to build GSE
 
  # ========== Set include directories ==========
 
  INCLUDE("${PATH_COMMON}/Include_directories.cmake")
 
 
 
  INCLUDE_DIRECTORIES(
 
    "${GSE_ROOT_PATH_RESOURCECOMPILER}/Include"
 
)
 
 
 
  # ========== GSElib Source files ==========
 
  # SOURCE_GROUP creates the "folder-structure" in VS
 
  FILE(GLOB GSELIB_SOURCE_CPP "${PROJECT_SOURCE_DIR}/Source/*.cpp")
 
  LIST(APPEND GSELIB_SOURCE_CPP "${PROJECT_SOURCE_DIR}/Source/md5.cpp")
 
  FILE(GLOB GSELIB_BHVR_SOURCE_CPP "${PROJECT_SOURCE_DIR}/Source/Behaviour/*.cpp")
 
  FILE(GLOB GSELIB_CMD_SOURCE_CPP "${PROJECT_SOURCE_DIR}/Source/Command/*.cpp")
 
  FILE(GLOB GSELIB_CTRL_SOURCE_CPP "${PROJECT_SOURCE_DIR}/Source/Control/*.cpp")
 
  FILE(GLOB GSELIB_DIALOG_SOURCE_CPP "${PROJECT_SOURCE_DIR}/Source/Dialog/*.cpp")
 
  FILE(GLOB GSELIB_UNDO_SOURCE_CPP "${PROJECT_SOURCE_DIR}/Source/Undo/*.cpp")
 
  FILE(GLOB GSELIB_CUSTOM_TEMPLATES "${PROJECT_SOURCE_DIR}/Resources/CustomTemplates/*.tpl")
 
  SOURCE_GROUP("Source Files" FILES ${GSELIB_SOURCE_CPP})
 
  SOURCE_GROUP("Source Files\\Behaviour" FILES ${GSELIB_BHVR_SOURCE_CPP})
 
  SOURCE_GROUP("Source Files\\Command" FILES ${GSELIB_CMD_SOURCE_CPP})
 
  SOURCE_GROUP("Source Files\\Control" FILES ${GSELIB_CTRL_SOURCE_CPP})
 
  SOURCE_GROUP("Source Files\\Dialog" FILES ${GSELIB_DIALOG_SOURCE_CPP})
 
  SOURCE_GROUP("Source Files\\Undo" FILES ${GSELIB_UNDO_SOURCE_CPP})
 
  SOURCE_GROUP("Custom Templates" FILES ${GSELIB_CUSTOM_TEMPLATES})
 
 
 
  FILE(GLOB GSELIB_SOURCE_H "${PROJECT_SOURCE_DIR}/Include/*.h")
 
  FILE(GLOB GSELIB_BHVR_SOURCE_H "${PROJECT_SOURCE_DIR}/Include/Behaviour/*.h")
 
  FILE(GLOB GSELIB_CMD_SOURCE_H "${PROJECT_SOURCE_DIR}/Include/Command/*.h")
 
  FILE(GLOB GSELIB_CTRL_SOURCE_H "${PROJECT_SOURCE_DIR}/Include/Control/*.h")
 
  FILE(GLOB GSELIB_DIALOG_SOURCE_H "${PROJECT_SOURCE_DIR}/Include/Dialog/*.h")
 
  FILE(GLOB GSELIB_UNDO_SOURCE_H "${PROJECT_SOURCE_DIR}/Include/Undo/*.h")
 
  FILE(GLOB GSELIB_GUICONFIG_SOURCE_H "${PROJECT_SOURCE_DIR}/Include/GUIConfig/*.h")
 
  SOURCE_GROUP("Header Files" FILES ${GSELIB_SOURCE_H})
 
  SOURCE_GROUP("Header Files\\Behaviour" FILES ${GSELIB_BHVR_SOURCE_H})
 
  SOURCE_GROUP("Header Files\\Command" FILES ${GSELIB_CMD_SOURCE_H})
 
  SOURCE_GROUP("Header Files\\Control" FILES ${GSELIB_CTRL_SOURCE_H})
 
  SOURCE_GROUP("Header Files\\Dialog" FILES ${GSELIB_DIALOG_SOURCE_H})
 
  SOURCE_GROUP("Header Files\\Undo" FILES ${GSELIB_UNDO_SOURCE_H})
 
  SOURCE_GROUP("Header Files\\GUIConfig" FILES ${GSELIB_GUICONFIG_SOURCE_H})
 
 
 
  FILE(GLOB GSELIB_LANGUAGE_FILES "${PROJECT_SOURCE_DIR}/Resources/LanguageFiles/*.lng")
 
  SOURCE_GROUP("Language Files" FILES ${GSELIB_LANGUAGE_FILES})
 
 
 
  # ========== Create complete list of files for GSElib ==========
 
  SET(GSELIB_SOURCES_LIST
 
    ${GSELIB_SOURCE_CPP}
 
    ${GSELIB_BHVR_SOURCE_CPP}
 
    ${GSELIB_CMD_SOURCE_CPP}
 
    ${GSELIB_CTRL_SOURCE_CPP}
 
    ${GSELIB_DIALOG_SOURCE_CPP}
 
    ${GSELIB_UNDO_SOURCE_CPP}
 
    ${GSELIB_CUSTOM_TEMPLATES}
 
    ${GSELIB_SOURCE_H}
 
    ${GSELIB_BHVR_SOURCE_H}
 
    ${GSELIB_CMD_SOURCE_H}
 
    ${GSELIB_CTRL_SOURCE_H}
 
    ${GSELIB_DIALOG_SOURCE_H}
 
    ${GSELIB_UNDO_SOURCE_H}
 
    ${GSELIB_GUICONFIG_SOURCE_H}
 
    ${GSELIB_LANGUAGE_FILES}
 
    ${PLATFORM_FILES_GSELIB}
 
)
 
  SET(GSE_GUICONFIG_CPP "${PATH_GUILIANI}/Share/GUIConfig.cpp") # GUIConfig.cpp from Guiliani path
 
 
 
ELSE(NOT GSE_SDK_PROJECT) #SDK uses the directories inside the GSE structure
 
  INCLUDE_DIRECTORIES(
 
    "${PROJECT_SOURCE_DIR}/../eGaC/Include/eC"
 
    "${PROJECT_SOURCE_DIR}/../eGaC/Include/eDBG"
 
    "${PROJECT_SOURCE_DIR}/../eGaC/Include/eGML"
 
    "${PROJECT_SOURCE_DIR}/../Guiliani/Include/Core"
 
    "${PROJECT_SOURCE_DIR}/../Guiliani/Include/GUIConfig"
 
    "${PROJECT_SOURCE_DIR}/../Guiliani/Include/ImageDecoder"
 
    "${PROJECT_SOURCE_DIR}/../Guiliani/Include/Platform/eGML"
 
    "${PROJECT_SOURCE_DIR}/../Guiliani/Include/Platform/general"
 
    "${PROJECT_SOURCE_DIR}/../Guiliani/Include/Platform/GL"
 
)
 
  INCLUDE("${PATH_COMMON}/Include_directories.cmake")
 
  SET(GSE_GUICONFIG_CPP "${PROJECT_SOURCE_DIR}/../Guiliani/Share/GUIConfig.cpp") # GUIConfig.cpp from inside GSE
 
ENDIF(NOT GSE_SDK_PROJECT)
 
 
 
# ========== GSE Source files ==========
 
# SOURCE_GROUP creates the "folder-structure" in VS
 
SOURCE_GROUP("GUIConfig" FILES ${GSE_GUICONFIG_CPP})
 
 
 
FILE(GLOB GSE_CUSTOM_SOURCE_CPP "${GSE_ROOT_PATH_STREAMRUNTIME}/Source/CustomExtension/*.cpp")
 
SOURCE_GROUP("Source Files\\Custom Extension" FILES ${GSE_CUSTOM_SOURCE_CPP})
 
 
 
FILE(GLOB GSE_CUSTOM_SOURCE_H "${GSE_ROOT_PATH_STREAMRUNTIME}/Include/CustomExtension/*.h")
 
FILE(GLOB GSE_CUSTOM_GUICONFIG_SOURCE_H "${GSE_ROOT_PATH_STREAMRUNTIME}/Include/GUIConfigCustom/*.h")
 
SOURCE_GROUP("Header Files\\Custom Extension" FILES ${GSE_CUSTOM_SOURCE_H})
 
SOURCE_GROUP("Header Files\\Custom Resource IDs" FILES ${GSE_CUSTOM_GUICONFIG_SOURCE_H})
 
 
 
FILE(GLOB GSE_PLATFORM_GENERAL_CPP "${PROJECT_SOURCE_DIR}/Source/Platform/general/*.cpp")
 
SOURCE_GROUP("Source Files\\Platform\\General" FILES ${GSE_PLATFORM_GENERAL_CPP})
 
 
 
# ========== Create complete list of files for GSE binary ==========
 
SET(GSE_SOURCES_LIST
 
  ${GSE_GUICONFIG_CPP}
 
  ${GSE_CUSTOM_SOURCE_CPP}
 
  ${GSE_CUSTOM_SOURCE_H}
 
  ${GSE_CUSTOM_GUICONFIG_SOURCE_H}
 
  ${GSE_PLATFORM_GENERAL_CPP}
 
  ${RESOURCE_FILE}
 
)
 
 
 
SET(GSE_PROJECT 1) #this variable is used in StreamRuntime and ResourceCompiler to avoid adding Guiliani and eGaC project twice.
 
 
 
ADD_EXECUTABLE(${PROJECT_NAME} ${ADD_EXECUTABLE_PARAMETERS} ${GSE_SOURCES_LIST})
 
 
 
# ========== Add StreamRuntime ==========
 
ADD_SUBDIRECTORY("${GSE_ROOT_PATH_STREAMRUNTIME}" StreamRuntime)
 
 
 
IF(NOT GSE_SDK_PROJECT) #if no SDK we add to solution: GSElib, Guiliani, GUIResourceCompiler and link against these projects.
 
  # ========== Add eGaC ==========
 
  IF(EXISTS "${PATH_EGAC}/CMakeLists.txt")
 
      ADD_SUBDIRECTORY("${PATH_EGAC}" ./eGaC)
 
  ELSE(EXISTS "${PATH_EGAC}/CMakeLists.txt")
 
      MESSAGE(FATAL_ERROR "Path not set or wrong to eGaC directory.")
 
  ENDIF(EXISTS "${PATH_EGAC}/CMakeLists.txt")
 
 
 
  # ========== Add Guiliani ==========
 
  IF(EXISTS "${PATH_GUILIANI}/CMakeLists.txt")
 
      ADD_SUBDIRECTORY("${PATH_GUILIANI}" ./Guiliani)
 
  ELSE(EXISTS "${PATH_GUILIANI}/CMakeLists.txt")
 
      MESSAGE(FATAL_ERROR "Path not set or wrong to Guiliani directory.")
 
  ENDIF(EXISTS "${PATH_GUILIANI}/CMakeLists.txt")
 
 
 
  # ========== Add GUIResourceCompiler ==========
 
  IF(EXISTS "${GSE_ROOT_PATH_RESOURCECOMPILER}/CMakeLists.txt")
 
      ADD_SUBDIRECTORY("${GSE_ROOT_PATH_RESOURCECOMPILER}" ./GUIResourceCompiler)
 
  ELSE(EXISTS "${GSE_ROOT_PATH_RESOURCECOMPILER}/CMakeLists.txt")
 
      MESSAGE(FATAL_ERROR "Path not set or wrong to GUIResourceCompiler directory.")
 
  ENDIF(EXISTS "${GSE_ROOT_PATH_RESOURCECOMPILER}/CMakeLists.txt")
 
 
 
  # ========== Build GSE library ==========
 
  ADD_LIBRARY(GSElib STATIC ${GSELIB_SOURCES_LIST})
 
ENDIF(NOT GSE_SDK_PROJECT)
 
 
 
# ========== Link the executable to the needed libraries ==========
 
TARGET_LINK_LIBRARIES(${PROJECT_NAME}
 
  GSElib
 
  GUIResourceCompilerLib
 
  Guiliani
 
  eGaC
 
  ${PLATFORM_LIBS}
 
)
 
 
 
# ========== StreamRuntime must be build prior to GSE ==========
 
ADD_DEPENDENCIES(${PROJECT_NAME} ${GSE_STREAMRUNTIME_APPNAME})
 
 
 
# ========== Set output directories ==========
 
SET(RESOURCE_DIR "${PROJECT_SOURCE_DIR}/Resources")
 
 
 
IF(MSVC_IDE)
 
  SET(BINARY_DIR "${PROJECT_SOURCE_DIR}")
 
  SET_TARGET_PROPERTIES(${PROJECT_NAME} PROPERTIES RUNTIME_OUTPUT_DIRECTORY_DEBUG ${BINARY_DIR})
 
  SET_TARGET_PROPERTIES(${PROJECT_NAME} PROPERTIES RUNTIME_OUTPUT_DIRECTORY_RELEASE ${BINARY_DIR})
 
  SET_TARGET_PROPERTIES(${PROJECT_NAME} PROPERTIES RUNTIME_OUTPUT_DIRECTORY_DEBUGEVALUATION ${BINARY_DIR})
 
  SET_TARGET_PROPERTIES(${PROJECT_NAME} PROPERTIES RUNTIME_OUTPUT_DIRECTORY_RELEASEEVALUATION ${BINARY_DIR})
 
  SET_TARGET_PROPERTIES(${PROJECT_NAME} PROPERTIES RUNTIME_OUTPUT_NAME "GSE")
 
  SET_TARGET_PROPERTIES(${PROJECT_NAME} PROPERTIES VS_DEBUGGER_WORKING_DIRECTORY ${PROJECT_SOURCE_DIR})
 
 
 
  SET_TARGET_PROPERTIES(${GSE_STREAMRUNTIME_APPNAME} PROPERTIES RUNTIME_OUTPUT_DIRECTORY_DEBUG ${RESOURCE_DIR})
 
  SET_TARGET_PROPERTIES(${GSE_STREAMRUNTIME_APPNAME} PROPERTIES RUNTIME_OUTPUT_DIRECTORY_RELEASE ${RESOURCE_DIR}) 
 
  SET_TARGET_PROPERTIES(${GSE_STREAMRUNTIME_APPNAME} PROPERTIES RUNTIME_OUTPUT_DIRECTORY_DEBUGEVALUATION ${RESOURCE_DIR})
 
  SET_TARGET_PROPERTIES(${GSE_STREAMRUNTIME_APPNAME} PROPERTIES RUNTIME_OUTPUT_DIRECTORY_RELEASEEVALUATION ${RESOURCE_DIR})
 
ENDIF(MSVC_IDE)
 
 
 
SET_TARGET_PROPERTIES(${GSE_STREAMRUNTIME_APPNAME} PROPERTIES RUNTIME_OUTPUT_DIRECTORY ${RESOURCE_DIR})
 
SET_TARGET_PROPERTIES(${GSE_STREAMRUNTIME_APPNAME} PROPERTIES RUNTIME_OUTPUT_NAME "${GSE_STREAMRUNTIME_APPNAME}")
 
 
 
# ========== Set preprocessor defines ==========
 
SET(PREPROCESSOR_DEFINES "${PREPROCESSOR_DEFINES};GSE_STREAMRUNTIME_BINARY_NAME=\"${GSE_STREAMRUNTIME_APPNAME}\";GSE_STREAMRUNTIME_ROOT_DIR=\"${GSE_ROOT_PATH_STREAMRUNTIME}\"")
 
 
 
SET_TARGET_PROPERTIES(${PROJECT_NAME} PROPERTIES COMPILE_DEFINITIONS "${PREPROCESSOR_DEFINES}")
 
 
 
IF(NOT GSE_SDK_PROJECT) # Target GSElib doesn't exists in SDK build
 
  SET_TARGET_PROPERTIES(GSElib PROPERTIES COMPILE_DEFINITIONS "${PREPROCESSOR_DEFINES};GSE_GSELIB")
 
  SET_TARGET_PROPERTIES(GSElib PROPERTIES COMPILE_DEFINITIONS_DEBUGEVALUATION "GSE_EVALUATION")
 
  SET_TARGET_PROPERTIES(GSElib PROPERTIES COMPILE_DEFINITIONS_RELEASEEVALUATION "GSE_EVALUATION")
 
  SET_TARGET_PROPERTIES(Guiliani PROPERTIES COMPILE_DEFINITIONS_DEBUGEVALUATION "GUILIANI_EVALUATION")
 
  SET_TARGET_PROPERTIES(Guiliani PROPERTIES COMPILE_DEFINITIONS_RELEASEEVALUATION "GUILIANI_EVALUATION")
 
  IF(WIN32)
 
    SET_TARGET_PROPERTIES(eGaC PROPERTIES COMPILE_DEFINITIONS_DEBUGEVALUATION "eGML_EVALLIB")
 
    SET_TARGET_PROPERTIES(eGaC PROPERTIES COMPILE_DEFINITIONS_RELEASEEVALUATION "eGML_EVALLIB")
 
  ELSE(WIN32)
 
    SET_TARGET_PROPERTIES(eGaC PROPERTIES COMPILE_DEFINITIONS_DEBUGEVALUATION "eGML_EVALLIB2")
 
    SET_TARGET_PROPERTIES(eGaC PROPERTIES COMPILE_DEFINITIONS_RELEASEEVALUATION "eGML_EVALLIB2")
 
  ENDIF(WIN32)
 
ENDIF(NOT GSE_SDK_PROJECT)
 
 
 
IF(SDK_PACKAGE_GENERATOR)
 
  IF(EXISTS "${CMAKE_CURRENT_SOURCE_DIR}/../CPackPackages.cmake")
 
    INCLUDE(${CMAKE_CURRENT_SOURCE_DIR}/../CPackPackages.cmake)
 
  ENDIF(EXISTS "${CMAKE_CURRENT_SOURCE_DIR}/../CPackPackages.cmake")
 
 
 
  # add common to package
 
  IF(EXISTS "${PATH_COMMON}/CPackPackages.cmake")
 
    INCLUDE (${PATH_COMMON}/CPackPackages.cmake)
 
  ENDIF(EXISTS "${PATH_COMMON}/CPackPackages.cmake")
 
 
 
  # add GUIResourceCompiler to package
 
  IF(EXISTS "${GSE_ROOT_PATH_RESOURCECOMPILER}/CPackPackages.cmake")
 
    INCLUDE (${GSE_ROOT_PATH_RESOURCECOMPILER}/CPackPackages.cmake)
 
  ENDIF(EXISTS "${GSE_ROOT_PATH_RESOURCECOMPILER}/CPackPackages.cmake")
 
 
 
  # add Libs to package
 
  IF(EXISTS "${PATH_LIBS}/CPackPackages.cmake")
 
    INCLUDE (${PATH_LIBS}/CPackPackages.cmake)
 
  ENDIF(EXISTS "${PATH_LIBS}/CPackPackages.cmake")
 
 
 
  # add own package-file
 
  INCLUDE(CPackPackages.cmake)
 
  INCLUDE(CPackConfiguration.cmake)
 
  IF(EXISTS "CPackAdditionalPackages.cmake")
 
    INCLUDE(CPackAdditionalPackages.cmake)
 
  ENDIF(EXISTS "CPackAdditionalPackages.cmake")
 
ENDIF(SDK_PACKAGE_GENERATOR)
 
 
 
</nowiki>
 

Latest revision as of 05:51, 15 April 2021