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