ソースを参照

* Updated project structure

master
bergmann 6年前
コミット
f2462cb89b
7個のファイルの変更51行の追加31行の削除
  1. +10
    -4
      CMakeLists.txt
  2. +28
    -0
      cmake/cppmicrohttpd-const.cmake
  3. +5
    -0
      cmake/cppmicrohttpd-options.cmake
  4. +3
    -21
      cmake/cppmicrohttpd-var.cmake
  5. +1
    -1
      cmake/modules
  6. +4
    -0
      src/CMakeLists.txt
  7. +0
    -5
      test/CMakeLists.txt

+ 10
- 4
CMakeLists.txt ファイルの表示

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


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


Include ( CTest )
Include ( GNUInstallDirs )
Include ( ${CMAKE_CURRENT_SOURCE_DIR}/cmake/cppmicrohttpd-options.cmake ) Include ( ${CMAKE_CURRENT_SOURCE_DIR}/cmake/cppmicrohttpd-options.cmake )
Include ( ${CMAKE_CURRENT_SOURCE_DIR}/cmake/cppmicrohttpd-const.cmake )
Include ( ${CMAKE_CURRENT_SOURCE_DIR}/cmake/cppmicrohttpd-var.cmake ) Include ( ${CMAKE_CURRENT_SOURCE_DIR}/cmake/cppmicrohttpd-var.cmake )
Project ( cppmicrohttpd
DESCRIPTION "A simple library"
Project ( ${CPPMICROHTTPD_PROJECT_NAME}
DESCRIPTION "${CPPMICROHTTPD_PROJECT_DESCRIPTION}"
VERSION "${CPPMICROHTTPD_VERSION}" ) VERSION "${CPPMICROHTTPD_VERSION}" )
Include ( CTest )
Include ( GNUInstallDirs )


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


# Install # Install
If ( NOT CPPMICROHTTPD_HAS_EXPORT
OR NOT CPPMICROHTTPD_INSTALL_PACKAGE )
Return ( )
EndIf ( )

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


+ 28
- 0
cmake/cppmicrohttpd-const.cmake ファイルの表示

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

# Version
Set ( CPPMICROHTTPD_VERSION_MAJOR 1 )
Set ( CPPMICROHTTPD_VERSION_MINOR 0 )
Set ( CPPMICROHTTPD_VERSION_PATCH 0 )
Set ( CPPMICROHTTPD_VERSION_BUILD 0 )
Set ( CPPMICROHTTPD_VERSION_HASH "" )
Set ( CPPMICROHTTPD_VERSION_BEHIND 0 )
Set ( CPPMICROHTTPD_VERSION_DIRTY 0 )

# Names
Set ( CPPMICROHTTPD_PROJECT_NAME "cppmicrohttpd" )
Set ( CPPMICROHTTPD_PROJECT_DESCRIPTION "A simple hello world library" )

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

# Install directories
Set ( CPPMICROHTTPD_INSTALL_DIR_INCLUDE "${CMAKE_INSTALL_INCLUDEDIR}/${CPPMICROHTTPD_NAME}" )
Set ( CPPMICROHTTPD_INSTALL_DIR_LIB "${CMAKE_INSTALL_LIBDIR}" )
Set ( CPPMICROHTTPD_INSTALL_DIR_SHARE "${CMAKE_INSTALL_DATAROOTDIR}/${CPPMICROHTTPD_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/cppmicrohttpd-options.cmake ファイルの表示

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

Option ( CPPMICROHTTPD_INSTALL_HEADER Option ( CPPMICROHTTPD_INSTALL_HEADER
"Install headers of cppmicrohttpd." "Install headers of cppmicrohttpd."
ON ) ON )
@@ -10,6 +12,9 @@ Option ( CPPMICROHTTPD_INSTALL_SHARED
Option ( CPPMICROHTTPD_INSTALL_DEBUG Option ( CPPMICROHTTPD_INSTALL_DEBUG
"Install the stripped debug informations of cppmicrohttpd." "Install the stripped debug informations of cppmicrohttpd."
OFF ) OFF )
Option ( CPPMICROHTTPD_INSTALL_PACKAGE
"Install the cmake package of cppmicrohttpd."
ON )
Option ( CPPMICROHTTPD_NO_STRIP Option ( CPPMICROHTTPD_NO_STRIP
"Do not strip debug symbols from binary." "Do not strip debug symbols from binary."
OFF ) OFF )


+ 3
- 21
cmake/cppmicrohttpd-var.cmake ファイルの表示

@@ -1,11 +1,4 @@
# Version
Set ( CPPMICROHTTPD_VERSION_MAJOR 1 )
Set ( CPPMICROHTTPD_VERSION_MINOR 0 )
Set ( CPPMICROHTTPD_VERSION_PATCH 0 )
Set ( CPPMICROHTTPD_VERSION_BUILD 0 )
Set ( CPPMICROHTTPD_VERSION_HASH "" )
Set ( CPPMICROHTTPD_VERSION_BEHIND 0 )
Set ( CPPMICROHTTPD_VERSION_DIRTY 0 )
# This file contains generated variables that are needed for the project


# Git Version # Git Version
If ( CPPMICROHTTPD_USE_GIT_VERSION ) If ( CPPMICROHTTPD_USE_GIT_VERSION )
@@ -26,19 +19,8 @@ EndIf ( )
Set ( CPPMICROHTTPD_VERSION_SHORT "${CPPMICROHTTPD_VERSION_MAJOR}.${CPPMICROHTTPD_VERSION_MINOR}" ) Set ( CPPMICROHTTPD_VERSION_SHORT "${CPPMICROHTTPD_VERSION_MAJOR}.${CPPMICROHTTPD_VERSION_MINOR}" )
Set ( CPPMICROHTTPD_VERSION "${CPPMICROHTTPD_VERSION_SHORT}.${CPPMICROHTTPD_VERSION_PATCH}.${CPPMICROHTTPD_VERSION_BUILD}" ) Set ( CPPMICROHTTPD_VERSION "${CPPMICROHTTPD_VERSION_SHORT}.${CPPMICROHTTPD_VERSION_PATCH}.${CPPMICROHTTPD_VERSION_BUILD}" )
Set ( CPPMICROHTTPD_VERSION_COMPLETE "${CPPMICROHTTPD_VERSION}" ) Set ( CPPMICROHTTPD_VERSION_COMPLETE "${CPPMICROHTTPD_VERSION}" )
Set ( CPPMICROHTTPD_NAME "cppmicrohttpd-${CPPMICROHTTPD_VERSION_SHORT}" )
Set ( CPPMICROHTTPD_OUTPUTNAME "cppmicrohttpd" )
Set ( CPPMICROHTTPD_NAME "${CPPMICROHTTPD_PROJECT_NAME}-${CPPMICROHTTPD_VERSION_SHORT}" )
Set ( CPPMICROHTTPD_OUTPUTNAME "${CPPMICROHTTPD_PROJECT_NAME}" )
If ( CPPMICROHTTPD_VERSION_BEHIND ) If ( CPPMICROHTTPD_VERSION_BEHIND )
Set ( CPPMICROHTTPD_VERSION_COMPLETE "${CPPMICROHTTPD_VERSION_COMPLETE}+${CPPMICROHTTPD_VERSION_BEHIND}" ) Set ( CPPMICROHTTPD_VERSION_COMPLETE "${CPPMICROHTTPD_VERSION_COMPLETE}+${CPPMICROHTTPD_VERSION_BEHIND}" )
EndIf ( ) EndIf ( )

# Install directories
Set ( CPPMICROHTTPD_INSTALL_DIR_INCLUDE "include/${CPPMICROHTTPD_NAME}" )
Set ( CPPMICROHTTPD_INSTALL_DIR_LIB "lib" )
Set ( CPPMICROHTTPD_INSTALL_DIR_SHARE "share/${CPPMICROHTTPD_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 1a32531aef2deeebd5637b1873bc4e976628801c
Subproject commit ebbae4fbb42d671331b4c6e9d1d142f41dcacc1b

+ 4
- 0
src/CMakeLists.txt ファイルの表示

@@ -112,6 +112,8 @@ EndIf ( )


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


Set ( CPPMICROHTTPD_HAS_EXPORT False PARENT_SCOPE )

# Header # Header
If ( CPPMICROHTTPD_INSTALL_HEADER ) If ( CPPMICROHTTPD_INSTALL_HEADER )
Install ( FILES ${CPPMICROHTTPD_INCLUDE_DIR}/cppmicrohttpd.h Install ( FILES ${CPPMICROHTTPD_INCLUDE_DIR}/cppmicrohttpd.h
@@ -124,6 +126,7 @@ EndIf ( )


# Static # Static
If ( CPPMICROHTTPD_INSTALL_STATIC ) If ( CPPMICROHTTPD_INSTALL_STATIC )
Set ( CPPMICROHTTPD_HAS_EXPORT True PARENT_SCOPE )
Install ( TARGETS cppmicrohttpd-static Install ( TARGETS cppmicrohttpd-static
EXPORT cppmicrohttpd EXPORT cppmicrohttpd
DESTINATION ${CPPMICROHTTPD_INSTALL_DIR_LIB} ) DESTINATION ${CPPMICROHTTPD_INSTALL_DIR_LIB} )
@@ -131,6 +134,7 @@ EndIf ( )


# Shared # Shared
If ( CPPMICROHTTPD_INSTALL_SHARED ) If ( CPPMICROHTTPD_INSTALL_SHARED )
Set ( CPPMICROHTTPD_HAS_EXPORT True PARENT_SCOPE )
Install ( TARGETS cppmicrohttpd-shared Install ( TARGETS cppmicrohttpd-shared
EXPORT cppmicrohttpd EXPORT cppmicrohttpd
DESTINATION ${CPPMICROHTTPD_INSTALL_DIR_LIB} ) DESTINATION ${CPPMICROHTTPD_INSTALL_DIR_LIB} )


+ 0
- 5
test/CMakeLists.txt ファイルの表示

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


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

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


読み込み中…
キャンセル
保存