@@ -20,19 +20,25 @@ EndIf ( ) | |||
# Project ######################################################################################### | |||
Include ( CTest ) | |||
Include ( GNUInstallDirs ) | |||
Include ( ${CMAKE_CURRENT_SOURCE_DIR}/cmake/cppcurl-options.cmake ) | |||
Include ( ${CMAKE_CURRENT_SOURCE_DIR}/cmake/cppcurl-const.cmake ) | |||
Include ( ${CMAKE_CURRENT_SOURCE_DIR}/cmake/cppcurl-var.cmake ) | |||
Project ( cppcurl | |||
DESCRIPTION "A simple library" | |||
Project ( ${CPPCURL_PROJECT_NAME} | |||
DESCRIPTION "${CPPCURL_PROJECT_DESCRIPTION}" | |||
VERSION "${CPPCURL_VERSION}" ) | |||
Include ( CTest ) | |||
Include ( GNUInstallDirs ) | |||
# Subdirectories | |||
Add_SubDirectory ( ${CMAKE_CURRENT_SOURCE_DIR}/src ) | |||
Add_SubDirectory ( ${CMAKE_CURRENT_SOURCE_DIR}/test ) | |||
# Install | |||
If ( NOT CPPCURL_HAS_EXPORT | |||
OR NOT CPPCURL_INSTALL_PACKAGE ) | |||
Return ( ) | |||
EndIf ( ) | |||
Include ( CMakePackageConfigHelpers ) | |||
Write_Basic_Package_Version_File ( "${CMAKE_CURRENT_BINARY_DIR}/cmake/cppcurl-config-version.cmake" | |||
VERSION ${CPPCURL_VERSION} | |||
@@ -1,7 +1,7 @@ | |||
# cppcurl-config.cmake - package configuration file | |||
Include ( CMakeFindDependencyMacro ) | |||
Find_Dependency ( CURL ) | |||
Include ( CMakeFindDependencyMacro ) | |||
Find_Dependency ( CURL ) | |||
Include ( FindPackageHandleStandardArgs ) | |||
Set ( ${CMAKE_FIND_PACKAGE_NAME}_CONFIG ${CMAKE_CURRENT_LIST_FILE} ) | |||
@@ -0,0 +1,28 @@ | |||
# This file contains constant variables that are fixed to this project | |||
# Version | |||
Set ( CPPCURL_VERSION_MAJOR 1 ) | |||
Set ( CPPCURL_VERSION_MINOR 0 ) | |||
Set ( CPPCURL_VERSION_PATCH 0 ) | |||
Set ( CPPCURL_VERSION_BUILD 0 ) | |||
Set ( CPPCURL_VERSION_HASH "" ) | |||
Set ( CPPCURL_VERSION_BEHIND 0 ) | |||
Set ( CPPCURL_VERSION_DIRTY 0 ) | |||
# Names | |||
Set ( CPPCURL_PROJECT_NAME "cppcurl" ) | |||
Set ( CPPCURL_PROJECT_DESCRIPTION "C++ wrapper for the curl library." ) | |||
# Include generated variables for further usage | |||
Include ( ${CMAKE_CURRENT_LIST_DIR}/cppcurl-var.cmake ) | |||
# Install directories | |||
Set ( CPPCURL_INSTALL_DIR_INCLUDE "${CMAKE_INSTALL_INCLUDEDIR}/${CPPCURL_NAME}" ) | |||
Set ( CPPCURL_INSTALL_DIR_LIB "${CMAKE_INSTALL_LIBDIR}" ) | |||
Set ( CPPCURL_INSTALL_DIR_SHARE "${CMAKE_INSTALL_DATAROOTDIR}/${CPPCURL_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,18 +1,11 @@ | |||
# This file contains options that can be passed to the cmake command | |||
Option ( CPPCURL_INSTALL_HEADER | |||
"Install headers of cppcurl." | |||
ON ) | |||
Option ( CPPCURL_INSTALL_STATIC | |||
"Install static library of cppcurl." | |||
Option ( CPPCURL_INSTALL_PACKAGE | |||
"Install the cmake package of cppcurl." | |||
ON ) | |||
Option ( CPPCURL_INSTALL_SHARED | |||
"Install shared library of cppcurl." | |||
ON ) | |||
Option ( CPPCURL_INSTALL_DEBUG | |||
"Install the stripped debug informations of cppcurl." | |||
OFF ) | |||
Option ( CPPCURL_NO_STRIP | |||
"Do not strip debug symbols from binary." | |||
OFF ) | |||
Option ( CPPCURL_USE_GIT_VERSION | |||
"Read the git tags to get the version of cppcurl" | |||
ON ) |
@@ -1,11 +1,4 @@ | |||
# Version | |||
Set ( CPPCURL_VERSION_MAJOR 1 ) | |||
Set ( CPPCURL_VERSION_MINOR 0 ) | |||
Set ( CPPCURL_VERSION_PATCH 0 ) | |||
Set ( CPPCURL_VERSION_BUILD 0 ) | |||
Set ( CPPCURL_VERSION_HASH "" ) | |||
Set ( CPPCURL_VERSION_BEHIND 0 ) | |||
Set ( CPPCURL_VERSION_DIRTY 0 ) | |||
# This file contains generated variables that are needed for the project | |||
# Git Version | |||
If ( CPPCURL_USE_GIT_VERSION ) | |||
@@ -26,19 +19,8 @@ EndIf ( ) | |||
Set ( CPPCURL_VERSION_SHORT "${CPPCURL_VERSION_MAJOR}.${CPPCURL_VERSION_MINOR}" ) | |||
Set ( CPPCURL_VERSION "${CPPCURL_VERSION_SHORT}.${CPPCURL_VERSION_PATCH}.${CPPCURL_VERSION_BUILD}" ) | |||
Set ( CPPCURL_VERSION_COMPLETE "${CPPCURL_VERSION}" ) | |||
Set ( CPPCURL_NAME "cppcurl-${CPPCURL_VERSION_SHORT}" ) | |||
Set ( CPPCURL_OUTPUTNAME "cppcurl" ) | |||
Set ( CPPCURL_NAME "${CPPCURL_PROJECT_NAME}-${CPPCURL_VERSION_SHORT}" ) | |||
Set ( CPPCURL_OUTPUTNAME "${CPPCURL_PROJECT_NAME}" ) | |||
If ( CPPCURL_VERSION_BEHIND ) | |||
Set ( CPPCURL_VERSION_COMPLETE "${CPPCURL_VERSION_COMPLETE}+${CPPCURL_VERSION_BEHIND}" ) | |||
EndIf ( ) | |||
# Install directories | |||
Set ( CPPCURL_INSTALL_DIR_INCLUDE "include/${CPPCURL_NAME}" ) | |||
Set ( CPPCURL_INSTALL_DIR_LIB "lib" ) | |||
Set ( CPPCURL_INSTALL_DIR_SHARE "share/${CPPCURL_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 @@ | |||
Subproject commit 4953cd4cc849afdfa02a6057b5a2011fb62e91a6 | |||
Subproject commit ebbae4fbb42d671331b4c6e9d1d142f41dcacc1b |
@@ -23,8 +23,8 @@ Target_Include_Directories ( cppcurl | |||
$<BUILD_INTERFACE:${CPPCURL_GENERATED_INCLUDE_DIR}> | |||
$<INSTALL_INTERFACE:${CPPCURL_INSTALL_DIR_INCLUDE}> ) | |||
Target_Link_Libraries ( cppcurl | |||
INTERFACE | |||
CURL::libcurl ) | |||
INTERFACE | |||
CURL::libcurl ) | |||
If ( CPPCURL_HAS_CPPCORE ) | |||
Target_Link_Libraries ( cppcurl | |||
INTERFACE | |||
@@ -33,13 +33,18 @@ EndIf ( ) | |||
# Install ######################################################################################### | |||
Set ( CPPCURL_HAS_EXPORT False PARENT_SCOPE ) | |||
# Header | |||
Install ( FILES ${CPPCURL_INCLUDE_DIR}/cppcurl.h | |||
DESTINATION ${CPPCURL_INSTALL_DIR_INCLUDE} ) | |||
Install ( DIRECTORY ${CPPCURL_INCLUDE_DIR}/cppcurl | |||
DESTINATION ${CPPCURL_INSTALL_DIR_INCLUDE} ) | |||
Install ( DIRECTORY ${CPPCURL_GENERATED_INCLUDE_DIR}/cppcurl | |||
DESTINATION ${CPPCURL_INSTALL_DIR_INCLUDE} ) | |||
Install ( TARGETS cppcurl | |||
EXPORT cppcurl | |||
DESTINATION ${CPPCURL_INSTALL_DIR_INCLUDE} ) | |||
If ( CPPCURL_INSTALL_HEADER ) | |||
Set ( CPPCURL_HAS_EXPORT True PARENT_SCOPE ) | |||
Install ( FILES ${CPPCURL_INCLUDE_DIR}/cppcurl.h | |||
DESTINATION ${CPPCURL_INSTALL_DIR_INCLUDE} ) | |||
Install ( DIRECTORY ${CPPCURL_INCLUDE_DIR}/cppcurl | |||
DESTINATION ${CPPCURL_INSTALL_DIR_INCLUDE} ) | |||
Install ( DIRECTORY ${CPPCURL_GENERATED_INCLUDE_DIR}/cppcurl | |||
DESTINATION ${CPPCURL_INSTALL_DIR_INCLUDE} ) | |||
Install ( TARGETS cppcurl | |||
EXPORT cppcurl | |||
DESTINATION ${CPPCURL_INSTALL_DIR_INCLUDE} ) | |||
EndIf ( ) |
@@ -43,11 +43,6 @@ ForEach ( FILE IN LISTS CPPCURL_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} ) | |||