Browse Source

* Splittet cmake include files into more precise names

master
bergmann 4 years ago
parent
commit
70dad7dd2b
9 changed files with 72 additions and 51 deletions
  1. +3
    -2
      projects/helloworld/CMakeLists.txt
  2. +26
    -0
      projects/helloworld/cmake/helloworld-const.cmake
  3. +2
    -0
      projects/helloworld/cmake/helloworld-options.cmake
  4. +3
    -21
      projects/helloworld/cmake/helloworld-var.cmake
  5. +3
    -2
      projects/libhelloworld/CMakeLists.txt
  6. +2
    -3
      projects/libhelloworld/cmake/libhelloworld-config.cmake
  7. +28
    -0
      projects/libhelloworld/cmake/libhelloworld-const.cmake
  8. +2
    -0
      projects/libhelloworld/cmake/libhelloworld-options.cmake
  9. +3
    -23
      projects/libhelloworld/cmake/libhelloworld-var.cmake

+ 3
- 2
projects/helloworld/CMakeLists.txt View File

@@ -21,9 +21,10 @@ EndIf ( )
# Project #########################################################################################

Include ( ${CMAKE_CURRENT_SOURCE_DIR}/cmake/helloworld-options.cmake )
Include ( ${CMAKE_CURRENT_SOURCE_DIR}/cmake/helloworld-const.cmake )
Include ( ${CMAKE_CURRENT_SOURCE_DIR}/cmake/helloworld-var.cmake )
Project ( helloworld
DESCRIPTION "A simple library"
Project ( ${HELLOWORLD_PROJECT_NAME}
DESCRIPTION "${HELLOWORLD_PROJECT_DESCRIPTION}"
VERSION "${HELLOWORLD_VERSION}" )
Include ( CTest )
Include ( GNUInstallDirs )


+ 26
- 0
projects/helloworld/cmake/helloworld-const.cmake View File

@@ -0,0 +1,26 @@
# This file contains constant variables that are fixed to this project

# Version
Set ( HELLOWORLD_VERSION_MAJOR 1 )
Set ( HELLOWORLD_VERSION_MINOR 0 )
Set ( HELLOWORLD_VERSION_PATCH 0 )
Set ( HELLOWORLD_VERSION_BUILD 0 )
Set ( HELLOWORLD_VERSION_HASH "" )
Set ( HELLOWORLD_VERSION_BEHIND 0 )
Set ( HELLOWORLD_VERSION_DIRTY 0 )

# Names
Set ( HELLOWORLD_PROJECT_NAME "helloworld" )
Set ( HELLOWORLD_PROJECT_DESCRIPTION "A simple hello world project" )

# Include generated variables for further usage
Include ( ${CMAKE_CURRENT_LIST_DIR}/helloworld-var.cmake )

# Install directories
Set ( HELLOWORLD_INSTALL_DIR_BIN "bin" )

# C Standard
Set ( CMAKE_C_STANDARD 11 )
Set ( CMAKE_CXX_STANDARD 17 )
Set ( CMAKE_C_STANDARD_REQUIRED ON )
Set ( CMAKE_CXX_STANDARD_REQUIRED ON )

+ 2
- 0
projects/helloworld/cmake/helloworld-options.cmake View File

@@ -1,3 +1,5 @@
# This file contains options that can be passed to the cmake command

Option ( HELLOWORLD_INSTALL_DEBUG
"Install the stripped debug informations of helloworld."
OFF )


+ 3
- 21
projects/helloworld/cmake/helloworld-var.cmake View File

@@ -1,11 +1,4 @@
# Version
Set ( HELLOWORLD_VERSION_MAJOR 1 )
Set ( HELLOWORLD_VERSION_MINOR 0 )
Set ( HELLOWORLD_VERSION_PATCH 0 )
Set ( HELLOWORLD_VERSION_BUILD 0 )
Set ( HELLOWORLD_VERSION_HASH "" )
Set ( HELLOWORLD_VERSION_BEHIND 0 )
Set ( HELLOWORLD_VERSION_DIRTY 0 )
# This file contains generated variables that are needed for the project

# Git Version
If ( HELLOWORLD_USE_GIT_VERSION )
@@ -26,19 +19,8 @@ EndIf ( )
Set ( HELLOWORLD_VERSION_SHORT "${HELLOWORLD_VERSION_MAJOR}.${HELLOWORLD_VERSION_MINOR}" )
Set ( HELLOWORLD_VERSION "${HELLOWORLD_VERSION_SHORT}.${HELLOWORLD_VERSION_PATCH}.${HELLOWORLD_VERSION_BUILD}" )
Set ( HELLOWORLD_VERSION_COMPLETE "${HELLOWORLD_VERSION}" )
Set ( HELLOWORLD_NAME "helloworld-${HELLOWORLD_VERSION_SHORT}" )
Set ( HELLOWORLD_OUTPUTNAME "helloworld" )
Set ( HELLOWORLD_NAME "${HELLOWORLD_PROJECT_NAME}-${HELLOWORLD_VERSION_SHORT}" )
Set ( HELLOWORLD_OUTPUTNAME "${HELLOWORLD_PROJECT_NAME}" )
If ( HELLOWORLD_VERSION_BEHIND )
Set ( HELLOWORLD_VERSION_COMPLETE "${HELLOWORLD_VERSION_COMPLETE}+${HELLOWORLD_VERSION_BEHIND}" )
EndIf ( )

Message ( FATAL_ERROR "Please configure the output name of protject (HELLOWORLD_NAME and HELLOWORLD_OUTPUTNAME)!" )

# Install directories
Set ( HELLOWORLD_INSTALL_DIR_BIN "bin" )

# C Standard
Set ( CMAKE_C_STANDARD 11 )
Set ( CMAKE_CXX_STANDARD 17 )
Set ( CMAKE_C_STANDARD_REQUIRED ON )
Set ( CMAKE_CXX_STANDARD_REQUIRED ON )

+ 3
- 2
projects/libhelloworld/CMakeLists.txt View File

@@ -21,9 +21,10 @@ EndIf ( )
# Project #########################################################################################

Include ( ${CMAKE_CURRENT_SOURCE_DIR}/cmake/libhelloworld-options.cmake )
Include ( ${CMAKE_CURRENT_SOURCE_DIR}/cmake/libhelloworld-const.cmake )
Include ( ${CMAKE_CURRENT_SOURCE_DIR}/cmake/libhelloworld-var.cmake )
Project ( libhelloworld
DESCRIPTION "A simple library"
Project ( ${LIBHELLOWORLD_PROJECT_NAME}
DESCRIPTION "${LIBHELLOWORLD_PROJECT_DESCRIPTION}"
VERSION "${LIBHELLOWORLD_VERSION}" )
Include ( CTest )
Include ( GNUInstallDirs )


+ 2
- 3
projects/libhelloworld/cmake/libhelloworld-config.cmake View File

@@ -1,8 +1,7 @@
# libhelloworld-config.cmake - package configuration file

Message ( FATAL_ERROR "Please configure the dependencies of this package!" )
# Include ( CMakeFindDependencyMacro )
# Find_Dependency ( <dependency> )
# Include ( CMakeFindDependencyMacro )
# Find_Dependency ( <dependency> )

Include ( FindPackageHandleStandardArgs )
Set ( ${CMAKE_FIND_PACKAGE_NAME}_CONFIG ${CMAKE_CURRENT_LIST_FILE} )


+ 28
- 0
projects/libhelloworld/cmake/libhelloworld-const.cmake View File

@@ -0,0 +1,28 @@
# This file contains constant variables that are fixed to this project

# Version
Set ( LIBHELLOWORLD_VERSION_MAJOR 1 )
Set ( LIBHELLOWORLD_VERSION_MINOR 0 )
Set ( LIBHELLOWORLD_VERSION_PATCH 0 )
Set ( LIBHELLOWORLD_VERSION_BUILD 0 )
Set ( LIBHELLOWORLD_VERSION_HASH "" )
Set ( LIBHELLOWORLD_VERSION_BEHIND 0 )
Set ( LIBHELLOWORLD_VERSION_DIRTY 0 )

# Names
Set ( LIBHELLOWORLD_PROJECT_NAME "libhelloworld" )
Set ( LIBHELLOWORLD_PROJECT_DESCRIPTION "A simple hello world library" )

# Include generated variables for further usage
Include ( ${CMAKE_CURRENT_LIST_DIR}/libhelloworld-var.cmake )

# Install directories
Set ( LIBHELLOWORLD_INSTALL_DIR_INCLUDE "include/${LIBHELLOWORLD_NAME}" )
Set ( LIBHELLOWORLD_INSTALL_DIR_LIB "lib" )
Set ( LIBHELLOWORLD_INSTALL_DIR_SHARE "share/${LIBHELLOWORLD_NAME}" )

# C Standard
Set ( CMAKE_C_STANDARD 11 )
Set ( CMAKE_CXX_STANDARD 17 )
Set ( CMAKE_C_STANDARD_REQUIRED ON )
Set ( CMAKE_CXX_STANDARD_REQUIRED ON )

+ 2
- 0
projects/libhelloworld/cmake/libhelloworld-options.cmake View File

@@ -1,3 +1,5 @@
# This file contains options that can be passed to the cmake command

Option ( LIBHELLOWORLD_INSTALL_HEADER
"Install headers of libhelloworld."
ON )


+ 3
- 23
projects/libhelloworld/cmake/libhelloworld-var.cmake View File

@@ -1,11 +1,4 @@
# Version
Set ( LIBHELLOWORLD_VERSION_MAJOR 1 )
Set ( LIBHELLOWORLD_VERSION_MINOR 0 )
Set ( LIBHELLOWORLD_VERSION_PATCH 0 )
Set ( LIBHELLOWORLD_VERSION_BUILD 0 )
Set ( LIBHELLOWORLD_VERSION_HASH "" )
Set ( LIBHELLOWORLD_VERSION_BEHIND 0 )
Set ( LIBHELLOWORLD_VERSION_DIRTY 0 )
# This file contains generated variables that are needed for the project

# Git Version
If ( LIBHELLOWORLD_USE_GIT_VERSION )
@@ -26,21 +19,8 @@ EndIf ( )
Set ( LIBHELLOWORLD_VERSION_SHORT "${LIBHELLOWORLD_VERSION_MAJOR}.${LIBHELLOWORLD_VERSION_MINOR}" )
Set ( LIBHELLOWORLD_VERSION "${LIBHELLOWORLD_VERSION_SHORT}.${LIBHELLOWORLD_VERSION_PATCH}.${LIBHELLOWORLD_VERSION_BUILD}" )
Set ( LIBHELLOWORLD_VERSION_COMPLETE "${LIBHELLOWORLD_VERSION}" )
Set ( LIBHELLOWORLD_NAME "helloworld-${LIBHELLOWORLD_VERSION_SHORT}" )
Set ( LIBHELLOWORLD_OUTPUTNAME "helloworld" )
Set ( LIBHELLOWORLD_NAME "${LIBHELLOWORLD_PROJECT_NAME}-${LIBHELLOWORLD_VERSION_SHORT}" )
Set ( LIBHELLOWORLD_OUTPUTNAME "${LIBHELLOWORLD_PROJECT_NAME}" )
If ( LIBHELLOWORLD_VERSION_BEHIND )
Set ( LIBHELLOWORLD_VERSION_COMPLETE "${LIBHELLOWORLD_VERSION_COMPLETE}+${LIBHELLOWORLD_VERSION_BEHIND}" )
EndIf ( )

Message ( FATAL_ERROR "Please configure the output name of protject (LIBHELLOWORLD_NAME and LIBHELLOWORLD_OUTPUTNAME)!" )

# Install directories
Set ( LIBHELLOWORLD_INSTALL_DIR_INCLUDE "include/${LIBHELLOWORLD_NAME}" )
Set ( LIBHELLOWORLD_INSTALL_DIR_LIB "lib" )
Set ( LIBHELLOWORLD_INSTALL_DIR_SHARE "share/${LIBHELLOWORLD_NAME}" )

# C Standard
Set ( CMAKE_C_STANDARD 11 )
Set ( CMAKE_CXX_STANDARD 17 )
Set ( CMAKE_C_STANDARD_REQUIRED ON )
Set ( CMAKE_CXX_STANDARD_REQUIRED ON )

Loading…
Cancel
Save