Kaynağa Gözat

* Updated project structure

master
bergmann 6 yıl önce
ebeveyn
işleme
93604c2e16
7 değiştirilmiş dosya ile 54 ekleme ve 35 silme
  1. +10
    -4
      CMakeLists.txt
  2. +28
    -0
      cmake/cppcore-const.cmake
  3. +5
    -0
      cmake/cppcore-options.cmake
  4. +3
    -21
      cmake/cppcore-var.cmake
  5. +1
    -1
      cmake/modules
  6. +7
    -4
      src/CMakeLists.txt
  7. +0
    -5
      test/CMakeLists.txt

+ 10
- 4
CMakeLists.txt Dosyayı Görüntüle

@@ -20,19 +20,25 @@ EndIf ( )

# Project #########################################################################################

Include ( CTest )
Include ( GNUInstallDirs )
Include ( ${CMAKE_CURRENT_SOURCE_DIR}/cmake/cppcore-options.cmake )
Include ( ${CMAKE_CURRENT_SOURCE_DIR}/cmake/cppcore-const.cmake )
Include ( ${CMAKE_CURRENT_SOURCE_DIR}/cmake/cppcore-var.cmake )
Project ( cppcore
DESCRIPTION "A simple library"
Project ( ${CPPCORE_PROJECT_NAME}
DESCRIPTION "${CPPCORE_PROJECT_DESCRIPTION}"
VERSION "${CPPCORE_VERSION}" )
Include ( CTest )
Include ( GNUInstallDirs )

# Subdirectories
Add_SubDirectory ( ${CMAKE_CURRENT_SOURCE_DIR}/src )
Add_SubDirectory ( ${CMAKE_CURRENT_SOURCE_DIR}/test )

# Install
If ( NOT CPPCORE_HAS_EXPORT
OR NOT CPPCORE_INSTALL_PACKAGE )
Return ( )
EndIf ( )

Include ( CMakePackageConfigHelpers )
Write_Basic_Package_Version_File ( "${CMAKE_CURRENT_BINARY_DIR}/cmake/cppcore-config-version.cmake"
VERSION ${CPPCORE_VERSION}


+ 28
- 0
cmake/cppcore-const.cmake Dosyayı Görüntüle

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

# Version
Set ( CPPCORE_VERSION_MAJOR 1 )
Set ( CPPCORE_VERSION_MINOR 0 )
Set ( CPPCORE_VERSION_PATCH 0 )
Set ( CPPCORE_VERSION_BUILD 0 )
Set ( CPPCORE_VERSION_HASH "" )
Set ( CPPCORE_VERSION_BEHIND 0 )
Set ( CPPCORE_VERSION_DIRTY 0 )

# Names
Set ( CPPCORE_PROJECT_NAME "cppcore" )
Set ( CPPCORE_PROJECT_DESCRIPTION "C++ core library" )

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

# Install directories
Set ( CPPCORE_INSTALL_DIR_INCLUDE "${CMAKE_INSTALL_INCLUDEDIR}/${CPPCORE_NAME}" )
Set ( CPPCORE_INSTALL_DIR_LIB "${CMAKE_INSTALL_LIBDIR}" )
Set ( CPPCORE_INSTALL_DIR_SHARE "${CMAKE_INSTALL_DATAROOTDIR}/${CPPCORE_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 )

+ 5
- 0
cmake/cppcore-options.cmake Dosyayı Görüntüle

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

Option ( CPPCORE_INSTALL_HEADER
"Install headers of cppcore."
ON )
Option ( CPPCORE_INSTALL_PACKAGE
"Install the cmake package of cppcore."
ON )
Option ( CPPCORE_USE_GIT_VERSION
"Read the git tags to get the version of cppcore"
ON )

+ 3
- 21
cmake/cppcore-var.cmake Dosyayı Görüntüle

@@ -1,11 +1,4 @@
# Version
Set ( CPPCORE_VERSION_MAJOR 1 )
Set ( CPPCORE_VERSION_MINOR 0 )
Set ( CPPCORE_VERSION_PATCH 0 )
Set ( CPPCORE_VERSION_BUILD 0 )
Set ( CPPCORE_VERSION_HASH "" )
Set ( CPPCORE_VERSION_BEHIND 0 )
Set ( CPPCORE_VERSION_DIRTY 0 )
# This file contains generated variables that are needed for the project

# Git Version
If ( CPPCORE_USE_GIT_VERSION )
@@ -26,19 +19,8 @@ EndIf ( )
Set ( CPPCORE_VERSION_SHORT "${CPPCORE_VERSION_MAJOR}.${CPPCORE_VERSION_MINOR}" )
Set ( CPPCORE_VERSION "${CPPCORE_VERSION_SHORT}.${CPPCORE_VERSION_PATCH}.${CPPCORE_VERSION_BUILD}" )
Set ( CPPCORE_VERSION_COMPLETE "${CPPCORE_VERSION}" )
Set ( CPPCORE_NAME "cppcore-${CPPCORE_VERSION_SHORT}" )
Set ( CPPCORE_OUTPUTNAME "cppcore" )
Set ( CPPCORE_NAME "${CPPCORE_PROJECT_NAME}-${CPPCORE_VERSION_SHORT}" )
Set ( CPPCORE_OUTPUTNAME "${CPPCORE_PROJECT_NAME}" )
If ( CPPCORE_VERSION_BEHIND )
Set ( CPPCORE_VERSION_COMPLETE "${CPPCORE_VERSION_COMPLETE}+${CPPCORE_VERSION_BEHIND}" )
EndIf ( )

# Install directories
Set ( CPPCORE_INSTALL_DIR_INCLUDE "include/${CPPCORE_NAME}" )
Set ( CPPCORE_INSTALL_DIR_LIB "lib" )
Set ( CPPCORE_INSTALL_DIR_SHARE "share/${CPPCORE_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 )

+ 1
- 1
cmake/modules

@@ -1 +1 @@
Subproject commit 4953cd4cc849afdfa02a6057b5a2011fb62e91a6
Subproject commit ebbae4fbb42d671331b4c6e9d1d142f41dcacc1b

+ 7
- 4
src/CMakeLists.txt Dosyayı Görüntüle

@@ -15,13 +15,16 @@ Target_Include_Directories ( cppcore

# Install #########################################################################################

Set ( CPPCORE_HAS_EXPORT False PARENT_SCOPE )

# Header
If ( CPPCORE_INSTALL_HEADER )
Set ( CPPCORE_HAS_EXPORT True PARENT_SCOPE )
Install ( FILES ${CPPCORE_INCLUDE_DIR}/cppcore.h
DESTINATION ${CPPCORE_INSTALL_DIR_INCLUDE} )
DESTINATION ${CPPCORE_INSTALL_DIR_INCLUDE} )
Install ( DIRECTORY ${CPPCORE_INCLUDE_DIR}/cppcore
DESTINATION ${CPPCORE_INSTALL_DIR_INCLUDE} )
DESTINATION ${CPPCORE_INSTALL_DIR_INCLUDE} )
Install ( TARGETS cppcore
EXPORT cppcore
DESTINATION ${CPPCORE_INSTALL_DIR_INCLUDE} )
EXPORT cppcore
DESTINATION ${CPPCORE_INSTALL_DIR_INCLUDE} )
EndIf ( )

+ 0
- 5
test/CMakeLists.txt Dosyayı Görüntüle

@@ -43,11 +43,6 @@ ForEach ( FILE IN LISTS CPPCORE_TEST_SOURCE_FILES )
Pedantic_Apply_Flags_Target ( ${TEST_NAME} ALL )
EndIf ( )

# optimization
If ( HAS_COTIRE )
Cotire ( ${TEST_NAME} )
EndIf ( )

# test
If ( HAS_CMAKE_TESTS )
Add_CMake_Test ( NAME ${TEST_NAME} TARGET ${TEST_NAME} )


Yükleniyor…
İptal
Kaydet