diff --git a/LSFramework/CJsonArray.h b/LSFramework/CJsonArray.h new file mode 100644 index 0000000..e69de29 diff --git a/LSFramework/CJsonDocument.h b/LSFramework/CJsonDocument.h new file mode 100644 index 0000000..f1152b6 --- /dev/null +++ b/LSFramework/CJsonDocument.h @@ -0,0 +1,8 @@ +private: + CcJsonNode m_oJsonData; + bool m_bParseError = false; + CcString m_sParseErrorMsg; + bool m_bIntend = false; + uint16 m_uiIntendLevel = 0; + + static const CcString c_sIndent; \ No newline at end of file diff --git a/LSFramework/CJsonNode.h b/LSFramework/CJsonNode.h new file mode 100644 index 0000000..adb1bf4 --- /dev/null +++ b/LSFramework/CJsonNode.h @@ -0,0 +1,12 @@ +private: + union CcDocumentsSHARED UJsonDataType + { + void* m_pVoid; + CcVariant* m_ovValue; + CcJsonObject* m_poJsonObject; + CcJsonArray* m_poJsonArray; + }; + UJsonDataType m_uData; + EJsonDataType m_eType = EJsonDataType::Unknown; //!< Enum of current stored Object type. + CcString m_sName; //!< Name of this Object +}; \ No newline at end of file diff --git a/LSFramework/CJsonObject.h b/LSFramework/CJsonObject.h new file mode 100644 index 0000000..e69de29 diff --git a/LSFramework/CMake/CMake.1.6.0/AutoBuild/BuildAllLinux.sh b/LSFramework/CMake/CMake.1.6.0/AutoBuild/BuildAllLinux.sh new file mode 100644 index 0000000..b61c46e --- /dev/null +++ b/LSFramework/CMake/CMake.1.6.0/AutoBuild/BuildAllLinux.sh @@ -0,0 +1,35 @@ +#//======================================================================== +#// Copyright (c) Technische Software Entwicklung Plazotta © 2021 +#// +#// DESCRIPTION: +#// Shell Script to Build a cmake project under linux, running the Unittest and finally start teh install step +#// +#// HISTORY: +#// 09.04.2021 / PP +#// Module created. +#//======================================================================== +#!/bin/bash +# +ProjectName=@TSEP_AUTOBUILD_PROJECT@ +UnitTestExe=@TSEP_AUTOBUILD_USED_UNITTEST@ + +#======================================================================= +# Start build +#======================================================================= +#echo " Auto Build Project : " $ProjectName +#echo " Auto Build Unit Test : " $UnitTestExe +#echo "." +#- Release -------------------------------------------------------------- +./scripts/BuildLinuxProject.sh $ProjectName Release $UnitTestExe +if [ $? -ne 0 ]; then + echo "Error during Release build ..." + exit 1 +fi +#- Debug ---------------------------------------------------------------- +./scripts//BuildLinuxProject.sh $ProjectName Debug $UnitTestExe +if [ $? -ne 0 ]; then + echo "Error during Debug build ..." + exit 1 +fi +# +exit 0 \ No newline at end of file diff --git a/LSFramework/CMake/CMake.1.6.0/AutoBuild/BuildAllVS2017.cmd b/LSFramework/CMake/CMake.1.6.0/AutoBuild/BuildAllVS2017.cmd new file mode 100644 index 0000000..76d8aa7 --- /dev/null +++ b/LSFramework/CMake/CMake.1.6.0/AutoBuild/BuildAllVS2017.cmd @@ -0,0 +1,43 @@ +@ECHO OFF +REM //======================================================================== +REM // Copyright (c) Technische Software Entwicklung Plazotta © 2021 +REM // +REM // DESCRIPTION: +REM // Batch Building for Windows / Project Framework.Core +REM // +REM // HISTORY: +REM // 09.04.2021 / PP +REM // Module created. +REM //======================================================================== +setlocal +pushd . +REM ======================================================================= +REM Setup Parameter +REM ======================================================================= +set ProjectName=@TSEP_AUTOBUILD_PROJECT@ +set UnitTestExecutables=@TSEP_AUTOBUILD_USED_UNITTEST@ +REM +REM ======================================================================= +REM Rebuild the project +REM ======================================================================= +cd scripts +call BuildVS2017Project.cmd %ProjectName% Release "%UnitTestExecutables%" +IF %ERRORLEVEL% NEQ 0 goto ERROR +call BuildVS2017Project.cmd %ProjectName% Debug "%UnitTestExecutables%" +IF %ERRORLEVEL% NEQ 0 goto ERROR +goto END +REM +REM ======================================================================= +REM Error +REM ======================================================================= +:ERROR +echo Error during automated build ...... +PAUSE +exit /b 1 +REM +REM ======================================================================= +REM END +REM ======================================================================= +:END +echo Automated build successful done ..... +exit /b 0 diff --git a/LSFramework/CMake/CMake.1.6.0/AutoBuild/BuildAllVS2017INtime.cmd b/LSFramework/CMake/CMake.1.6.0/AutoBuild/BuildAllVS2017INtime.cmd new file mode 100644 index 0000000..ee31b9a --- /dev/null +++ b/LSFramework/CMake/CMake.1.6.0/AutoBuild/BuildAllVS2017INtime.cmd @@ -0,0 +1,43 @@ +@ECHO OFF +REM //======================================================================== +REM // Copyright (c) Technische Software Entwicklung Plazotta © 2021 +REM // +REM // DESCRIPTION: +REM // Batch Building for INtime / Project Framework.Core +REM // +REM // HISTORY: +REM // 27.07.2021 / DM +REM // Module created. +REM //======================================================================== +setlocal +pushd . +REM ======================================================================= +REM Setup Parameter +REM ======================================================================= +set ProjectName=@TSEP_AUTOBUILD_PROJECT@ +set UnitTestExecutables=@TSEP_AUTOBUILD_USED_UNITTEST@ +REM +REM ======================================================================= +REM Rebuild the project +REM ======================================================================= +cd scripts +call BuildVS2017INtimeProject.cmd %ProjectName% Release "%UnitTestExecutables%" +IF %ERRORLEVEL% NEQ 0 goto ERROR +call BuildVS2017INtimeProject.cmd %ProjectName% Debug "%UnitTestExecutables%" +IF %ERRORLEVEL% NEQ 0 goto ERROR +goto END +REM +REM ======================================================================= +REM Error +REM ======================================================================= +:ERROR +echo Error during automated build ...... +PAUSE +exit /b 1 +REM +REM ======================================================================= +REM END +REM ======================================================================= +:END +echo Automated build successful done ..... +exit /b 0 diff --git a/LSFramework/CMake/CMake.1.6.0/AutoBuild/BuildLinuxProject.sh b/LSFramework/CMake/CMake.1.6.0/AutoBuild/BuildLinuxProject.sh new file mode 100644 index 0000000..23c8820 --- /dev/null +++ b/LSFramework/CMake/CMake.1.6.0/AutoBuild/BuildLinuxProject.sh @@ -0,0 +1,75 @@ +#//======================================================================== +#// Copyright (c) Technische Software Entwicklung Plazotta © 2021 +#// +#// DESCRIPTION: +#// Shell Script to Build a cmake project under linux, running the Unittest and finally start teh install step +#// +#// HISTORY: +#// 09.04.2021 / PP +#// Module created. +#//======================================================================== +#!/bin/bash +# +#======================================================================= +# Check Parameter +#======================================================================= +if [ -z "$1" ] +then + echo "usage: BuildLinuxProject [ProjectName] [Configuration] [UnitTestExe]" + exit 2 +fi +if [ -z "$2" ] +then + echo "usage: BuildLinuxProject [ProjectName] [Configuration] [UnitTestExe]" + exit 2 +fi +if [ -z "$3" ] +then + echo "usage: BuildLinuxProject [ProjectName] [Configuration] [UnitTestExe]" + exit 2 +fi +#======================================================================= +# Show Parameter +#======================================================================= +echo "=======================================================================" +echo " Build Parameter" +echo "=======================================================================" +echo " Project = $1" +echo " Configuration = $2" +echo " Unit Test Executable = $3" +echo "=======================================================================" +echo "." +#======================================================================= +# parse unit test s +#======================================================================= +IFS=',' +read -rasplitIFS<<< "$3" +#======================================================================= +# Start build +#======================================================================= +cd ../../BuildResults_linux_$2 +#- MAKE ALL ------------------------------------------------------------ +make all +if [ $? -ne 0 ]; then + echo "Build error ..." + exit 1 +fi +#- UNIT Test ----------------------------------------------------------- +cd bin +for unittests in "${splitIFS[@]}"; do + + echo tsep | sudo -S ./../../AutoBuild/linux/scripts/RunUnitTest.sh $unittests + if [ $? -ne 0 ]; then + echo "Error during Unit test ..." + exit 1 + fi +done +cd .. +#- Install ------------------------------------------------------------- +make install +if [ $? -ne 0 ]; then + echo "Error during INSTALL ..." + exit 1 +fi +# +exit 0 \ No newline at end of file diff --git a/LSFramework/CMake/CMake.1.6.0/AutoBuild/BuildVS2017INtimeProject.cmd b/LSFramework/CMake/CMake.1.6.0/AutoBuild/BuildVS2017INtimeProject.cmd new file mode 100644 index 0000000..f9aa4e2 --- /dev/null +++ b/LSFramework/CMake/CMake.1.6.0/AutoBuild/BuildVS2017INtimeProject.cmd @@ -0,0 +1,126 @@ +@ECHO OFF +REM //======================================================================== +REM // Copyright (c) Technische Software Entwicklung Plazotta © 2021 +REM // +REM // DESCRIPTION: +REM // Batch Building a VS2017 INtime Project, running the Unittest and finally start the install step +REM // +REM // HISTORY: +REM // 27.07.2021 / DM +REM // Module created. +REM // Refactored for INtime with PP's Windows Template. +REM //======================================================================== +setlocal +setlocal enabledelayedexpansion +pushd . +REM ======================================================================= +REM Check Parameter +REM ======================================================================= +set TestFiles=%3 +set TestFiles=%TestFiles:"=% +@if "%1"=="" goto HELP +@if "%2"=="" goto HELP +@if "%TestFiles%"=="" goto NO_PARSE +set TestFiles=%TestFiles:,= % +:NO_PARSE +REM ======================================================================= +REM Show Parameter +REM ======================================================================= +echo ======================================================================= +echo Build Parameter +echo ======================================================================= +echo Project = %1 +echo Configuration = %2 +echo Unit Test Executable = %TestFiles% +echo ======================================================================= +echo . +REM ======================================================================= +REM Setup the VS2017 environment +REM ======================================================================= +call "%ProgramFiles(x86)%\Microsoft Visual Studio\2017\Enterprise\Common7\Tools\vsdevcmd" +REM +REM ======================================================================= +REM Rebuild the project +REM ======================================================================= +cd ..\..\..\BuildResults\msvc2017_INtime +devenv %1.sln /rebuild %2 +IF %ERRORLEVEL% NEQ 0 goto ERROR +REM +REM ======================================================================= +REM Before running the unit tests delete the LdrtaResult file +REM to be sure the loop can work properly +REM ======================================================================= +del /f ..\..\AutoBuild\INtime\scripts\LdrtaResult.txt +REM +REM ======================================================================= +REM Run all unit tests +REM ======================================================================= +for %%f in (%TestFiles%) do ( + start ldrta.exe %2\bin\%%f.rta + if !ERRORLEVEL! NEQ 0 goto ERROR +) +REM +REM ======================================================================= +REM Loop for recognizing the creation of the LdrtaResult file. +REM After check unit tests were successfully, otherwise error +REM ======================================================================= +cd ..\..\AutoBuild\INtime\scripts +set /a CounterEnd=120 +set /a Counter=0 +set /a OkResult=0 +set LdrtaFile=LdrtaResult.txt +:LOOP +echo Checking if the unit tests have created the result file +if exist "%LdrtaFile%" ( + echo File was created + set /p Result=<"%LdrtaFile%" + goto FILECREATED +) else ( + echo File was not created + goto FILENOTCREATED +) +:FILECREATED +if %Result% EQU %OkResult% ( + echo Continueing AllBuild process + goto CONTINUE +) else ( + echo Unit tests failed ... + goto ERROR +) +:FILENOTCREATED +if %Counter% EQU %CounterEnd% ( + goto ERROR +) else ( + set /a Counter=%Counter%+1 + timeout /t 2 /nobreak + echo Timeout corresponds to 2 seconds + set /a CounterX2=%Counter%*2 + echo Current total timeout counter: %CounterX2% + goto LOOP +) + +REM +REM ======================================================================= +REM Install files +REM ======================================================================= +:CONTINUE +cd ..\..\..\BuildResults\msvc2017_INtime +devenv %1.sln /build %2 /Project INSTALL +IF %ERRORLEVEL% NEQ 0 goto ERROR +goto END +REM +REM ======================================================================= +REM Error +REM ======================================================================= +:ERROR +echo Error during build ... +exit /b 1 +REM +REM ======================================================================= +REM HELP +REM ======================================================================= +:HELP +echo Usage BuildVs2017INtimeProject [ProjectName] [Configuration] [UnitTestExe] +echo . +:END +exit /b 0 diff --git a/LSFramework/CMake/CMake.1.6.0/AutoBuild/BuildVS2017Project.cmd b/LSFramework/CMake/CMake.1.6.0/AutoBuild/BuildVS2017Project.cmd new file mode 100644 index 0000000..37aa88f --- /dev/null +++ b/LSFramework/CMake/CMake.1.6.0/AutoBuild/BuildVS2017Project.cmd @@ -0,0 +1,77 @@ +@ECHO OFF +REM //======================================================================== +REM // Copyright (c) Technische Software Entwicklung Plazotta © 2021 +REM // +REM // DESCRIPTION: +REM // Batch Building a VS2017 Project, running the Unittest and finally start the install step +REM // +REM // HISTORY: +REM // 09.04.2021 / PP +REM // Module created. +REM //======================================================================== +setlocal +setlocal enabledelayedexpansion +pushd . +REM ======================================================================= +REM Check Parameter +REM ======================================================================= +set TestFiles=%3 +set TestFiles=%TestFiles:"=% +@if "%1"=="" goto HELP +@if "%2"=="" goto HELP +@if "%TestFiles%"=="" goto NO_PARSE +set TestFiles=%TestFiles:,= % +:NO_PARSE +REM ======================================================================= +REM Show Parameter +REM ======================================================================= +echo ======================================================================= +echo Build Parameter +echo ======================================================================= +echo Project = %1 +echo Configuration = %2 +echo Unit Test Executable = %TestFiles% +echo ======================================================================= +echo . +REM ======================================================================= +REM Setup the VS2017 environment +REM ======================================================================= +call "%ProgramFiles(x86)%\Microsoft Visual Studio\2017\Enterprise\Common7\Tools\vsdevcmd" +REM +REM ======================================================================= +REM Rebuild the project +REM ======================================================================= +cd ..\..\..\BuildResults\msvc2017_x64 +devenv %1.sln /rebuild %2 +IF %ERRORLEVEL% NEQ 0 goto ERROR +REM +REM ======================================================================= +REM Run all unit tests +REM ======================================================================= +for %%f in (%TestFiles%) do ( + start /WAIT %2\bin\%%f.exe + IF !ERRORLEVEL! NEQ 0 goto ERROR +) +REM +REM ======================================================================= +REM Install files +REM ======================================================================= +devenv %1.sln /build %2 /Project INSTALL +IF %ERRORLEVEL% NEQ 0 goto ERROR +goto END +REM +REM ======================================================================= +REM Error +REM ======================================================================= +:ERROR +echo Error during build ... +exit /b 1 +REM +REM ======================================================================= +REM HELP +REM ======================================================================= +:HELP +echo Usage BuildVs2017Project [ProjectName] [Configuration] [UnitTestExe] +echo . +:END +exit /b 0 diff --git a/LSFramework/CMake/CMake.1.6.0/AutoBuild/RunUnitTest.sh b/LSFramework/CMake/CMake.1.6.0/AutoBuild/RunUnitTest.sh new file mode 100644 index 0000000..35d7b4a --- /dev/null +++ b/LSFramework/CMake/CMake.1.6.0/AutoBuild/RunUnitTest.sh @@ -0,0 +1,35 @@ +#//======================================================================== +#// Copyright (c) Technische Software Entwicklung Plazotta © 2021 +#// +#// DESCRIPTION: +#// Shell Script to Build a cmake project under linux, running the Unittest and finally start teh install step +#// +#// HISTORY: +#// 09.04.2021 / PP +#// Module created. +#//======================================================================== +#!/bin/bash +# +#======================================================================= +# Check Parameter +#======================================================================= +if [ -z "$1" ] +then + echo "usage: RunUnitTest [UnitTestExe]" + exit 2 +fi +#======================================================================= +# Run Unit Test +#======================================================================= + +#- Get the RUNPATH and setup the LD_LIBRARY_PATH------------------------ + +USED_LD_PATH=$(readelf -d $1 | grep RUNPATH | awk 'NR > 1 {print $1}' RS='[' FS=']') +export LD_LIBRARY_PATH=$USED_LD_PATH + +./$1 +if [ $? -ne 0 ]; then + exit 1 +fi +# +exit 0 \ No newline at end of file diff --git a/LSFramework/CMake/CMake.1.6.0/CMake.1.6.0.nupkg b/LSFramework/CMake/CMake.1.6.0/CMake.1.6.0.nupkg new file mode 100644 index 0000000..753573b Binary files /dev/null and b/LSFramework/CMake/CMake.1.6.0/CMake.1.6.0.nupkg differ diff --git a/LSFramework/CMake/CMake.1.6.0/CMakeCore.cmake b/LSFramework/CMake/CMake.1.6.0/CMakeCore.cmake new file mode 100644 index 0000000..6eb419f --- /dev/null +++ b/LSFramework/CMake/CMake.1.6.0/CMakeCore.cmake @@ -0,0 +1,65 @@ +########################################################################################### +# +# (c) Technical Software Engineering Plazotta 2019 +# +# CMAKE project settings file +# +# History +# 29.09.2019 / Plazotta +# Template created. +# +#----------------------------------------------------------------------------------------- +# Macro for version parsing +# +MACRO( VERSION_STR_TO_INTS major minor patch version ) + STRING( REGEX REPLACE "([0-9]+).[0-9]+.[0-9]+" "\\1" ${major} ${version} ) + STRING( REGEX REPLACE "[0-9]+.([0-9]+).[0-9]+" "\\1" ${minor} ${version} ) + STRING( REGEX REPLACE "[0-9]+.[0-9]+.([0-9]+)" "\\1" ${patch} ${version} ) +ENDMACRO( VERSION_STR_TO_INTS ) +# +#----------------------------------------------------------------------------------------- +# Define the global CMAKE settings +# +set(CMAKE_CONFIGURATION_TYPES Debug Release) +set(CMAKE_CXX_STANDARD 17) +set(CMAKE_CXX_STANDARD_REQUIRED ON) +# +#----------------------------------------------------------------------------------------- +# Define LINUX +# +if(UNIX AND NOT APPLE) + set(LINUX TRUE) +else() + set(LINUX FALSE) +endif() +# +#----------------------------------------------------------------------------------------- +# Define TSEP CMAKE GENERATOR +# +message(" Generate Generator ....") +# +IF(WIN32) + set(TSEP_CMAKE_GENERATOR ${CMAKE_GENERATOR}) + set(TSEP_BUILD_CONFIGURATION $(Configuration)) +ENDIF() +# +IF(LINUX) + VERSION_STR_TO_INTS(GCC_MAJOR GCC_MINOR GCC_PATH ${CMAKE_CXX_COMPILER_VERSION}) + set(TSEP_CMAKE_GENERATOR "Linux-gcc-") + string(APPEND TSEP_CMAKE_GENERATOR ${GCC_MAJOR}) + if(CMAKE_BINARY_DIR MATCHES "(Debug*)") + set(TSEP_BUILD_CONFIGURATION "Debug") + else() + set(TSEP_BUILD_CONFIGURATION "Release") + endif() + message(" Generate Generator -> Linux ...." ${TSEP_CMAKE_GENERATOR}) +ENDIF() +# +#----------------------------------------------------------------------------------------- +# handle the product/developer build variables +# +if(NOT DEFINED TSEP_PRODUCT_BUILD) + set (TSEP_PRODUCT_BUILD 0) +endif() +#----------------------------------------------------------------------------------------- +# diff --git a/LSFramework/CMake/CMake.1.6.0/CMakeMacros.cmake b/LSFramework/CMake/CMake.1.6.0/CMakeMacros.cmake new file mode 100644 index 0000000..0b737de --- /dev/null +++ b/LSFramework/CMake/CMake.1.6.0/CMakeMacros.cmake @@ -0,0 +1,807 @@ +include (CMakeParseArguments) + +#///////////////////////////////////////////////////////////////////////////////////////////////// +#################################### +#set_output_dir +# Description: +# Change the output directory of the project to given folder +# for all configurations +# +# Syntax: +# set_output_dir(foldername) +#################################### +macro (set_output_dir DIR) + foreach (CONFIG ${CMAKE_CONFIGURATION_TYPES}) + # make configuration variable upper case for CMAKE macros + string(TOUPPER ${CONFIG} CONFIGUPPERCASE) + + # set directories + set( CMAKE_RUNTIME_OUTPUT_DIRECTORY_${CONFIGUPPERCASE} ${DIR}) + set( CMAKE_LIBRARY_OUTPUT_DIRECTORY_${CONFIGUPPERCASE} ${DIR}) + set( CMAKE_ARCHIVE_OUTPUT_DIRECTORY_${CONFIGUPPERCASE} ${DIR}) + set( CMAKE_PDB_OUTPUT_DIRECTORY_${CONFIGUPPERCASE} ${DIR}) + endforeach (CONFIG ${CMAKE_CONFIGURATION_TYPES}) +endmacro (set_output_dir) + +#///////////////////////////////////////////////////////////////////////////////////////////////// +function(TSEP_TRANSLATE) + + # define file lists for all languages + foreach(arg IN LISTS ARGN) + set(TRANSLATION_FILES_ORIG + ${TRANSLATION_FILES_ORIG} + resources/${PROJECT_NAME}_${arg}_generated.ts + ) + set(TRANSLATION_FILES + ${TRANSLATION_FILES} + resources/${PROJECT_NAME}_${arg}.ts + ) + set(TRANSLATION_RESOURCE_LIST + ${TRANSLATION_RESOURCE_LIST} + "${PROJECT_NAME}_${arg}.qm" + ) + if(NOT EXISTS ${CMAKE_CURRENT_LIST_DIR}/resources/${PROJECT_NAME}_${arg}.ts) + configure_file(${TSEP_PROJECT_CMAKE}/Templates/Translation.Template.ts ${CMAKE_CURRENT_LIST_DIR}/resources/${PROJECT_NAME}_${arg}.ts COPYONLY) + endif() + endforeach() + + # replace all ";" from the resource list + string(REPLACE ";" "\n " TRANSLATION_RESOURCE_STRING "${TRANSLATION_RESOURCE_LIST}") + + if (WIN32) + # copy project specific *translations.qrc to the resources folder + configure_file(${TSEP_PROJECT_CMAKE}/Templates/Translations.Template.qrc ${CMAKE_CURRENT_LIST_DIR}/resources/${PROJECT_NAME}_translations.qrc @ONLY) + endif() + + # call qt translation functions + qt5_create_translation(ORIG_TRANSLATIONS ${CMAKE_CURRENT_LIST_DIR} ${TRANSLATION_FILES_ORIG}) + qt5_add_translation(QM_FILES ${TRANSLATION_FILES}) + configure_file(resources/${PROJECT_NAME}_translations.qrc ${CMAKE_BINARY_DIR}/${PROJECT_NAME} COPYONLY) + + # define TSEP_TRANSLATION_FILES in parent scope so it can be added to the project by add_executable or add_library + set(TSEP_TRANSLATION_FILES_LOCAL ${TRANSLATION_FILES} ${TRANSLATION_FILES_ORIG} ${CMAKE_BINARY_DIR}/${PROJECT_NAME}/${PROJECT_NAME}_translations.qrc) + set(TSEP_TRANSLATION_FILES ${TSEP_TRANSLATION_FILES_LOCAL} PARENT_SCOPE) + + # Group the files in the solution + source_group("Translation Files" FILES ${TSEP_TRANSLATION_FILES_LOCAL}) + +endfunction() + +#///////////////////////////////////////////////////////////////////////////////////////////////// +function(TSEP_SETUP_DLL_VERSION ComponentDescription) + + #------------------------------------------------------------------------------ + # Windows Version Description with Resource Files + if(WIN32) + add_definitions(-DVER_COMPANYNAME_STR="${TSEP_COMPANY_LONGNAME}") + add_definitions(-DVER_FILEVERSION_STR="${TSEP_PRODUCT_VERSION}") + add_definitions(-DVER_FILEVERSION=${TSEP_PRODUCT_VERSION}) + add_definitions(-DVER_FILEDESCRIPTION_STR="${ComponentDescription}") + add_definitions(-DVER_LEGALCOPYRIGHT_STR="${TSEP_COPYRIGHT_STRING}") + add_definitions(-DVER_PRODUCTNAME_STR="${TSEP_PROJECT}") + + set(AUTOMATED_VERSION_FILES + ${TSEP_DLL_VERSION_RC} + ) + source_group("Automated Version Files" FILES ${AUTOMATED_VERSION_FILES}) + else() + # define entry point for shared library to print the version information + set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -Wl,-e,tsep_version_entry_point" PARENT_SCOPE) + set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -Wl,-e,tsep_version_entry_point" PARENT_SCOPE) + set(CMAKE_CXX_FLAGS_DEBUG "${CMAKE_CXX_FLAGS_DEBUG} -Wl,-e,tsep_version_entry_point" PARENT_SCOPE) + set(CMAKE_C_FLAGS_DEBUG "${CMAKE_C_FLAGS_DEBUG} -Wl,-e,tsep_version_entry_point" PARENT_SCOPE) + endif() + + add_definitions(-DTSEP_VERSION="${TSEP_VERSION}") + add_definitions(-DTSEP_VERSION_MAJOR=${TSEP_VERSION_MAJOR}) + add_definitions(-DTSEP_VERSION_MINOR=${TSEP_VERSION_MINOR}) + add_definitions(-DTSEP_VERSION_PATCH=${TSEP_VERSION_PATCH}) + add_definitions(-DTSEP_PRODUCT_NAME="${TSEP_PRODUCT_NAME}") + add_definitions(-DTSEP_COPYRIGHT="${TSEP_COPYRIGHT_STRING}") + add_definitions(-DTSEP_COMPANY_NAME="${TSEP_COMPANY_LONGNAME}") + +endfunction() + +#///////////////////////////////////////////////////////////////////////////////////////////////// +function(TSEP_SETUP_APP_VERSION ComponentDescription) + + #------------------------------------------------------------------------------ + # Windows Version Description with Resource Files + if(WIN32) + add_definitions(-DVER_COMPANYNAME_STR="${TSEP_COMPANY_LONGNAME}") + add_definitions(-DVER_FILEVERSION_STR="${TSEP_PRODUCT_VERSION}") + add_definitions(-DVER_FILEVERSION=${TSEP_PRODUCT_VERSION}) + add_definitions(-DVER_FILEDESCRIPTION_STR="${ComponentDescription}") + add_definitions(-DVER_LEGALCOPYRIGHT_STR="${TSEP_COPYRIGHT_STRING}") + add_definitions(-DVER_PRODUCTNAME_STR="${TSEP_PROJECT}") + + set(AUTOMATED_VERSION_FILES + ${TSEP_APP_VERSION_RC} + ) + + source_group("Automated Version Files" FILES ${AUTOMATED_VERSION_FILES}) + endif() + + add_definitions(-DTSEP_VERSION="${TSEP_VERSION}") + add_definitions(-DTSEP_VERSION_MAJOR=${TSEP_VERSION_MAJOR}) + add_definitions(-DTSEP_VERSION_MINOR=${TSEP_VERSION_MINOR}) + add_definitions(-DTSEP_VERSION_PATCH=${TSEP_VERSION_PATCH}) + +endfunction() + +#///////////////////////////////////////////////////////////////////////////////////////////////// +function(TSEP_ADD_EXPORT_FILE ) + + message(" Generating import cmake file for project / " ${PROJECT_NAME}) + + set(TEMP_PRODUCT_NAME "Tsep.") + string(APPEND TEMP_PRODUCT_NAME ${TSEP_PRODUCT_NAME}) + set(TEMP_PROJECT_COLON_NAME "") + string(REPLACE "." "::" TEMP_PROJECT_COLON_NAME ${TEMP_PRODUCT_NAME}) + set(TEMP_PROJECT_SIMPLE_NAME "") + string(REPLACE "." "" TEMP_PROJECT_SIMPLE_NAME ${TEMP_PRODUCT_NAME}) + set(TEMP_PROJECT_DOT_NAME ${TEMP_PRODUCT_NAME}) + string(TOUPPER ${TSEP_PRODUCT_NAME} TEMP_CMAKE_PROJECT_NAME) + + #message("Colon " ${TEMP_PROJECT_COLON_NAME}) + #message("Dot " ${TEMP_PROJECT_DOT_NAME}) + #message("Simple " ${TEMP_PROJECT_SIMPLE_NAME}) + + # Copy the nuspec template file and configure it for the product + configure_file( ${TSEP_PROJECT_CMAKE}/Templates/CMakeLists.Import.Template ${TSEP_EXPORT_DIR}/${TEMP_PROJECT_SIMPLE_NAME}Config.cmake @ONLY ) + +endfunction() + +#///////////////////////////////////////////////////////////////////////////////////////////////// +macro(TSEP_ADD_EXPORT_HEADER HeaderList) + +message(" Generating custom action to export header files for project / " ${PROJECT_NAME}) + +set_target_properties(${PROJECT_NAME} PROPERTIES PUBLIC_HEADER "${HeaderList}") + +endmacro() + +#///////////////////////////////////////////////////////////////////////////////////////////////// +macro(TSEP_ADD_PROJECT_NEXUS_UPLOAD) + +# Lower case for configuration flag +string( TOLOWER ${TSEP_UPDATE_IN_NEXUS} TSEP_UPDATE_IN_NEXUS_LOWER ) + +# Add a new target if Nexus upload is requested +if( TSEP_UPDATE_IN_NEXUS_LOWER STREQUAL "true" ) + + message(" Generating Nexus upload project for product / " ${TSEP_PRODUCT_NAME}) + + # Copy the nuspec template file and configure it for the product + configure_file( ${TSEP_PROJECT_CMAKE}/Templates/CMake.nuspec.Template ${TSEP_EXPORT_DIR}/${TSEP_PRODUCT_NAME}.nuspec ) + + # Copy the template nexus upload cmake file + file(MAKE_DIRECTORY NEXUS_UPLOAD) + file(COPY ${TSEP_PROJECT_CMAKE}/Templates/CMakeLists.Nexus.Template.cmake DESTINATION ${CMAKE_CURRENT_SOURCE_DIR}/NEXUS_UPLOAD ) + file(RENAME ${CMAKE_CURRENT_SOURCE_DIR}/NEXUS_UPLOAD/CMakeLists.Nexus.Template.cmake ${CMAKE_CURRENT_SOURCE_DIR}/NEXUS_UPLOAD/CMakeLists.txt ) + + # Create a new project for the nexus upload + add_subdirectory ( "NEXUS_UPLOAD" "${CMAKE_CURRENT_BINARY_DIR}/NEXUS_UPLOAD" ) + +endif() + +endmacro() + +#///////////////////////////////////////////////////////////////////////////////////////////////// +macro(TSEP_THIRDPARTY_NEXUS_UPLOAD) + +# Lower case for configuration flag +string( TOLOWER ${TSEP_UPDATE_IN_NEXUS} TSEP_UPDATE_IN_NEXUS_LOWER ) + +# Add a new target if Nexus upload is requested +if( TSEP_UPDATE_IN_NEXUS_LOWER STREQUAL "true" ) + + message(" Executing Nexus upload for third party product / " ${TSEP_PRODUCT_NAME}) + + # Create package + execute_process( WORKING_DIRECTORY ${TSEP_EXPORT_DIR} + COMMAND ${TSEP_NUGET_APPLICATION} pack ${TSEP_EXPORT_DIR}/${TSEP_PRODUCT_NAME}.nuspec -outputdirectory ${TSEP_EXPORT_DIR} -BasePath ${TSEP_EXPORT_DIR} -verbosity detailed + ) + + execute_process( WORKING_DIRECTORY ${TSEP_EXPORT_DIR} + COMMAND ${TSEP_NUGET_APPLICATION} push *.nupkg ${TSEP_NEXUS_GUID} -source ${TSEP_NEXUS_URL}/Development/ -verbosity detailed + ) + +endif() + +endmacro() + +#///////////////////////////////////////////////////////////////////////////////////////////////// +macro(TSEP_ADD_PROJECT_CODE_ANALYZER) + +# Visual Studio +if(WIN32) + + message(" Generating Visual Studio Code Analyzer project for product / " ${TSEP_PRODUCT_NAME}) + + # Copy the template Nexus upload CMake file + file(MAKE_DIRECTORY VS_CODE_ANALYZER) + file(COPY ${TSEP_PROJECT_CMAKE}/Templates/CMakeLists.VS_CodeAnalyzer.Template.cmake DESTINATION ${CMAKE_CURRENT_SOURCE_DIR}/VS_CODE_ANALYZER ) + file(RENAME ${CMAKE_CURRENT_SOURCE_DIR}/VS_CODE_ANALYZER/CMakeLists.VS_CodeAnalyzer.Template.cmake ${CMAKE_CURRENT_SOURCE_DIR}/VS_CODE_ANALYZER/CMakeLists.txt ) + + # Create a new project for the Visual Studio CodeAnalyzer + add_subdirectory ( "VS_CODE_ANALYZER" "${CMAKE_CURRENT_BINARY_DIR}/VS_CODE_ANALYZER" ) + +endif() + +endmacro() + +#///////////////////////////////////////////////////////////////////////////////////////////////// +MACRO(TSEP_GET_HEADER_DIRECTORIES return_list target_dir) + + FILE(GLOB_RECURSE new_list ${target_dir}/*.h) + SET(dir_list "") + FOREACH(file_path ${new_list}) + GET_FILENAME_COMPONENT(dir_path ${file_path} PATH) + SET(dir_list ${dir_list} ${dir_path}) + ENDFOREACH() + LIST(REMOVE_DUPLICATES dir_list) + SET(${return_list} ${dir_list}) + +ENDMACRO() + +#///////////////////////////////////////////////////////////////////////////////////////////////// +macro(TSEP_ADD_OS_SPECIFIC_SETTINGS) + +IF (WIN32) + target_link_libraries(${PROJECT_NAME} PUBLIC Iphlpapi.lib) + target_link_libraries(${PROJECT_NAME} PUBLIC Shlwapi.lib) + target_link_libraries(${PROJECT_NAME} PUBLIC Ws2_32.lib) +ENDIF() + +IF (LINUX) + target_link_libraries(${PROJECT_NAME} PUBLIC dl) + target_link_libraries(${PROJECT_NAME} PUBLIC pthread) + target_link_libraries(${PROJECT_NAME} PUBLIC rt) + target_link_libraries(${PROJECT_NAME} PUBLIC stdc++fs) +ENDIF() + + set_target_properties(${PROJECT_NAME} PROPERTIES DEBUG_POSTFIX d) +endmacro() + +#///////////////////////////////////////////////////////////////////////////////////////////////// +macro(TSEP_CREATE_LINK_FOR_DIRECTORY directory_for_search) + +if(WIN32) + #- Get all files from the given directory + file(GLOB FILES_TO_LINK ${directory_for_search}/bin/*.dll ${directory_for_search}/bin/*.exe) + + #- Loop over all files + foreach(file_and_path_to_link ${FILES_TO_LINK}) + + #- Get the file name from the complete path + get_filename_component(file_to_link ${file_and_path_to_link} NAME) + + #- convert the path into an operating system depending format + file(TO_NATIVE_PATH ${file_and_path_to_link} native_file_and_path_to_link) + + #- create the link + if(EXISTS "${PROJECT_BINARY_DIR}/Debug/bin/${file_to_link}") + file(REMOVE "${PROJECT_BINARY_DIR}/Debug/bin/${file_to_link}") + endif() + execute_process( WORKING_DIRECTORY ${PROJECT_BINARY_DIR}/Debug/bin + COMMAND cmd.exe /c mklink "${file_to_link}" "${native_file_and_path_to_link}" + OUTPUT_QUIET) + + #- create the link + if(EXISTS "${PROJECT_BINARY_DIR}/Release/bin/${file_to_link}") + file(REMOVE "${PROJECT_BINARY_DIR}/Release/bin/${file_to_link}") + endif() + execute_process( WORKING_DIRECTORY ${PROJECT_BINARY_DIR}/Release/bin + COMMAND cmd.exe /c mklink "${file_to_link}" "${native_file_and_path_to_link}" + OUTPUT_QUIET) + + endforeach() + +endif() + +endmacro() + +#////////////////////////////////////////////////////////////////////// +macro(TSEP_USE_GOOGLE_TESTING) + + message(" Enabling the Google Test Framework ") + + enable_testing() + +if(WIN32) + set(GTEST_ROOT ${TSEP_PROJECT_GOOGLE.TEST}/${TSEP_CMAKE_GENERATOR}) # <- Working hand-in-hand with the google export! +endif() + + find_package(GTest REQUIRED) + +if(WIN32) + TSEP_CREATE_LINK_FOR_DIRECTORY(${TSEP_PROJECT_GOOGLE.TEST}/${TSEP_CMAKE_GENERATOR}) +endif() + +endmacro() + +#///////////////////////////////////////////////////////////////////////////////////////////////// +macro(TSEP_CREATE_EXPORT) + + #- Only for developer build + if(NOT TSEP_PRODUCT_BUILD) + + message(" Generating custom action to export files for project / " ${PROJECT_NAME}) + + install(TARGETS ${PROJECT_NAME} + EXPORT ${MAIN_PROJECT_NAME}Config + RUNTIME DESTINATION bin/${TSEP_CMAKE_GENERATOR} + LIBRARY DESTINATION bin/${TSEP_CMAKE_GENERATOR} + ARCHIVE DESTINATION bin/${TSEP_CMAKE_GENERATOR} + PUBLIC_HEADER DESTINATION inc + ) + + if (WIN32 AND NOT ${ARGC}) + install (FILES $ DESTINATION bin/${TSEP_CMAKE_GENERATOR} OPTIONAL) + endif() + + install(EXPORT ${MAIN_PROJECT_NAME}Config + DESTINATION bin/${TSEP_CMAKE_GENERATOR}/cmake + NAMESPACE Tsep:: + ) + endif() +endmacro() + +#///////////////////////////////////////////////////////////////////////////////////////////////// +macro(TSEP_PROVIDE_UNITTEST_FILES TestFileList) + +message(" Generating custom action to provide the test file in the tmp directory / " ${PROJECT_NAME}) + +if (WIN32) + file(TO_NATIVE_PATH $ENV{TMP}/${PROJECT_NAME} DEST_DIR) +else() + file(TO_NATIVE_PATH /tmp/${PROJECT_NAME} DEST_DIR) +endif() + +#- Add pre-link step to the copy the source files +add_custom_command(TARGET ${PROJECT_NAME} + DEPENDS ${TestFileList} + COMMENT "Provide Unit Test Files..." + POST_BUILD + VERBATIM + WORKING_DIRECTORY + COMMAND_EXPAND_LISTS + COMMAND ${CMAKE_COMMAND} -E remove_directory ${DEST_DIR} + COMMAND ${CMAKE_COMMAND} -E make_directory ${DEST_DIR} + COMMAND ${CMAKE_COMMAND} -E copy_if_different ${TestFileList} ${DEST_DIR} +) + +endmacro() + + +#///////////////////////////////////////////////////////////////////////////////////////////////// +macro(TSEP_PROVIDE_APPLICATION_DATA_FILES ApplicationName AppDataFileList) + +message(" Generating custom action to provide the application data file in the application data directory / " ${ApplicationName}) + +# Calculate the length of the loop +list(LENGTH ${AppDataFileList} len1) +math(EXPR len2 "${len1} / 2") + +# Loop over the array +foreach(val RANGE 0 ${len2} 2) + # Calculate the next idx + math(EXPR valN "${val} + 1") + + # Get the items + list(GET ${AppDataFileList} ${val} SubFolder) + list(GET ${AppDataFileList} ${valN} FileName) + + # Do copy + if("${SubFolder}" STREQUAL "") + TSEP_PROVIDE_APPLICATION_DATA_FILES_IN_ROOTFOLDER(${ApplicationName} ${FileName}) + else() + TSEP_PROVIDE_APPLICATION_DATA_FILES_IN_SUBFOLDER(${ApplicationName} ${SubFolder} ${FileName}) + endif() + +# message(STATUS "${val1} ${val2}") +endforeach() + +endmacro() + +#///////////////////////////////////////////////////////////////////////////////////////////////// +macro(TSEP_PROVIDE_APPLICATION_DATA_FILES_IN_ROOTFOLDER ApplicationName AppDataFile) + +message(" Generating custom action to provide the application data file -> ${AppDataFile}") + +if (WIN32) + file(TO_NATIVE_PATH $ENV{PROGRAMDATA}/Tsep/${ApplicationName} DEST_DIR) +else() + file(TO_NATIVE_PATH $ENV{HOME}/.local/share DEST_DIR) +endif() + +#- Add pre-link step to the copy the source files +add_custom_command(TARGET ${PROJECT_NAME} + DEPENDS ${AppDataFileList} + POST_BUILD + VERBATIM + WORKING_DIRECTORY + COMMAND_EXPAND_LISTS + COMMAND ${CMAKE_COMMAND} -E make_directory ${DEST_DIR} + COMMAND ${CMAKE_COMMAND} -E copy_if_different ${AppDataFile} ${DEST_DIR} +) + +endmacro() + +#///////////////////////////////////////////////////////////////////////////////////////////////// +macro(TSEP_PROVIDE_APPLICATION_DATA_FILES_IN_SUBFOLDER ApplicationName SubFolder AppDataFile) + +message(" Generating custom action to provide the application data file in folder ${SubFolder} -> ${AppDataFile}") + +if (WIN32) + file(TO_NATIVE_PATH $ENV{PROGRAMDATA}/Tsep/${ApplicationName}/${SubFolder} DEST_DIR) +else() + file(TO_NATIVE_PATH $ENV{HOME}/.local/share/${SubFolder} DEST_DIR) +endif() + +#- Add pre-link step to the copy the source files +add_custom_command(TARGET ${PROJECT_NAME} + DEPENDS ${AppDataFileList} + POST_BUILD + VERBATIM + WORKING_DIRECTORY + COMMAND_EXPAND_LISTS + COMMAND ${CMAKE_COMMAND} -E make_directory ${DEST_DIR} + COMMAND ${CMAKE_COMMAND} -E copy_if_different ${AppDataFile} ${DEST_DIR} +) + +endmacro() + +#///////////////////////////////////////////////////////////////////////////////////////////////// +function(TSEP_GENERATE_DEPENDENCY_LINKS) + message(" Generating executable links for all dependencies") + + # Generate the link only if we are in developer mode + if(NOT TSEP_PRODUCT_BUILD) + # Debug ---------------------------------------------------------------------------------------- + TSEP_GENERATE_DEPENDENCY_LINKS_FOR_CONFIGURATION(Debug) + TSEP_GENERATE_ADDED_DEPENDENCY_LINKS_FOR_CONFIGURATION(Debug) + + # Release ---------------------------------------------------------------------------------------- + TSEP_GENERATE_DEPENDENCY_LINKS_FOR_CONFIGURATION(Release) + TSEP_GENERATE_ADDED_DEPENDENCY_LINKS_FOR_CONFIGURATION(Release) + endif() +endfunction() + +#///////////////////////////////////////////////////////////////////////////////////////////////// +function(TSEP_GENERATE_DEPENDENCY_LINKS_FOR_CONFIGURATION) + + get_target_property(ExecutableLinks ${PROJECT_NAME} LINK_LIBRARIES) + set (CONTAINS_QT_PROJECT_GLOBAL FALSE) + + # For all files -------------------------------------------------------------------------------- + foreach (Executable ${ExecutableLinks}) + set (CONTAINS_QT_PROJECT FALSE) + set (CONTAINS_SSL_PROJECT FALSE) + set (CONTAINS_CRYPTO_PROJECT FALSE) + set (CONTAINS_TSEP_PROJECT FALSE) + + string(FIND ${Executable} "Tsep::" TsepExecutable) + if (TsepExecutable GREATER -1) + set (CONTAINS_TSEP_PROJECT TRUE) + endif() + if(WIN32) + string(FIND ${Executable} "Qt5::" QtExecutable) + if (QtExecutable GREATER -1) + set (CONTAINS_QT_PROJECT TRUE) + set (CONTAINS_QT_PROJECT_GLOBAL TRUE) + endif() + string(FIND ${Executable} "OpenSSL::SSL" OpenSslExecutable) + if (OpenSslExecutable GREATER -1) + set (CONTAINS_SSL_PROJECT TRUE) + endif() + string(FIND ${Executable} "OpenSSL::Crypto" OpenSslExecutable) + if (OpenSslExecutable GREATER -1) + set (CONTAINS_CRYPTO_PROJECT TRUE) + endif() + endif() + + if(CONTAINS_TSEP_PROJECT OR CONTAINS_QT_PROJECT OR CONTAINS_SSL_PROJECT OR CONTAINS_CRYPTO_PROJECT) + # at the moment not needed for linux + if(WIN32) + if(CONTAINS_SSL_PROJECT) + set(LinkFile ${OPENSSL_ROOT_DIR}/bin/libssl-1_1-x64.dll) + elseif(CONTAINS_CRYPTO_PROJECT) + set(LinkFile ${OPENSSL_ROOT_DIR}/bin/libcrypto-1_1-x64.dll) + elseif (${ARGV0} STREQUAL Debug) + get_target_property(LinkFile ${Executable} LOCATION_DEBUG) + else() + get_target_property(LinkFile ${Executable} LOCATION_RELEASE) + endif() + + #- Get the file name from the complete path + get_filename_component(LinkFileName ${LinkFile} NAME) + + #- convert the path into an operating system depending format + file(TO_NATIVE_PATH ${LinkFile} LinkFileNative) + + #- remove the file if it exists + if(EXISTS "${PROJECT_BINARY_DIR}/${ARGV0}/bin/${LinkFileName}") + file(REMOVE "${PROJECT_BINARY_DIR}/${ARGV0}/bin/${LinkFileName}") + endif() + + #- convert the path into an operating system depending format + file(TO_NATIVE_PATH ${LinkFileName} LinkFileNameNative) + execute_process( WORKING_DIRECTORY ${PROJECT_BINARY_DIR}/${ARGV0}/bin + COMMAND cmd.exe /c mklink "${LinkFileNameNative}" "${LinkFileNative}" + OUTPUT_QUIET) + endif() + endif() + endforeach() + + # Qt platforms and iconengines have special destination folders + if(${CONTAINS_QT_PROJECT_GLOBAL}) + set(PLATFORMS_DIR ${Qt5_DIR}/../../../plugins/platforms) + file(TO_NATIVE_PATH ${PLATFORMS_DIR} NATIVE_PLATFORMS_DIR) + execute_process(WORKING_DIRECTORY ${PROJECT_BINARY_DIR}/${ARGV0}/bin + COMMAND cmd.exe /c mklink /D platforms "${NATIVE_PLATFORMS_DIR}" + OUTPUT_QUIET) + + set(ICONENGINES_DIR ${Qt5_DIR}/../../../plugins/iconengines) + file(TO_NATIVE_PATH ${ICONENGINES_DIR} NATIVE_ICONENGINES_DIR) + execute_process(WORKING_DIRECTORY ${PROJECT_BINARY_DIR}/${ARGV0}/bin + COMMAND cmd.exe /c mklink /D iconengines "${NATIVE_ICONENGINES_DIR}" + OUTPUT_QUIET) + endif() + +endfunction() + +#///////////////////////////////////////////////////////////////////////////////////////////////// +# creates dependency links for dynamically loaded libraries under windows and extends the rpath under linux +function(TSEP_GENERATE_ADDED_DEPENDENCY_LINKS_FOR_CONFIGURATION) + +get_target_property(ExecutableLinks ${PROJECT_NAME} MANUALLY_ADDED_DEPENDENCIES) + +# For all files -------------------------------------------------------------------------------- +foreach (Executable ${ExecutableLinks}) + set (CONTAINS_TSEP_PROJECT FALSE) + + string(FIND ${Executable} "Tsep::" TsepExecutable) + if (TsepExecutable GREATER -1) + set (CONTAINS_TSEP_PROJECT TRUE) + endif() + + if(CONTAINS_TSEP_PROJECT) + + if (${ARGV0} STREQUAL Debug) + get_target_property(LinkFile ${Executable} LOCATION_DEBUG) + else() + get_target_property(LinkFile ${Executable} LOCATION_RELEASE) + endif() + + if(WIN32) + #- Get the file name from the complete path + get_filename_component(LinkFileName ${LinkFile} NAME) + + #- convert the path into an operating system depending format + file(TO_NATIVE_PATH ${LinkFile} LinkFileNative) + + #- create the link + + #- remove the file if it exists + if(EXISTS "${PROJECT_BINARY_DIR}/${ARGV0}/bin/${LinkFileName}") + file(REMOVE "${PROJECT_BINARY_DIR}/${ARGV0}/bin/${LinkFileName}") + endif() + + #- convert the path into an operating system depending format + file(TO_NATIVE_PATH ${LinkFileName} LinkFileNameNative) + execute_process( WORKING_DIRECTORY ${PROJECT_BINARY_DIR}/${ARGV0}/bin + COMMAND cmd.exe /c mklink "${LinkFileNameNative}" "${LinkFileNative}" + OUTPUT_QUIET) + else() + #- Get the path of the file + get_filename_component(LinkDirectoryName ${LinkFile} DIRECTORY) + get_target_property(OLD_RPATH ${PROJECT_NAME} BUILD_RPATH) + if (${OLD_PATH}) + set_property(TARGET ${PROJECT_NAME} PROPERTY BUILD_RPATH "${OLD_RPATH};${LinkDirectoryName}") + else() + set_property(TARGET ${PROJECT_NAME} PROPERTY BUILD_RPATH "$ORIGIN;${LinkDirectoryName}") + endif() + endif() + + endif() +endforeach() + +endfunction() + +#///////////////////////////////////////////////////////////////////////////////////////////////// +function(TSEP_GENERATE_CUSTOM_DEPENDENCY_LINK) +message(" Generating executable links for all dependencies") + +# Debug ---------------------------------------------------------------------------------------- +TSEP_GENERATE_CUSTOM_DEPENDENCY_LINK_FOR_CONFIGURATION(Debug ${ARGV0} ${ARGV1}) + +# Release ---------------------------------------------------------------------------------------- +TSEP_GENERATE_CUSTOM_DEPENDENCY_LINK_FOR_CONFIGURATION(Release ${ARGV0} ${ARGV1}) + +endfunction() + +#///////////////////////////////////////////////////////////////////////////////////////////////// +function(TSEP_GENERATE_CUSTOM_DEPENDENCY_LINK_FOR_CONFIGURATION) + #- Get the file name from the complete path + set(LinkFile ${ARGV1}) + get_filename_component(LinkFileName ${LinkFile} NAME) + + if(${ARGC} GREATER 2) + set(LinkFileName ${ARGV2}/${LinkFileName}) + file(MAKE_DIRECTORY ${PROJECT_BINARY_DIR}/${ARGV0}/bin/${ARGV2}) + endif() + + #- convert the path into an operating system depending format + file(TO_NATIVE_PATH ${LinkFile} LinkFileNative) + + #- create the link + if(WIN32) + #- remove the file if it exists + if(EXISTS "${PROJECT_BINARY_DIR}/${ARGV0}/bin/${LinkFileName}") + file(REMOVE "${PROJECT_BINARY_DIR}/${ARGV0}/bin/${LinkFileName}") + endif() + + #- convert the path into an operating system depending format + file(TO_NATIVE_PATH ${LinkFileName} LinkFileNameNative) + execute_process( WORKING_DIRECTORY ${PROJECT_BINARY_DIR}/${ARGV0}/bin + COMMAND cmd.exe /c mklink "${LinkFileNameNative}" "${LinkFileNative}" + OUTPUT_QUIET) + else() + file(COPY ${LinkFile} DESTINATION ${PROJECT_BINARY_DIR}/bin/) + endif() +endfunction() + +#///////////////////////////////////////////////////////////////////////////////////////////////// +function(TSEP_GENERATE_CUSTOM_DEPENDENCY_TARGET_LINK) +message(" Generating executable links for all dependencies") + +# Debug ---------------------------------------------------------------------------------------- +TSEP_GENERATE_CUSTOM_DEPENDENCY_TARGET_LINK_FOR_CONFIGURATION(Debug ${ARGV0} ${ARGV1}) + +# Release ---------------------------------------------------------------------------------------- +TSEP_GENERATE_CUSTOM_DEPENDENCY_TARGET_LINK_FOR_CONFIGURATION(Release ${ARGV0} ${ARGV1}) + +endfunction() + +#///////////////////////////////////////////////////////////////////////////////////////////////// +function(TSEP_GENERATE_CUSTOM_DEPENDENCY_TARGET_LINK_FOR_CONFIGURATION) + #- Get the file name from the complete path + set(Executable ${ARGV1}) + + if (${ARGV0} STREQUAL Debug) + get_target_property(LinkFile ${Executable} LOCATION_DEBUG) + else() + get_target_property(LinkFile ${Executable} LOCATION_RELEASE) + endif() + + get_filename_component(LinkFileName ${LinkFile} NAME) + + if(${ARGC} GREATER 2) + set(LinkFileName ${ARGV2}/${LinkFileName}) + file(MAKE_DIRECTORY ${PROJECT_BINARY_DIR}/${ARGV0}/bin/${ARGV2}) + endif() + + #- create the link + if(WIN32) + #- convert the path into an operating system depending format + file(TO_NATIVE_PATH ${LinkFile} LinkFileNative) + + #- remove the file if it exists + if(EXISTS "${PROJECT_BINARY_DIR}/${ARGV0}/bin/${LinkFileName}") + file(REMOVE "${PROJECT_BINARY_DIR}/${ARGV0}/bin/${LinkFileName}") + endif() + + #- convert the path into an operating system depending format + file(TO_NATIVE_PATH ${LinkFileName} LinkFileNameNative) + execute_process( WORKING_DIRECTORY ${PROJECT_BINARY_DIR}/${ARGV0}/bin + COMMAND cmd.exe /c mklink "${LinkFileNameNative}" "${LinkFileNative}" + OUTPUT_QUIET) + else() + message("${LinkFile} -> ${PROJECT_BINARY_DIR}/bin/${LinkFileName}") + file(COPY ${LinkFile} DESTINATION ${PROJECT_BINARY_DIR}/bin/) + endif() +endfunction() + +#///////////////////////////////////////////////////////////////////////////////////////////////// +function(TSEP_USE_CODE_ANALYSIS ProjectName) + +if (WIN32) + #- generate the poperty file only if it not exists + if(NOT EXISTS "${PROJECT_BINARY_DIR}/${TSEP_VS_PROP_FILE}") + message(" Create VS property sheet for code analysing for project / " ${ProjectName}) + + set(TsepConfigPropFile ${TSEP_PROJECT_CMAKE}/${TSEP_CA_RULESET_DIR}/${TSEP_VS_PROP_FILE}) + file(TO_NATIVE_PATH ${TsepConfigPropFile} TsepConfigPropFileNative) + + set(TsepCAFile ${TSEP_PROJECT_CMAKE}/${TSEP_CA_RULESET_DIR}/${TSEP_CA_RULESET_FILE}) + file(TO_NATIVE_PATH ${TsepCAFile} TsepCAFileNative) + + # Copy the nuspec template file and configure it for the product + configure_file(${TsepConfigPropFileNative} ${PROJECT_BINARY_DIR}/${TSEP_VS_PROP_FILE} @ONLY ) + + endif() + + #- set the property + set_target_properties(${ProjectName} PROPERTIES VS_USER_PROPS ../${TSEP_VS_PROP_FILE}) + +endif() + +endfunction() + +#///////////////////////////////////////////////////////////////////////////////////////////////// +function(TSEP_ADD_AUTOBUILD_UNITTEST UnitExecutableName) + get_property(local_prop GLOBAL PROPERTY TSEP_AUTOBUILD_UNITTEST) + set(local_prop "${local_prop};${UnitExecutableName}") + set_property(GLOBAL PROPERTY TSEP_AUTOBUILD_UNITTEST ${local_prop}) + #message("list " ${local_prop}) +endfunction() + +#///////////////////////////////////////////////////////////////////////////////////////////////// +function(TSEP_ADD_AUTOBUILD MainProjectName) + +IF (INTIME) + set(TSEP_AUTOBUILD_DIR "${PROJECT_BINARY_DIR}/../../AutoBuild/INtime") +elseif (WIN32) + set(TSEP_AUTOBUILD_DIR "${PROJECT_BINARY_DIR}/../../AutoBuild/Windows") +elseif (LINUX) + set(TSEP_AUTOBUILD_DIR "${PROJECT_BINARY_DIR}/../AutoBuild/linux") +endif() + + set(TSEP_AUTOBUILD_PROJECT ${MainProjectName}) + + get_property(local_prop GLOBAL PROPERTY TSEP_AUTOBUILD_UNITTEST) + + message("-------------------------------------------------------") + message(" Auto Build Solution name : " ${TSEP_AUTOBUILD_PROJECT}) + + # Create the auto build directory + message(" Prepare auto build dir : " ${TSEP_AUTOBUILD_DIR}) + if(EXISTS ${TSEP_AUTOBUILD_DIR}) + file(REMOVE_RECURSE ${TSEP_AUTOBUILD_DIR}) + endif() + file(MAKE_DIRECTORY ${TSEP_AUTOBUILD_DIR}) + file(MAKE_DIRECTORY ${TSEP_AUTOBUILD_DIR}/scripts) + + # Copy the files for the build, os dependend + IF (INTIME) + configure_file(${TSEP_PROJECT_CMAKE}/AutoBuild/BuildVs2017INtimeProject.cmd ${TSEP_AUTOBUILD_DIR}/scripts COPYONLY) + foreach (TSEP_AUTOBUILD_UNIT_EXE ${local_prop}) + if("${TSEP_AUTOBUILD_USED_UNITTEST}" STREQUAL "") + set(TSEP_AUTOBUILD_USED_UNITTEST "${TSEP_AUTOBUILD_UNIT_EXE}") + else() + set(TSEP_AUTOBUILD_USED_UNITTEST "${TSEP_AUTOBUILD_USED_UNITTEST},${TSEP_AUTOBUILD_UNIT_EXE}") + endif() + endforeach() + message(" Auto Build Unittest : " ${TSEP_AUTOBUILD_USED_UNITTEST}) + configure_file(${TSEP_PROJECT_CMAKE}/AutoBuild/BuildAllVS2017INtime.cmd ${TSEP_AUTOBUILD_DIR}/BuildAll.cmd @ONLY) + elseif (WIN32) + set(TSEP_AUTOBUILD_USED_UNITTEST "") + configure_file(${TSEP_PROJECT_CMAKE}/AutoBuild/BuildVS2017Project.cmd ${TSEP_AUTOBUILD_DIR}/scripts COPYONLY) + foreach (TSEP_AUTOBUILD_UNIT_EXE ${local_prop}) + if("${TSEP_AUTOBUILD_USED_UNITTEST}" STREQUAL "") + set(TSEP_AUTOBUILD_USED_UNITTEST "${TSEP_AUTOBUILD_UNIT_EXE}") + else() + set(TSEP_AUTOBUILD_USED_UNITTEST "${TSEP_AUTOBUILD_USED_UNITTEST},${TSEP_AUTOBUILD_UNIT_EXE}") + endif() + endforeach() + message(" Auto Build Unittest : " ${TSEP_AUTOBUILD_USED_UNITTEST}) + configure_file(${TSEP_PROJECT_CMAKE}/AutoBuild/BuildAllVS2017.cmd ${TSEP_AUTOBUILD_DIR}/BuildAll.cmd @ONLY) + elseif (LINUX) + configure_file(${TSEP_PROJECT_CMAKE}/AutoBuild/BuildLinuxProject.sh ${TSEP_AUTOBUILD_DIR}/scripts COPYONLY) + configure_file(${TSEP_PROJECT_CMAKE}/AutoBuild/RunUnitTest.sh ${TSEP_AUTOBUILD_DIR}/scripts COPYONLY) + foreach (TSEP_AUTOBUILD_UNIT_EXE ${local_prop}) + if("${TSEP_AUTOBUILD_USED_UNITTEST}" STREQUAL "") + set(TSEP_AUTOBUILD_USED_UNITTEST "${TSEP_AUTOBUILD_UNIT_EXE}") + else() + set(TSEP_AUTOBUILD_USED_UNITTEST "${TSEP_AUTOBUILD_USED_UNITTEST},${TSEP_AUTOBUILD_UNIT_EXE}") + endif() + endforeach() + message(" Auto Build Unittest : " ${TSEP_AUTOBUILD_USED_UNITTEST}) + configure_file(${TSEP_PROJECT_CMAKE}/AutoBuild/BuildAllLinux.sh ${TSEP_AUTOBUILD_DIR}/BuildAll.sh @ONLY) + endif() + +endfunction() + + diff --git a/LSFramework/CMake/CMake.1.6.0/CMakeSettings.cmake b/LSFramework/CMake/CMake.1.6.0/CMakeSettings.cmake new file mode 100644 index 0000000..3c1ab20 --- /dev/null +++ b/LSFramework/CMake/CMake.1.6.0/CMakeSettings.cmake @@ -0,0 +1,165 @@ +########################################################################################### +# +# (c) Technical Software Engineering Plazotta 2019 +# +# CMAKE project settings file +# +# History +# 29.09.2019 / Plazotta +# Template created. +# +#----------------------------------------------------------------------------------------- +# +#----------------------------------------------------------------------------------------- +# Define the project global CMAKE settings +# +set (TSEP_PROJECT_NAME ${PROJECT_NAME}) +set (TSEP_SOURCE_DIR ${PROJECT_SOURCE_DIR}) +set (TSEP_EXPORT_DIR ${PROJECT_SOURCE_DIR}/../Export) +set (TSEP_BINARY_DIR ${PROJECT_BINARY_DIR}) +set (TSEP_TARGET_DIR ${CMAKE_BINARY_DIR}/${TSEP_BUILD_CONFIGURATION}) +set (TSEP_CA_RULESET_DIR RuleSets) +set (TSEP_CA_RULESET_FILE TsepNativeRecommendedRules.ruleset) +set (TSEP_VS_PROP_FILE TsepPropertySheet.props) + +set(TSEP_AUTOBUILD_PROJECT "") +set_property(GLOBAL PROPERTY TSEP_AUTOBUILD_UNITTEST) + +IF (WIN32) + set (TSEP_APPLICATION_ICON_PATH ${TSEP_PROJECT_CMAKE}"/Versions/Win32/TSEP.ico") + set (TSEP_APP_VERSION_RC ${TSEP_PROJECT_CMAKE}"/Versions/Win32/DefaultAppVersion.rc") + set (TSEP_DLL_VERSION_RC ${TSEP_PROJECT_CMAKE}"/Versions/Win32/DefaultDllVersion.rc") + set (TSEP_NUGET_APPLICATION nuget.exe) +ELSE() + set (TSEP_APPLICATION_ICON_PATH "") + set (TSEP_APP_VERSION_RC "") + set (TSEP_DLL_VERSION_RC "") + set (TSEP_NUGET_APPLICATION nuget) +ENDIF() + +############################################################################### + +############################################################################### +# SET INCLUDE PATH FOR CMAKE PROVIDED HEADERS +############################################################################### +include_directories(${CMAKE_CURRENT_LIST_DIR}/Includes) + +############################################################################### +# PROJECT SPECIFIC VARIABLES +############################################################################### + +############################################################################### +# COMPILER SETTINGS +############################################################################### +# Windows +############################################################################### +IF (WIN32) + +#- Compiler Warning level 4 -> /W4 -------------------------------------------- +#- Compiler Generate Debug Info -> /Zi ---------------------------------------- +add_compile_options( + /W4 + /Zi +) + +#- Compile with UNICODE chars ------------------------------------------------- +#- Compile with minimal windows libs -------------------------------------------- +#- Minimum Windows is W7 (0x0601) --------------------------------------------- +#- No secure warnings --------------------------------------------------------- +add_definitions( + /DUNICODE + /D_UNICODE + /DWIN32_LEAN_AND_MEAN + /D_WIN32_WINNT=0x0601 + /D_CRT_SECURE_NO_WARNINGS +) + +add_link_options( + /Debug +) + +ENDIF() + +############################################################################### +# LINUX +############################################################################### +IF (LINUX) + +#- Define for Intel linux ----------------------------------------------------- +#- relocatable code ---------------------------------------------------------- +add_compile_options( + -fPIC + -pthread +) + +#add_definitions( +#) + +set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -Wall -Wextra -pedantic -Wno-unknown-pragmas -Wno-pragma-once-outside-header -fvisibility=hidden") +set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -Wall -Wextra -pedantic -Wno-unknown-pragmas -Wno-pragma-once-outside-header -fvisibility=hidden") + +set(CMAKE_CXX_FLAGS_DEBUG "${CMAKE_CXX_FLAGS_DEBUG} -D_DEBUG") +set(CMAKE_C_FLAGS_DEBUG "${CMAKE_C_FLAGS_DEBUG} -D_DEBUG") + +set(CMAKE_INSTALL_RPATH "$ORIGIN") +set(CMAKE_BUILD_RPATH "$ORIGIN") + +ENDIF() + +############################################################################### +# SET OUTPUT DIRECTORIES for exe, dll, lib and pdb files +############################################################################### + +# must set directories for each configuration, +if(WIN32) + set(CMAKE_INSTALL_PREFIX ${CMAKE_BINARY_DIR}/../../Export) + + # cmake can not use the $(Configuration) variable, so we must define separate debug and release variables + set(TSEP_TARGET_DIR ${CMAKE_BINARY_DIR}/$(Configuration)) + set(TSEP_TARGET_DIR_RELEASE ${CMAKE_BINARY_DIR}/Release) + set(TSEP_TARGET_DIR_DEBUG ${CMAKE_BINARY_DIR}/Debug) +else() + set(CMAKE_INSTALL_PREFIX ${CMAKE_BINARY_DIR}/../Export) + + set(TSEP_TARGET_DIR ${CMAKE_BINARY_DIR}) + set(TSEP_TARGET_DIR_RELEASE ${CMAKE_BINARY_DIR}) + set(TSEP_TARGET_DIR_DEBUG ${CMAKE_BINARY_DIR}) +endif() + +# set directories +set(CMAKE_RUNTIME_OUTPUT_DIRECTORY_RELEASE ${TSEP_TARGET_DIR_RELEASE}/bin) +if(WIN32) +set(CMAKE_LIBRARY_OUTPUT_DIRECTORY_RELEASE ${TSEP_TARGET_DIR_RELEASE}/lib) +else() +set(CMAKE_LIBRARY_OUTPUT_DIRECTORY_RELEASE ${TSEP_TARGET_DIR_RELEASE}/bin) +endif() +set(CMAKE_ARCHIVE_OUTPUT_DIRECTORY_RELEASE ${TSEP_TARGET_DIR_RELEASE}/lib) +set(CMAKE_PDB_OUTPUT_DIRECTORY_RELEASE ${TSEP_TARGET_DIR_RELEASE}/lib) + +set(CMAKE_RUNTIME_OUTPUT_DIRECTORY_DEBUG ${TSEP_TARGET_DIR_DEBUG}/bin) +if(WIN32) +set(CMAKE_LIBRARY_OUTPUT_DIRECTORY_DEBUG ${TSEP_TARGET_DIR_DEBUG}/lib) +else() +set(CMAKE_LIBRARY_OUTPUT_DIRECTORY_DEBUG ${TSEP_TARGET_DIR_DEBUG}/bin) +endif() +set(CMAKE_ARCHIVE_OUTPUT_DIRECTORY_DEBUG ${TSEP_TARGET_DIR_DEBUG}/lib) +set(CMAKE_PDB_OUTPUT_DIRECTORY_DEBUG ${TSEP_TARGET_DIR_DEBUG}/lib) + +IF (WIN32) + file(MAKE_DIRECTORY "${PROJECT_BINARY_DIR}/Debug/bin") + file(MAKE_DIRECTORY "${PROJECT_BINARY_DIR}/Release/bin") +ENDIF() + +############################################################################### + +message(NOTICE "------------------------------------------------------------") +message(NOTICE " Used Generator = ${TSEP_CMAKE_GENERATOR}") +message(NOTICE " Used Config = ${TSEP_BUILD_CONFIGURATION}") +message(NOTICE " Used Project = ${TSEP_PROJECT_NAME}") +message(NOTICE " Source path = ${TSEP_SOURCE_DIR}") +message(NOTICE " Binary path = ${TSEP_BINARY_DIR}") +message(NOTICE " Target path = ${TSEP_TARGET_DIR}") +message(NOTICE " Product Build = ${TSEP_PRODUCT_BUILD}") +message(NOTICE "------------------------------------------------------------") + +############################################################################### diff --git a/LSFramework/CMake/CMake.1.6.0/Includes/TsepVersion.h b/LSFramework/CMake/CMake.1.6.0/Includes/TsepVersion.h new file mode 100644 index 0000000..f1731f2 --- /dev/null +++ b/LSFramework/CMake/CMake.1.6.0/Includes/TsepVersion.h @@ -0,0 +1,28 @@ +// define the version string and embed it into the binary +extern "C" const char TSEP_BINARY_VERSION[] = "TSEP_VERSION:" TSEP_VERSION; + +#ifdef __linux__ + #ifdef TSEP_SHARED_LIBRARY + + // if TSEP_SHARED_LIBRARY is defined an entry point for a shared library will be defined + // which will print the binary infromation + + #include + #include + + extern "C" const char interp_path[] __attribute__((section(".interp"))) = "/lib64/ld-linux-x86-64.so.2"; + + extern "C" void tsep_version_entry_point() + { + printf(TSEP_PRODUCT_NAME " " TSEP_VERSION "\n"); + printf(TSEP_COPYRIGHT "\n"); + printf("Compiled by GCC %d.%d", __GNUC__, __GNUC_MINOR__); + #ifdef _DEBUG + printf(" (debug build)"); + #endif + printf("\n"); + exit(0); + } + + #endif +#endif \ No newline at end of file diff --git a/LSFramework/CMake/CMake.1.6.0/RuleSets/TsepNativeRecommendedRules.ruleset b/LSFramework/CMake/CMake.1.6.0/RuleSets/TsepNativeRecommendedRules.ruleset new file mode 100644 index 0000000..8762034 --- /dev/null +++ b/LSFramework/CMake/CMake.1.6.0/RuleSets/TsepNativeRecommendedRules.ruleset @@ -0,0 +1,283 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/LSFramework/CMake/CMake.1.6.0/RuleSets/TsepPropertySheet.props b/LSFramework/CMake/CMake.1.6.0/RuleSets/TsepPropertySheet.props new file mode 100644 index 0000000..d9e540b --- /dev/null +++ b/LSFramework/CMake/CMake.1.6.0/RuleSets/TsepPropertySheet.props @@ -0,0 +1,10 @@ + + + + + + @TsepCAFileNative@ + + + + \ No newline at end of file diff --git a/LSFramework/CMake/CMake.1.6.0/Templates/CMake.nuspec.Template b/LSFramework/CMake/CMake.1.6.0/Templates/CMake.nuspec.Template new file mode 100644 index 0000000..0e3eb4f --- /dev/null +++ b/LSFramework/CMake/CMake.1.6.0/Templates/CMake.nuspec.Template @@ -0,0 +1,17 @@ + + + + @TSEP_PRODUCT_NAME@ + @TSEP_NEXUS_VERSION@ + $ENV{USERNAME} + TSEP + @TSEP_PRODUCT_DESCRIPTION@ + internal + Copyright 2021 + Application + + + + + + diff --git a/LSFramework/CMake/CMake.1.6.0/Templates/CMakeLists.Console.Template.cmake b/LSFramework/CMake/CMake.1.6.0/Templates/CMakeLists.Console.Template.cmake new file mode 100644 index 0000000..a6ea3ec --- /dev/null +++ b/LSFramework/CMake/CMake.1.6.0/Templates/CMakeLists.Console.Template.cmake @@ -0,0 +1,91 @@ +########################################################################################### +# +# (c) Technical Software Engineering Plazotta 2021 +# +# CMAKE project file / @Add your project name@ +# +# +#----------------------------------------------------------------------------------------- +# Define project specific requirements +# +# Project name, output file name, project description +# +set(PROJECT_NAME @Add your project name@) +set(PROJECT_OUTPUT_NAME @Add your project dll name@) +set(PROJECT_DESCRIPTION "@Add your project description@") +# +#----------------------------------------------------------------------------------------- +# Define group file names +# +# SOURCE FILES +# +set(SOURCE_FILES + src/... +) +# +# HEADER FILES +# +set(HEADER_FILES + src/... +) +# +# Define folders for group files +# +source_group("Source Files" FILES ${SOURCE_FILES}) +source_group("Header Files" FILES ${HEADER_FILES}) +# +# Include files, add your own includes +# +include_directories( + ${CMAKE_CURRENT_LIST_DIR}/src +# /- Add your additional include paths -/ +) +# +#----------------------------------------------------------------------------------------- +# Console application definitions +# +# Setup application version +# +TSEP_SETUP_APP_VERSION(${PROJECT_DESCRIPTION}) +# +# Create console application +# +add_executable(${PROJECT_NAME} + ${SOURCE_FILES} + ${HEADER_FILES} + ${TSEP_APP_VERSION_RC} +) +# +# Setup TSEP OS specific settings for the project +# +TSEP_ADD_OS_SPECIFIC_SETTINGS() +# +# Setup output +# +set_target_properties(${PROJECT_NAME} PROPERTIES OUTPUT_NAME ${PROJECT_OUTPUT_NAME}) +# +# Add used libs +# +#target_link_libraries(${PROJECT_NAME} +# PUBLIC +# /- Add your additional libraries -/ +#) +# +# Include application data files +# i.e +#set (APPLICATION_DATA_FILES +# "certificates" ${CMAKE_CURRENT_LIST_DIR}/../Test/certificates/Themis.cer +#) +# +#set (APPLICATION_DATA_FILES +# "Folder in application data folder, may be empty" ${CMAKE_CURRENT_LIST_DIR}/../folder/File_to_Be_Used +#) +# +# Create links to necessary dependency libraries +# +TSEP_GENERATE_DEPENDENCY_LINKS() +# +# Create an Export directory with the defined data +# +TSEP_CREATE_EXPORT() +# diff --git a/LSFramework/CMake/CMake.1.6.0/Templates/CMakeLists.Dll.Template.cmake b/LSFramework/CMake/CMake.1.6.0/Templates/CMakeLists.Dll.Template.cmake new file mode 100644 index 0000000..8cf8a5d --- /dev/null +++ b/LSFramework/CMake/CMake.1.6.0/Templates/CMakeLists.Dll.Template.cmake @@ -0,0 +1,98 @@ +########################################################################################### +# +# (c) Technical Software Engineering Plazotta 2021 +# +# CMAKE project file / @Add your project name@ +# +# +#----------------------------------------------------------------------------------------- +# Define project specific requirements +# +# Project name, output file name, project description +# +set(PROJECT_NAME @Add your project name@) +set(PROJECT_OUTPUT_NAME @Add your project dll name@) +set(PROJECT_DESCRIPTION "@Add your project description@") +# +#----------------------------------------------------------------------------------------- +# Define group file names +# +# SOURCE FILES +# +set(SOURCE_FILES + src/... +) +# +# HEADER FILES +# +set(HEADER_FILES + src/... +) +# +#----------------------------------------------------------------------------------------- +# Define solution folders for group files +# +source_group("Source Files" FILES ${SOURCE_FILES}) +source_group("Header Files" FILES ${HEADER_FILES}) +# +#----------------------------------------------------------------------------------------- +# DLL definitions +# +# Setup shared library version +# +TSEP_SETUP_DLL_VERSION(${PROJECT_DESCRIPTION}) +# +# Create shared library target +# +add_library(${PROJECT_NAME} SHARED + ${SOURCE_FILES} + ${HEADER_FILES} + ${TSEP_DLL_VERSION_RC} +) +# +# Add alias for the project +# +add_library(Tsep::${PROJECT_NAME} ALIAS ${PROJECT_NAME}) +# +# Setup TSEP OS specific settings for the project +# +TSEP_ADD_OS_SPECIFIC_SETTINGS() +# +# Setup output name +# +set_target_properties(${PROJECT_NAME} PROPERTIES OUTPUT_NAME ${PROJECT_OUTPUT_NAME}) +# +# Use VS Code Analysis for the project +# +TSEP_USE_CODE_ANALYSIS(${PROJECT_NAME}) +# +# Define Export Headers +# +TSEP_ADD_EXPORT_HEADER("${HEADER_FILES}") +# +# Include files, add your own includes and for the export +# +target_include_directories(${PROJECT_NAME} + PUBLIC + $ + $ + #PRIVATE + # include paths, which will not be exported +) +# +# Add used libs +# +#target_link_libraries(${PROJECT_NAME} +# PUBLIC +# /- Add your additional libraries -/ +#) +# +# Create an Export directory with the defined data +# +TSEP_CREATE_EXPORT() +# +# +# Create links to necessary dependency libraries +# +TSEP_GENERATE_DEPENDENCY_LINKS() +# diff --git a/LSFramework/CMake/CMake.1.6.0/Templates/CMakeLists.Gui.Template.cmake b/LSFramework/CMake/CMake.1.6.0/Templates/CMakeLists.Gui.Template.cmake new file mode 100644 index 0000000..7639c69 --- /dev/null +++ b/LSFramework/CMake/CMake.1.6.0/Templates/CMakeLists.Gui.Template.cmake @@ -0,0 +1,130 @@ +########################################################################################### +# +# (c) Technical Software Engineering Plazotta 2021 +# +# CMAKE project file / @Add your project name@ +# +# +#----------------------------------------------------------------------------------------- +# Define project specific requirements +# +# Project name, output file name, project description +# +set(PROJECT_NAME @Add your project name@) +set(PROJECT_OUTPUT_NAME @Add your project dll name@) +set(PROJECT_DESCRIPTION "@Add your project description@") +# +#----------------------------------------------------------------------------------------- +# +# qt moc, rcc uic +# +set(CMAKE_AUTOMOC ON) +set(CMAKE_AUTORCC ON) +set(CMAKE_INCLUDE_CURRENT_DIR ON) +# +# Define group file names +# +# SOURCE FILES +# +set(SOURCE_FILES + src/... +) +# +# HEADER FILES +# +set(HEADER_FILES + src/... +) +# +# UI FILES +# +set(UI_FILES + ui/... +) +qt5_wrap_ui(UI_FILES_WRAPPED ${UI_FILES}) +# +# +# TRANSLATION +# +# Define supported Language +set(LANGUAGES + de +) +# +# Create .ts and .qm Files +TSEP_TRANSLATE(${LANGUAGES}) +# +# +# RESOURCE FILES +# +set(RESOURCE_FILES + resources/... +) +# +# Define folders for group files +# +source_group("Source Files" FILES ${SOURCE_FILES}) +source_group("Header Files" FILES ${HEADER_FILES}) +source_group("UI Files" FILES ${UI_FILES} ${UI_FILES_WRAPPED}) +source_group("Resource Files" FILES ${RESOURCE_FILES}) +# +# Include files, add your own includes +# +include_directories( + ${CMAKE_CURRENT_LIST_DIR}/src +# /- Add your additional include paths -/ +) +# +#----------------------------------------------------------------------------------------- +# Gui application definitions +# +# Setup application version +# +TSEP_SETUP_APP_VERSION(${PROJECT_DESCRIPTION}) +# +# Create gui application +# +add_executable(${PROJECT_NAME} WIN32 + ${SOURCE_FILES} + ${HEADER_FILES} + ${UI_FILES} + ${UI_FILES_WRAPPED} + ${RESOURCE_FILES} + ${TSEP_APP_VERSION_RC} + ${TSEP_TRANSLATION_FILES} +) +# +# Setup TSEP OS specific settings for the project +# +TSEP_ADD_OS_SPECIFIC_SETTINGS() +# +# Setup output +# +set_target_properties(${PROJECT_NAME} PROPERTIES OUTPUT_NAME ${PROJECT_OUTPUT_NAME}) +# +# Add used libs +# +#target_link_libraries(${PROJECT_NAME} +# PUBLIC +# /- Add your additional libraries -/ +#) +# +# +# Include application data files +# i.e +#set (APPLICATION_DATA_FILES +# "certificates" ${CMAKE_CURRENT_LIST_DIR}/../Test/certificates/Themis.cer +#) +# +#set (APPLICATION_DATA_FILES +# "Folder in application data folder, may be empty" ${CMAKE_CURRENT_LIST_DIR}/../folder/File_to_Be_Used +#) + +# Create links to necessary dependency libraries +# +TSEP_GENERATE_DEPENDENCY_LINKS() +# +# Create an Export directory with the defined data +# +TSEP_CREATE_EXPORT() +# diff --git a/LSFramework/CMake/CMake.1.6.0/Templates/CMakeLists.Lib.Template.cmake b/LSFramework/CMake/CMake.1.6.0/Templates/CMakeLists.Lib.Template.cmake new file mode 100644 index 0000000..5a537e7 --- /dev/null +++ b/LSFramework/CMake/CMake.1.6.0/Templates/CMakeLists.Lib.Template.cmake @@ -0,0 +1,85 @@ +########################################################################################### +# +# (c) Technical Software Engineering Plazotta 2021 +# +# CMAKE project file / @Add your project name@ +# +# +#----------------------------------------------------------------------------------------- +# Define project specific requirements +# +# Project name, output file name, project description +# +set(PROJECT_NAME @Add your project name@) +set(PROJECT_OUTPUT_NAME @Add your project lib name@) +set(PROJECT_DESCRIPTION "@Add your project description@") +# +#----------------------------------------------------------------------------------------- +# Define group file names +# +# SOURCE FILES +# +set(SOURCE_FILES + src/... +) +# +# HEADER FILES +# +set(HEADER_FILES + src/... +) +# +#----------------------------------------------------------------------------------------- +# Define solution folders for group files +# +source_group("Source Files" FILES ${SOURCE_FILES}) +source_group("Header Files" FILES ${HEADER_FILES}) +# +# Create static library target +# +add_library(${PROJECT_NAME} STATIC + ${SOURCE_FILES} + ${HEADER_FILES} +) +# +# Add alias for the project +# +add_library(Tsep::${PROJECT_NAME} ALIAS ${PROJECT_NAME}) +# +# Setup TSEP OS specific settings for the project +# +TSEP_ADD_OS_SPECIFIC_SETTINGS() +# +# Setup output name +# +set_target_properties(${PROJECT_NAME} PROPERTIES OUTPUT_NAME ${PROJECT_OUTPUT_NAME}) +# +# Use VS Code Analysis for the project +# +TSEP_USE_CODE_ANALYSIS(${PROJECT_NAME}) +# +# Define Export Headers +# +TSEP_ADD_EXPORT_HEADER("${HEADER_FILES}") +# +# Include files, add your own includes and for the export +# +target_include_directories(${PROJECT_NAME} + PUBLIC + $ + $ + #PRIVATE + # include paths, which will not be exported +) +# +# Add used libs +# +#target_link_libraries(${PROJECT_NAME} +# PUBLIC +# /- Add your additional libraries -/ +#) +# +# Create an Export directory with the defined data +# +TSEP_CREATE_EXPORT(static) +# diff --git a/LSFramework/CMake/CMake.1.6.0/Templates/CMakeLists.Nexus.Template.cmake b/LSFramework/CMake/CMake.1.6.0/Templates/CMakeLists.Nexus.Template.cmake new file mode 100644 index 0000000..8a362b6 --- /dev/null +++ b/LSFramework/CMake/CMake.1.6.0/Templates/CMakeLists.Nexus.Template.cmake @@ -0,0 +1,25 @@ +########################################################################################### +# +# (c) Technical Software Engineering Plazotta 2021 +# +# CMAKE template file to upload the paket into Nexus +# +# +#----------------------------------------------------------------------------------------- +# Define project specific requirements +# +set(PROJECT_NAME NEXUS_UPLOAD) +set(PROJECT_DESCRIPTION "TSEP Nexus upload project") + +add_custom_target(${PROJECT_NAME} + COMMENT "Upload Nexus Paket ..." + VERBATIM + WORKING_DIRECTORY ${TSEP_EXPORT_DIR} + COMMAND_EXPAND_LISTS + COMMAND ${TSEP_NUGET_APPLICATION} pack ${TSEP_EXPORT_DIR}/${TSEP_PRODUCT_NAME}.nuspec -outputdirectory ${TSEP_EXPORT_DIR} -BasePath ${TSEP_EXPORT_DIR} -verbosity detailed + COMMAND ${TSEP_NUGET_APPLICATION} push *.nupkg ${TSEP_NEXUS_GUID} -source ${TSEP_NEXUS_URL}/Development/ -verbosity detailed +) + +set_target_properties(${PROJECT_NAME} PROPERTIES FOLDER "CMakePredefinedTargets") +set_target_properties(${PROJECT_NAME} PROPERTIES EXCLUDE_FROM_ALL 1 EXCLUDE_FROM_DEFAULT_BUILD 1) + diff --git a/LSFramework/CMake/CMake.1.6.0/Templates/CMakeLists.Project.Template.cmake b/LSFramework/CMake/CMake.1.6.0/Templates/CMakeLists.Project.Template.cmake new file mode 100644 index 0000000..bb8672b --- /dev/null +++ b/LSFramework/CMake/CMake.1.6.0/Templates/CMakeLists.Project.Template.cmake @@ -0,0 +1,58 @@ +########################################################################################### +# +# (c) Technical Software Engineering Plazotta 2021 +# +# CMAKE project main file / @Add your project name@ +# +#----------------------------------------------------------------------------------------- +# Define project specific requirements +# +# Minimum CMAKE version for this project +# +cmake_minimum_required (VERSION 3.15.0) +# +# Name of the project +set(MAIN_PROJECT_NAME @Add your project name@) +project(${MAIN_PROJECT_NAME}) +# +#----------------------------------------------------------------------------------------- +# Include project specific definitions -> Generated file +# +include(Project.conf.cmake) +# +#----------------------------------------------------------------------------------------- +# Include cmake settings and macros +# +include(${TSEP_PROJECT_CMAKE}/CMakeMacros.cmake) +include(${TSEP_PROJECT_CMAKE}/CMakeSettings.cmake) +# +#----------------------------------------------------------------------------------------- +# google test framework -> enable if used +# +#TSEP_USE_GOOGLE_TESTING() +# +#----------------------------------------------------------------------------------------- +# Current project description +# +set(TSEP_PROJECT "@Add your project description@") +# +#----------------------------------------------------------------------------------------- +# Allow project folder structure +# +set_property(GLOBAL PROPERTY USE_FOLDERS ON) +# +#----------------------------------------------------------------------------------------- +# Define projects for building +# +add_subdirectory("@Add your project name@") +add_subdirectory("@Add your unittest name@") +# +#----------------------------------------------------------------------------------------- +# Define projects for managing and distributing +# +# NEXUS Upload (Only windows) +# +IF(WIN32) + TSEP_ADD_PROJECT_NEXUS_UPLOAD() +ENDIF() +# diff --git a/LSFramework/CMake/CMake.1.6.0/Templates/CMakeLists.UnitTests.Template.cmake b/LSFramework/CMake/CMake.1.6.0/Templates/CMakeLists.UnitTests.Template.cmake new file mode 100644 index 0000000..b5788c0 --- /dev/null +++ b/LSFramework/CMake/CMake.1.6.0/Templates/CMakeLists.UnitTests.Template.cmake @@ -0,0 +1,79 @@ +########################################################################################### +# +# (c) Technical Software Engineering Plazotta 2021 +# +# CMAKE project file / @Add your project name@ + +# +#----------------------------------------------------------------------------------------- +# Define project specific requirements +# +# Project name, output file name, project description +# +set(PROJECT_NAME @Add your project name@) +set(PROJECT_OUTPUT_NAME @Add your project name@) +set(UNITTEST_PROJECT @Add your unittest name@) +set(PROJECT_DESCRIPTION "Unit tests for project @Add your project name@") +# +#----------------------------------------------------------------------------------------- +# Define group file names +# +# NOTE: When using GLOB or GLOB_RECURSE for gathering files, CMake will not notice when the amount of files has changed (a file has been added/removed). +# The CMakeList has to be compiled manually after adding/removing a source/header file. +# +# SOURCE FILES +# +FILE(GLOB_RECURSE SOURCE_FILES ${CMAKE_CURRENT_LIST_DIR}/*/*.cpp) +# +# HEADER FILES +# +FILE(GLOB_RECURSE HEADER_FILES ${CMAKE_CURRENT_LIST_DIR}/*/*.h) +# +#----------------------------------------------------------------------------------------- +# Define solution folders for group files +# +source_group("Source Files" FILES ${SOURCE_FILES} main.cpp) +source_group("Header Files" FILES ${HEADER_FILES}) +# +#----------------------------------------------------------------------------------------- +# Console application definitions +# +# Setup application version +# +TSEP_SETUP_APP_VERSION(${PROJECT_DESCRIPTION}) +# +# Create console application +# +add_executable(${PROJECT_NAME} ${SOURCE_FILES} ${HEADER_FILES} ${TSEP_APP_VERSION_RC} main.cpp) +# +# Setup output +# +set_target_properties(${PROJECT_NAME} PROPERTIES OUTPUT_NAME ${PROJECT_OUTPUT_NAME}) +set_target_properties(${PROJECT_NAME} PROPERTIES FOLDER "UnitTest") +# +# Add used libs +# +target_link_libraries(${PROJECT_NAME} + PUBLIC + ${UNITTEST_PROJECT} + GTest::GTest +) +# +#----------------------------------------------------------------------------------------- +# Include files, add your own includes +TSEP_GET_HEADER_DIRECTORIES(SOURCE_INCLUDE_LIST ${TSEP_SOURCE_DIR}/${UNITTEST_PROJECT}) +TSEP_GET_HEADER_DIRECTORIES(UNIT_TEST_INCLUDE_LIST ${CMAKE_CURRENT_LIST_DIR}) +# +target_include_directories(${PROJECT_NAME} + PUBLIC + ${UNIT_TEST_INCLUDE_LIST} + ${SOURCE_INCLUDE_LIST} + #PRIVATE + # include paths, which will not be exported +) +# +# Create links to necessary dependency libraries +# +TSEP_GENERATE_DEPENDENCY_LINKS() +# + diff --git a/LSFramework/CMake/CMake.1.6.0/Templates/CMakeLists.VS_CodeAnalyzer.Template.cmake b/LSFramework/CMake/CMake.1.6.0/Templates/CMakeLists.VS_CodeAnalyzer.Template.cmake new file mode 100644 index 0000000..1987190 --- /dev/null +++ b/LSFramework/CMake/CMake.1.6.0/Templates/CMakeLists.VS_CodeAnalyzer.Template.cmake @@ -0,0 +1,29 @@ +########################################################################################### +# +# (c) Technical Software Engineering Plazotta 2021 +# +# CMAKE project main file +# +# History +# 29.09.2019 / Plazotta +# Template created. +# +#----------------------------------------------------------------------------------------- +# Define project spezific requierements +# +# Project name, output file name, project description +# +set(PROJECT_NAME VS_CODE_ANALYZER) +set(PROJECT_DESCRIPTION "TSEP Static Code Analyzer for Visual Studio") +# +#----------------------------------------------------------------------------------------- +# Static Code Analyzer for VS in Windows +# +# +IF (WIN32) +add_custom_target(${PROJECT_NAME} + COMMAND msbuild $(SolutionDir)/$(SolutionFileName) /m /t:Rebuild /p:RunCodeAnalysis=true /p:CodeAnalysisRuleSet=AllRules.ruleset + COMMENT "Running Code Analyzer ..." +) +set_target_properties(${PROJECT_NAME} PROPERTIES FOLDER "CMakePredefinedTargets") +ENDIF (WIN32) diff --git a/LSFramework/CMake/CMake.1.6.0/Templates/LinuxGenerateProject.Template.sh b/LSFramework/CMake/CMake.1.6.0/Templates/LinuxGenerateProject.Template.sh new file mode 100644 index 0000000..a27f862 --- /dev/null +++ b/LSFramework/CMake/CMake.1.6.0/Templates/LinuxGenerateProject.Template.sh @@ -0,0 +1,35 @@ +#//======================================================================== +#// Copyright (c) Technische Software Entwicklung Plazotta © 2021 +#// +#// DESCRIPTION: +#// Shell Script to Build a cmake project under linux +#// +#// HISTORY: +#// 09.04.2021 / PP +#// Module created. +#//======================================================================== +#!/bin/bash +# +#- Setup Build Results ------------------------------------------------- +cd .. +mkdir -p BuildResults +rm -r ./BuildResults_linux_Release +rm -r ./BuildResults_linux_Debug +mkdir -p BuildResults_linux_Release +mkdir -p BuildResults_linux_Debug + +#- CMAKE (Release)------------------------------------------------------ +cd BuildResults_linux_Release +cmake -G "Unix Makefiles" -DCMAKE_BUILD_TYPE=Release ../Software +if [ $? -ne 0 ]; then + echo "Error during CMake(Release) generation..." + exit 1 +fi + +#- CMAKE (Debug) ------------------------------------------------------- +cd ../BuildResults_linux_Debug +cmake -G "Unix Makefiles" -DCMAKE_BUILD_TYPE=Debug ../Software +if [ $? -ne 0 ]; then + echo "Error during CMake(Debug) generation..." + exit 1 +fi diff --git a/LSFramework/CMake/CMake.1.6.0/Templates/ProjektName.Exports.Template.h b/LSFramework/CMake/CMake.1.6.0/Templates/ProjektName.Exports.Template.h new file mode 100644 index 0000000..af00a57 --- /dev/null +++ b/LSFramework/CMake/CMake.1.6.0/Templates/ProjektName.Exports.Template.h @@ -0,0 +1,47 @@ +/** +* @page @Add your project name@ +* +* @author TSEP +* +* @copyright (c) Technical Software Engineering Plazotta 2021 +* +*/ +/** +* @file @Add your project name@.Exports.h +* @brief Definition of export declarations for this library +* +**************************************************************************/ +//TSEP_Pragma.UnitTest.Skip +#pragma once + +// Note: +// "_EXPORTS" preprocessor define is defined by CMake when compiling + +/*------------------------------------------------------------------------------ +// OPERATING SYSTEM : WIN32 +//----------------------------------------------------------------------------*/ +#ifdef _WIN32 + +/// @cond Exclude this macro from doxygen +#ifdef @Add your project name@_EXPORTS +#define TSEP_@Add your uppercase project name@_API __declspec(dllexport) +#else +#define TSEP_@Add your uppercase project name@_API __declspec(dllimport) +#endif +/// @endcond + +#endif + +/*------------------------------------------------------------------------------ +// OPERATING SYSTEM : LINUX +//----------------------------------------------------------------------------*/ +#ifdef __linux__ + +#ifdef @Add your project name@_EXPORTS +#define TSEP_@Add your uppercase project name@_API __attribute__((visibility("default"))) +#else +#define TSEP_@Add your uppercase project name@_API +#endif + +#endif // __linux__ + diff --git a/LSFramework/CMake/CMake.1.6.0/Templates/Translation.Template.ts b/LSFramework/CMake/CMake.1.6.0/Templates/Translation.Template.ts new file mode 100644 index 0000000..1552582 --- /dev/null +++ b/LSFramework/CMake/CMake.1.6.0/Templates/Translation.Template.ts @@ -0,0 +1,4 @@ + + + + diff --git a/LSFramework/CMake/CMake.1.6.0/Templates/Translations.Template.qrc b/LSFramework/CMake/CMake.1.6.0/Templates/Translations.Template.qrc new file mode 100644 index 0000000..2a8f166 --- /dev/null +++ b/LSFramework/CMake/CMake.1.6.0/Templates/Translations.Template.qrc @@ -0,0 +1,5 @@ + + + @TRANSLATION_RESOURCE_STRING@ + + \ No newline at end of file diff --git a/LSFramework/CMake/CMake.1.6.0/Templates/VSGenerateProject.cmd.Template b/LSFramework/CMake/CMake.1.6.0/Templates/VSGenerateProject.cmd.Template new file mode 100644 index 0000000..1111f36 --- /dev/null +++ b/LSFramework/CMake/CMake.1.6.0/Templates/VSGenerateProject.cmd.Template @@ -0,0 +1,44 @@ +@echo off +setlocal + +rem ########################################################################################### +rem # +rem # (c) Technical Software Engineering Plazotta 2019 +rem # +rem # CMAKE generator file for Windows VS +rem # +rem # History +rem # 29.09.2019 / Plazotta +rem # Template created. +rem # +rem ########################################################################################### +rem # +rem # This generator executes cmake based on the here configured values. All files will be +rem # copied to the location as given in the parameter BUILDRESULTS. The solution file can +rem # be found in this location. +rem # In this case a normal Windows Visual Studio 2017 solution will be created. +rem # +rem ########################################################################################### + +rem Define build parameters +set ARCHITECTURE=x64 +set VISUAL_STUDIO=msvc2017 +set GENERATOR=Visual Studio 15 2017 Win64 + +rem ########################################################################################### +rem Concatenate build directory +set BUILDRESULTS=%~dp0\..\BuildResults\%VISUAL_STUDIO%_%ARCHITECTURE% + +rem ########################################################################################### +rem Create build directory and push into it +if not exist %BUILDRESULTS% mkdir %BUILDRESULTS% +pushd %BUILDRESULTS% + +rem ########################################################################################### +rem Run CMake to build the solution +echo running CMake... +cmake.exe -G "%GENERATOR%" ../../Software + +rem ########################################################################################### +popd +pause \ No newline at end of file diff --git a/LSFramework/CMake/CMake.1.6.0/Versions/Win32/DefaultAppVersion.rc b/LSFramework/CMake/CMake.1.6.0/Versions/Win32/DefaultAppVersion.rc new file mode 100644 index 0000000..ced4f31 --- /dev/null +++ b/LSFramework/CMake/CMake.1.6.0/Versions/Win32/DefaultAppVersion.rc @@ -0,0 +1,46 @@ +#include "winres.h" + +#ifndef DEBUG +#define VER_DEBUG 0 +#else +#define VER_DEBUG 1 +#endif + +VS_VERSION_INFO VERSIONINFO + + + +FILEVERSION VER_FILEVERSION +PRODUCTVERSION VER_FILEVERSION +FILEFLAGSMASK 0x3fL +FILEFLAGS VER_DEBUG +FILEOS 0x40004L +FILETYPE 0x0L +FILESUBTYPE 0x0L +BEGIN + BLOCK "StringFileInfo" + BEGIN + BLOCK "040904E4" + BEGIN + VALUE "CompanyName", VER_COMPANYNAME_STR + VALUE "FileDescription", VER_FILEDESCRIPTION_STR + VALUE "FileVersion", VER_FILEVERSION_STR + VALUE "LegalCopyright", VER_LEGALCOPYRIGHT_STR + VALUE "ProductName", VER_PRODUCTNAME_STR + VALUE "ProductVersion", VER_FILEVERSION_STR + END + END + + BLOCK "VarFileInfo" + BEGIN + /* The following line should only be modified for localized versions. */ + /* It consists of any number of WORD,WORD pairs, with each pair */ + /* describing a language,codepage combination supported by the file. */ + /* */ + /* For example, a file might have values "0x409,1252" indicating that it */ + /* supports English language (0x409) in the Windows ANSI codepage (1252). */ + + VALUE "Translation", 0x409, 1252 + + END +END \ No newline at end of file diff --git a/LSFramework/CMake/CMake.1.6.0/Versions/Win32/DefaultDllVersion.rc b/LSFramework/CMake/CMake.1.6.0/Versions/Win32/DefaultDllVersion.rc new file mode 100644 index 0000000..39c302c --- /dev/null +++ b/LSFramework/CMake/CMake.1.6.0/Versions/Win32/DefaultDllVersion.rc @@ -0,0 +1,46 @@ +#include "winres.h" + +#ifndef DEBUG +#define VER_DEBUG 0 +#else +#define VER_DEBUG 1 +#endif + +VS_VERSION_INFO VERSIONINFO + + + +FILEVERSION VER_FILEVERSION +PRODUCTVERSION VER_FILEVERSION +FILEFLAGSMASK 0x3fL +FILEFLAGS VER_DEBUG +FILEOS 0x40004L +FILETYPE 0x1L +FILESUBTYPE 0x0L +BEGIN + BLOCK "StringFileInfo" + BEGIN + BLOCK "040904E4" + BEGIN + VALUE "CompanyName", VER_COMPANYNAME_STR + VALUE "FileDescription", VER_FILEDESCRIPTION_STR + VALUE "FileVersion", VER_FILEVERSION_STR + VALUE "LegalCopyright", VER_LEGALCOPYRIGHT_STR + VALUE "ProductName", VER_PRODUCTNAME_STR + VALUE "ProductVersion", VER_FILEVERSION_STR + END + END + + BLOCK "VarFileInfo" + BEGIN + /* The following line should only be modified for localized versions. */ + /* It consists of any number of WORD,WORD pairs, with each pair */ + /* describing a language,codepage combination supported by the file. */ + /* */ + /* For example, a file might have values "0x409,1252" indicating that it */ + /* supports English language (0x409) in the Windows ANSI codepage (1252). */ + + VALUE "Translation", 0x409, 1252 + + END +END \ No newline at end of file diff --git a/LSFramework/CMake/CMake.1.6.0/Versions/Win32/TSEP.ico b/LSFramework/CMake/CMake.1.6.0/Versions/Win32/TSEP.ico new file mode 100644 index 0000000..bc07432 Binary files /dev/null and b/LSFramework/CMake/CMake.1.6.0/Versions/Win32/TSEP.ico differ diff --git a/LSFramework/LSString.cpp b/LSFramework/LSString.cpp index 7617e68..6a8185b 100644 --- a/LSFramework/LSString.cpp +++ b/LSFramework/LSString.cpp @@ -3,7 +3,7 @@ //----------------------------------------------------------------------------------------------------------------------------- LSString::LSString(const char* pData) - : m_uiLength(StringLength(pData)) + : m_zSize(StringLength(pData)) , m_uiCapacity(StringLength(pData)) { Assign(pData); @@ -11,7 +11,7 @@ LSString::LSString(const char* pData) //----------------------------------------------------------------------------------------------------------------------------- LSString::LSString(const std::string& sRhs) - : m_uiLength(sRhs.length()) + : m_zSize(sRhs.length()) , m_uiCapacity(sRhs.length()) { Assign(sRhs); @@ -20,7 +20,7 @@ LSString::LSString(const std::string& sRhs) //----------------------------------------------------------------------------------------------------------------------------- LSString& LSString::operator=(const LSString& sRhs) { - m_uiLength = sRhs.Length(); + m_zSize = sRhs.Size(); m_uiCapacity = sRhs.Capacity(); Assign(sRhs); return *this; @@ -28,7 +28,7 @@ LSString& LSString::operator=(const LSString& sRhs) //----------------------------------------------------------------------------------------------------------------------------- LSString::LSString(const LSString& sRhs) - : m_uiLength(sRhs.m_uiLength) + : m_zSize(sRhs.m_zSize) , m_uiCapacity(sRhs.m_uiCapacity) { Assign(sRhs); @@ -43,39 +43,38 @@ LSString::~LSString() //----------------------------------------------------------------------------------------------------------------------------- void LSString::Assign(const char* pData) { - m_pData = new char[m_uiLength + 1]; - memset(m_pData, 0, m_uiLength + 1); - if (pData) memcpy(m_pData, pData, m_uiLength); + m_pData = new char[m_zSize + 1]; + memset(m_pData, 0, m_zSize + 1); + if (pData) memcpy(m_pData, pData, m_zSize); } //----------------------------------------------------------------------------------------------------------------------------- -void LSString::Insert(const char* pData, size_t uiPos) +void LSString::Insert(const char* pData, size_t zLength, size_t zPos) { if (!pData) return; - size_t zLength = StringLength(pData); - size_t zNewLength = m_uiLength + zLength; + size_t zNewLength = m_zSize + zLength; while (zNewLength > m_uiCapacity) { IncreaseCapacity(zNewLength); } - char* pLeft = m_pData + uiPos; - char* pRight = m_pData + uiPos + zLength; + char* pLeft = m_pData + zPos; + char* pRight = m_pData + zPos + zLength; - memcpy(pRight, m_pData + uiPos, m_uiLength - uiPos); + memcpy(pRight, m_pData + zPos, m_zSize - zPos); memcpy(pLeft, pData, zLength); - m_uiLength = zNewLength; + m_zSize = zNewLength; } //----------------------------------------------------------------------------------------------------------------------------- bool LSString::RemoveAt(size_t uiPos, size_t uiSize) { - if (uiPos > m_uiLength) return false; + if (uiPos > m_zSize) return false; - m_uiLength = m_uiLength - uiSize; + m_zSize = m_zSize - uiSize; char* pLast = m_pData + uiPos + uiSize; memcpy(m_pData + uiPos, pLast, uiSize); memset(pLast, 0, uiSize); @@ -87,20 +86,19 @@ bool LSString::RemoveAt(size_t uiPos, size_t uiSize) size_t LSString::StringLength(const char* pChar) const { if (!pChar) return 0; - size_t iRet = 0; - while (*pChar != 0x0) + size_t zRet = 0; + while (*(pChar + zRet) != 0x0) { - pChar++; - iRet++; + zRet++; } - return iRet; + return zRet; } //----------------------------------------------------------------------------------------------------------------------------- int LSString::Find(const char * pData, size_t uiOffset, size_t uiLength) const { int iRet = -1; - while (uiOffset + uiLength <= m_uiLength) + while (uiOffset + uiLength <= m_zSize) { iRet = memcmp(m_pData + uiOffset, pData, uiLength); if (iRet == 0) break; @@ -115,7 +113,7 @@ void LSString::IncreaseCapacity(size_t uiNewLength) m_uiCapacity = (m_uiCapacity + uiNewLength) * c_uiCapacityIncreaseFactor; char* pNew = new char[m_uiCapacity + 1]; memset(pNew, 0, m_uiCapacity + 1); - memcpy(pNew, m_pData, m_uiLength); + memcpy(pNew, m_pData, m_zSize); DELETE_ARRAY(m_pData); m_pData = pNew; } \ No newline at end of file diff --git a/LSFramework/LSString.h b/LSFramework/LSString.h index ae2b86e..beb9be6 100644 --- a/LSFramework/LSString.h +++ b/LSFramework/LSString.h @@ -33,7 +33,7 @@ public: //----------------------------------------------------------------------------------------------------------------------------- inline void Append(const LSString& sRhs) { - Insert(sRhs, sRhs.Length()); + Insert(sRhs, sRhs.Size()); } inline void Append(const std::string& sRhs) { @@ -41,21 +41,21 @@ public: } inline void Append(const char* pData) { - Insert(pData, m_uiLength); + Insert(pData, StringLength(pData), m_zSize); } //----------------------------------------------------------------------------------------------------------------------------- - inline void Insert(const LSString& sRhs, size_t uiPos) + inline void Insert(const LSString& sRhs, size_t zPos) { - Insert(sRhs.m_pData, uiPos); + Insert(sRhs.m_pData, sRhs.Size(), zPos); } - inline void Insert(const std::string& sRhs, size_t uiPos) + inline void Insert(const std::string& sRhs, size_t zPos) { - Insert(sRhs.c_str(), uiPos); + Insert(sRhs.c_str(), sRhs.size(), zPos); } //----------------------------------------------------------------------------------------------------------------------------- inline bool Remove(const LSString& sRhs) { - return RemoveAt(Find(sRhs), sRhs.m_uiLength); + return RemoveAt(Find(sRhs), sRhs.m_zSize); } inline bool Remove(const std::string& sRhs) { @@ -69,7 +69,7 @@ public: #pragma region Logic void Assign(const char* pData); - void Insert(const char* pData, size_t uiPos); + void Insert(const char* pData, size_t zLength, size_t zPos); bool RemoveAt(size_t uiPos, size_t uiSize); #pragma endregion @@ -125,9 +125,9 @@ public: return *(m_pData + uiPos); } //----------------------------------------------------------------------------------------------------------------------------- - inline size_t Length() const + inline size_t Size() const { - return m_uiLength; + return m_zSize; } //----------------------------------------------------------------------------------------------------------------------------- inline size_t Capacity() const @@ -150,7 +150,7 @@ private: void IncreaseCapacity(size_t uiNewLength = 0); char* m_pData = nullptr; - size_t m_uiLength = 0; + size_t m_zSize = 0; size_t m_uiCapacity = 0; const float c_uiCapacityIncreaseFactor = 1.5; }; diff --git a/LSFramework/LSVector.h b/LSFramework/LSVector.h index ab8b150..1e00e06 100644 --- a/LSFramework/LSVector.h +++ b/LSFramework/LSVector.h @@ -4,5 +4,14 @@ template class LSVector { + LSVector() + { + + } + + ~LSVector() + { + + } }; diff --git a/LSFramework/VSGenerateProject.cmd b/LSFramework/VSGenerateProject.cmd new file mode 100644 index 0000000..0c0d8f7 --- /dev/null +++ b/LSFramework/VSGenerateProject.cmd @@ -0,0 +1,25 @@ +@echo off +setlocal + +rem define build parameters +set ARCHITECTURE=x64 +set VISUAL_STUDIO=msvc2019 +set GENERATOR=Visual Studio 16 2019 Win64 + +rem concatenate build directory +set BUILDRESULTS=%~dp0\..\BuildResults\%VISUAL_STUDIO%_%ARCHITECTURE% + +rem create build directory and push into it +if not exist %BUILDRESULTS% mkdir %BUILDRESULTS% +if not exist %BUILDRESULTS%\Debug\bin mkdir %BUILDRESULTS%\Debug\bin +if not exist %BUILDRESULTS%\Release\bin mkdir %BUILDRESULTS%\Release\bin + +pushd %BUILDRESULTS% + +rem run CMake to build the solution +echo running CMake... +cmake.exe -G "%GENERATOR%" ../../Software + +popd + +pause \ No newline at end of file diff --git a/LSFramework/main.cpp b/LSFramework/main.cpp index 8e8ae36..2d3cc86 100644 --- a/LSFramework/main.cpp +++ b/LSFramework/main.cpp @@ -3,11 +3,58 @@ #include "LSList.h" #include "Timer.h" -#define RUNS 50U +//#define RUNS 50U +#define RUNS ULLONG_MAX-1 #define PAYLOAD "1873612578869" +size_t StrLen1(const char* pChar) +{ + if (!pChar) return 0; + size_t zRet = 0; + while (*(pChar + zRet) != 0x0) + { + zRet++; + } + return zRet; +} + +size_t StrLen2(const char* pChar) +{ + if (!pChar) return 0; + const char* pFirst = pChar; + while (*pChar != 0x0) + { + pChar++; + } + return pChar - pFirst; +} + int main() { + + char string[] = "Lorem ipsum dolor sit amet, consetetur sadipscing elitr, sed diam nonumy eirmod tempor invidunt ut labore et dolore magna aliquyam erat, sed diam voluptua. At vero eos et accusam et justo duo dolores et ea rebum. Stet clita kasd gubergren, no sea takimata sanctus est Lorem ipsum dolor sit amet. Lorem ipsum dolor sit amet, consetetur sadipscing elitr, sed diam nonumy eirmod tempor invidunt ut labore et dolore magna aliquyam erat, sed diam voluptua. At vero eos et accusam et justo duo dolores et ea rebum. Stet clita kasd gubergren, no sea takimata sanctus est Lorem ipsum dolor sit amet. Lorem ipsum dolor sit amet, consetetur sadipscing elitr, sed diam nonumy eirmod tempor invidunt ut labore et dolore magna aliquyam erat, sed diam voluptua. At vero eos et accusam et justo duo dolores et ea rebum. Stet clita kasd gubergren, no sea takimata sanctus est Lorem ipsum dolor sit amet. Duis autem vel eum iriure dolor in hendrerit in vulputate velit esse molestie consequat, vel illum dolore eu feugiat nulla facilisis at vero eros et accumsan et iusto odio dignissim qui blandit praesent luptatum zzril delenit augue duis dolore te feugait nulla facilisi. Lorem ipsum dolor sit amet, consectetuer adipiscing elit, sed diam nonummy nibh euismod tincidunt ut laoreet dolore magna aliquam erat volutpat. Ut wisi enim ad minim veniam, quis nostrud exerci tation ullamcorper suscipit lobortis nisl ut aliquip ex ea commodo consequat. Duis autem vel eum iriure dolor in hendrerit in vulputate velit esse molestie consequat, vel illum dolore eu feugiat nulla facilisis at vero eros et accumsan et iusto odio dignissim qui blandit praesent luptatum zzril delenit augue duis dolore te feugait nulla facilisi. Nam liber tempor cum soluta nobis eleifend option congue nihil imperdiet doming id quod mazim placerat facer possim assum. Lorem ipsum dolor sit amet, consectetuer adipiscing elit, sed diam nonummy nibh euismod tincidunt ut laoreet dolore magna aliquam erat volutpat. Ut wisi enim ad minim veniam, quis nostrud exerci tation ullamcorper suscipit lobortis nisl ut aliquip ex ea commodo consequat. Duis autem vel eum iriure dolor in hendrerit in vulputate velit esse molestie consequat, vel illum dolore eu feugiat nulla facilisis.At vero eos et accusam et justo duo dolores et ea rebum. Stet clita kasd gubergren, no sea takimata sanctus est Lorem ipsum dolor sit amet. Lorem ipsum dolor sit amet, consetetur sadipscing elitr, sed diam nonumy eirmod tempor invidunt ut labore et dolore magna aliquyam erat, sed diam voluptua. At vero eos et accusam et justo duo dolores et ea rebum. Stet clita kasd gubergren, no sea takimata sanctus est Lorem ipsum dolor sit amet. Lorem ipsum dolor sit amet, consetetur sadipscing elitr, At accusam aliquyam diam diam dolore dolores duo eirmod eos erat, et nonumy sed tempor et et invidunt justo labore Stet clita ea et gubergren, kasd magna no rebum. sanctus sea sed takimata ut vero voluptua. est Lorem ipsum dolor sit amet. Lorem ipsum dolor sit amet, consetetur sadipscing elitr, sed diam nonumy eirmod tempor invidunt ut labore et dolore magna aliquyam erat. Consetetur sadipscing elitr, sed diam nonumy eirmod tempor invidunt ut labore et dolore magna aliquyam erat, sed diam voluptua. At vero eos et accusam et justo duo dolores et ea rebum. Stet clita kasd gubergren, no sea takimata sanctus est Lorem ipsum dolor sit amet. Lorem ipsum dolor sit amet, consetetur sadipscing elitr, sed diam nonumy eirmod tempor invidunt ut labore et dolore magna aliquyam erat, sed diam voluptua. At vero eos et accusam et justo duo dolores et ea rebum. Stet clita kasd gubergren, no sea takimata sanctus est Lorem ipsum dolor sit amet. Lorem ipsum dolor sit amet, consetetur sadipscing elitr, sed diam nonumy eirmod tempor invidunt ut labore et dolore magna aliquyam erat, sed diam voluptua. At vero eos et accusam et justo duo dolores et ea rebum. Stet clita kasd gubergren, no sea takimata sanctus. Lorem ipsum dolor sit amet, consetetur sadipscing elitr, sed diam nonumy eirmod tempor invidunt ut labore et dolore magna aliquyam erat, sed diam voluptua. At vero eos et accusam et justo duo dolores et ea rebum. Stet clita kasd gubergren, no sea takimata sanctus est Lorem ipsum dolor sit amet. Lorem ipsum dolor sit amet, consetetur sadipscing elitr, sed diam nonumy eirmod tempor invidunt ut labore et dolore magna aliquyam erat, sed diam voluptua. At vero eos et accusam et justo duo dolores et ea rebum. Stet clita kasd gubergren, no sea takimata sanctus est Lorem ipsum dolor sit amet. Lorem ipsum dolor sit amet, consetetur sadipscing elitr, sed diam nonumy eirmod tempor invidunt ut labore et dolore magna aliquyam erat, sed diam voluptua. At vero eos et accusam et justo duo dolores et ea rebum. Stet clita kasd gubergren, no sea takimata sanctus est Lorem ipsum dolor sit amet.Duis autem vel eum iriure dolor in hendrerit in vulputate velit esse molestie consequat, vel illum dolore eu feugiat nulla facilisis at vero eros et accumsan et iusto odio dignissim qui blandit praesent luptatum zzril delenit augue duis dolore te feugait nulla facilisi. Lorem ipsum dolor sit amet, consectetuer adipiscing elit, sed diam nonummy nibh euismod tincidunt ut laoreet dolore magna aliquam erat volutpat. Ut wisi enim ad minim veniam, quis nostrud exerci tation ullamcorper suscipit lobortis nisl ut aliquip ex ea commodo consequat. Duis autem vel eum iriure dolor in hendrerit in vulputate velit esse molestie consequat, vel illum dolore eu feugiat nulla facilisis at vero eros et accumsan et iusto odio dignissim qui blandit praesent luptatum zzril delenit augue duis dolore te feugait nulla facilisi. Nam liber tempor cum soluta nobis eleifend option congue nihil imperdiet doming id quod mazim placerat facer possim assum. Lorem ipsum dolor sit amet, consectetuer adipiscing elit, sed diam nonummy nibh euismod tincidunt ut laoreet dolore magna aliquam erat volutpat. Ut wisi enim ad minim veniam, quis nostrud exerci tation ullamcorper suscipit lobortis nisl ut aliquip ex ea commodo consequat. Duis autem vel eum iriure dolor in hendrerit in vulputate velit esse molestie consequat, vel illum dolore eu feugiat nulla facilisis. At vero eos et accusam et justo duo dolores et ea rebum. Stet clita kasd gubergren, no sea takimata sanctus est Lorem ipsum dolor sit amet. Lorem ipsum dolor sit amet, consetetur sadipscing elitr, sed diam nonumy eirmod tempor invidunt ut labore et dolore magna aliquyam erat, sed diam voluptua. At vero eos et accusam et justo duo dolores et ea rebum. Stet clita kasd gubergren, no sea takimata sanctus est Lorem ipsum dolor sit amet. Lorem ipsum dolor sit amet, consetetur sadipscing elitr, At accusam aliquyam diam diam dolore dolores duo eirmod eos erat, et nonumy sed tempor et et invidunt justo labore Stet clita ea et gubergren, kasd magna no rebum. sanctus sea sed takimata ut vero voluptua. est Lorem ipsum dolor sit amet. Lorem ipsum dolor sit amet, consetetur sadipscing elitr, sed diam nonumy eirmod tempor invidunt ut labore et dolore magna aliquyam erat. Consetetur sadipscing elitr, sed diam nonumy eirmod tempor invidunt ut labore et dolore magna aliquyam erat, sed diam voluptua. At vero eos et accusam et justo duo dolores et ea rebum. Stet clita kasd gubergren, no sea takimata sanctus est Lorem ipsum dolor sit amet. Lorem ipsum dolor sit amet, consetetur sadipscing elitr, sed diam nonumy eirmod tempor invidunt ut labore et dolore magna aliquyam erat, sed diam voluptua. At vero eos et accusam et justo duo dolores et ea rebum. Stet clita kasd gubergren, no sea takimata sanctus est Lorem ipsum dolor sit amet. Lorem ipsum dolor sit amet, consetetur sadipscing elitr, sed diam nonumy eirmod tempor invidunt ut labore et dolore magna aliquyam erat, sed diam voluptua. At vero eos et accusam et justo duo dolores et ea rebum. Stet clita kasd gubergren, no sea takimata sanctus. Lorem ipsum dolor sit amet, consetetur sadipscing elitr, sed diam nonumy eirmod tempor invidunt ut labore et dolore magna aliquyam erat, sed diam voluptua. At vero eos et accusam et justo duo dolores et ea rebum. Stet clita kasd gubergren, no sea takimata sanctus est Lorem ipsum dolor sit amet. Lorem ipsum dolor sit amet, consetetur sadipscing elitr, sed diam nonumy eirmod tempor invidunt ut labore et dolore magna aliquyam erat, sed diam voluptua. At vero eos et accusam et justo duo dolores et ea rebum. Stet clita kasd gubergren, no sea takimata sanctus est Lorem ipsum dolor sit amet. Lorem ipsum dolor sit amet, consetetur sadipscing elitr, sed diam nonumy eirmod tempor invidunt ut labore et dolore magna aliquyam erat, sed diam voluptua. At vero eos et accusam et justo duo dolores et ea rebum. Stet clita kasd gubergren, no sea takimata sanctus est Lorem ipsum dolor sit ametDuis autem vel eum iriure dolor in hendrerit in vulputate velit esse molestie consequat, vel illum dolore eu feugiat nulla facilisis at vero eros et accumsan et iusto odio dignissim qui blandit praesent luptatum zzril delenit augue duis dolore te feugait nulla facilisi. Lorem ipsum dolor sit amet, consectetuer adipiscing elit, sed diam nonummy nibh euismod tincidunt ut laoreet dolore magna aliquam erat volutpat. Ut wisi enim ad minim veniam, quis nostrud exerci tation ullamcorper suscipit lobortis nisl ut aliquip ex ea commodo consequat. Duis autem vel eum iriure dolor in hendrerit in vulputate velit esse molestie consequat, vel illum dolore eu feugiat nulla facilisis at vero eros et accumsan et iusto odio dignissim qui blandit praesent luptatum zzril delenit augue duis dolore te feugait nulla facilisi. Nam liber tempor cum soluta nobis eleifend option congue nihil imperdiet doming id quod mazim placerat facer possim assum. Lorem ipsum dolor sit amet, consectetuer adipiscing elit, sed diam nonummy nibh euismod tincidunt ut laoreet dolore magna aliquam erat volutpat. Ut wisi enim ad minim veniam, quis nostrud exerci tation ullamcorper suscipit lobortis nisl ut aliquip ex ea commodo consequat. Duis au"; + + size_t i = 0; + { + Timer tWhole("String1 Func1 "); + for (size_t zRun = 0; zRun <= RUNS; zRun++) + { + i = StrLen1(string); + } + printf("Ergebniss: %d\n", (int) i); + } + + { + Timer tWhole("String1 Func2 "); + for (size_t zRun = 0; zRun <= RUNS; zRun++) + { + i = StrLen2(string); + } + printf("Ergebniss: %d\n", (int) i); + } + + return i; + printf("---LSString---\n"); LSString s3; const LSString s1 = "187"; @@ -16,10 +63,6 @@ int main() { s3 = s1 + s2; } - - - return 0; - // - STRING