created project with cmake

This commit is contained in:
Luis Stanglmeier 2022-06-23 13:44:39 +02:00
parent c4b3d8ac5f
commit 5f6abf300e
54 changed files with 412 additions and 310 deletions

View file

@ -0,0 +1,17 @@
<?xml version="1.0"?>
<package>
<metadata>
<id>@TSEP_PRODUCT_NAME@</id>
<version>@TSEP_NEXUS_VERSION@</version>
<authors>$ENV{USERNAME}</authors>
<owners>TSEP</owners>
<description>@TSEP_PRODUCT_DESCRIPTION@</description>
<releaseNotes>internal</releaseNotes>
<copyright>Copyright 2021</copyright>
<tags>Application</tags>
</metadata>
<files>
<file src="*/**" target="/" />
<file src="*" target="/" />
</files>
</package>

View file

@ -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()
#

View file

@ -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
$<BUILD_INTERFACE:${CMAKE_CURRENT_LIST_DIR}/src>
$<INSTALL_INTERFACE:inc>
#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()
#

View file

@ -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()
#

View file

@ -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
$<BUILD_INTERFACE:${CMAKE_CURRENT_LIST_DIR}/src>
$<INSTALL_INTERFACE:inc>
#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)
#

View file

@ -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)

View file

@ -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()
#

View file

@ -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()
#

View file

@ -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)

View file

@ -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

View file

@ -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:
// "<project>_EXPORTS" preprocessor define is defined by CMake when compiling <project>
/*------------------------------------------------------------------------------
// 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__

View file

@ -0,0 +1,4 @@
<?xml version="1.0" encoding="utf-8"?>
<!DOCTYPE TS>
<TS version="2.1" language="de_DE">
</TS>

View file

@ -0,0 +1,5 @@
<RCC>
<qresource prefix="@PROJECT_NAME@.Translations">
@TRANSLATION_RESOURCE_STRING@
</qresource>
</RCC>

View file

@ -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