diff --git a/cmake/GitVersion.cmake b/cmake/GitVersion.cmake deleted file mode 100644 index be29b1c..0000000 --- a/cmake/GitVersion.cmake +++ /dev/null @@ -1,16 +0,0 @@ -IF(EXISTS ${CMAKE_CURRENT_SOURCE_DIR}/.git) - FIND_PACKAGE(Git) - IF(GIT_FOUND) - EXECUTE_PROCESS( - COMMAND ${GIT_EXECUTABLE} rev-parse --short HEAD - WORKING_DIRECTORY "${CMAKE_CURRENT_SOURCE_DIR}" - OUTPUT_VARIABLE "my_BUILD_VERSION" - ERROR_QUIET - OUTPUT_STRIP_TRAILING_WHITESPACE) - MESSAGE( STATUS "Git version: ${my_BUILD_VERSION}" ) - ELSE(GIT_FOUND) - SET(my_BUILD_VERSION 0) - ENDIF(GIT_FOUND) -ENDIF(EXISTS ${CMAKE_CURRENT_SOURCE_DIR}/.git) - -CONFIGURE_FILE(${CMAKE_CURRENT_SOURCE_DIR}/kml2mapsVersion.h.in ${CMAKE_CURRENT_BINARY_DIR}/kml2mapsVersion.h @ONLY) diff --git a/configured/CMakeLists.txt b/configured/CMakeLists.txt index b6abf60..1713876 100644 --- a/configured/CMakeLists.txt +++ b/configured/CMakeLists.txt @@ -1,7 +1,12 @@ configure_file( - "config.hpp.in" "${CMAKE_BINARY_DIR}/configured_files/include/config.hpp" + "config.hpp.in" + "${CMAKE_BINARY_DIR}/configured_files/include/config.hpp" ESCAPE_QUOTES) +SET(GITVERSION_FULL "v0.0.0-0-00000000") +SET(GITVERSION_TAG "v0.0.0") +SET(GITVERSION_COMMIT "00000000") + IF(EXISTS ${CMAKE_SOURCE_DIR}/.git) FIND_PACKAGE(Git) IF(GIT_FOUND) @@ -27,10 +32,6 @@ IF(EXISTS ${CMAKE_SOURCE_DIR}/.git) OUTPUT_STRIP_TRAILING_WHITESPACE) MESSAGE( STATUS "Git version: ${GITVERSION_FULL}" ) - ELSE(GIT_FOUND) - SET(GITVERSION_FULL "v0.0.0-0-00000000") - SET(GITVERSION_TAG "v0.0.0") - SET(GITVERSION_COMMIT "00000000") ENDIF(GIT_FOUND) ENDIF(EXISTS ${CMAKE_SOURCE_DIR}/.git) @@ -38,3 +39,9 @@ CONFIGURE_FILE( "gitversion.hpp.in" "${CMAKE_BINARY_DIR}/configured_files/include/gitversion.hpp" ESCAPE_QUOTES) + +MESSAGE( STATUS "Git TAG: ${GITVERSION_TAG} para el Doxyfile !!!!!!!!" ) +configure_file( + "Doxyfile.in" + "${CMAKE_SOURCE_DIR}/docs/Doxyfile" + ESCAPE_QUOTES) diff --git a/configured/Doxyfile.in b/configured/Doxyfile.in new file mode 100644 index 0000000..415fe96 --- /dev/null +++ b/configured/Doxyfile.in @@ -0,0 +1,44 @@ +# Configuración para Doxygen para usarse con CMake +# +# Echarle un ojo a esto: https://github.com/biojppm/cmake/blob/master/ConfigurationTypes.cmake +#--------------------------------------------------------------------------- +# Opciones relacionadas con el proyecto +#--------------------------------------------------------------------------- +DOXYFILE_ENCODING = UTF-8 +PROJECT_NAME = "Librería Parchis C++" +PROJECT_NUMBER = "@GITVERSION_TAG@" +PROJECT_BRIEF = +PROJECT_LOGO = +OUTPUT_DIRECTORY = ./ +OUTPUT_LANGUAGE = English +MARKDOWN_SUPPORT = YES + +#--------------------------------------------------------------------------- +# Opciones de configuración relacionadas +#--------------------------------------------------------------------------- +EXTRACT_ALL = YES +RECURSIVE = YES +GENERATE_HTML = YES +GENERATE_LATEX = NO + +HAVE_DOT = YES +EXTRACT_PRIVATE = YES +EXTRACT_STATIC = YES +CALL_GRAPH = YES +CALLER_GRAPH = YES +#DISABLE_INDEX = YES +#GENERATE_TREEVIEW = YES + +#--------------------------------------------------------------------------- +# Opciones de configuraicón relacionadas con los fuentes +#--------------------------------------------------------------------------- +INPUT = ../src \ + ../include +INPUT_ENCODING = UTF-8 +FILE_PATTERNS = *.c \ + *.cc \ + *.cpp \ + *.h \ + *.hpp \ + *.md \ + *.txt diff --git a/docs/Doxyfile b/docs/Doxyfile index edc5ba6..1e2297d 100644 --- a/docs/Doxyfile +++ b/docs/Doxyfile @@ -1,10 +1,12 @@ # Configuración para Doxygen para usarse con CMake +# +# Echarle un ojo a esto: https://github.com/biojppm/cmake/blob/master/ConfigurationTypes.cmake #--------------------------------------------------------------------------- # Opciones relacionadas con el proyecto #--------------------------------------------------------------------------- DOXYFILE_ENCODING = UTF-8 PROJECT_NAME = "Librería Parchis C++" -PROJECT_NUMBER = 1.5.0 +PROJECT_NUMBER = "v1.0.0" PROJECT_BRIEF = PROJECT_LOGO = OUTPUT_DIRECTORY = ./ diff --git a/src/CMakeLists.txt b/src/CMakeLists.txt index 2682d68..559ef80 100644 --- a/src/CMakeLists.txt +++ b/src/CMakeLists.txt @@ -1,4 +1,3 @@ # Fichero `cmake` que incluye subdirectorios de mis fuentes. # -#add_subdirectory(my_lib) add_subdirectory(libparchis) diff --git a/src/libparchis/PVersion.h b/src/libparchis/PVersion.h index e476cb4..9394e31 100644 --- a/src/libparchis/PVersion.h +++ b/src/libparchis/PVersion.h @@ -128,123 +128,8 @@ * g3ad9785 * * - * - * - * -$ cat > _libcpp_git.sh - - - git=/usr/bin/git - version=`$git describe --tags --long` - echo '#include "PVersion.h"' > ../PVersion.cpp - echo "" >> ../PVersion.cpp - echo "" >> ../PVersion.cpp - echo "PVersion::PVersion () " >> ../PVersion.cpp - echo "{" >> ../PVersion.cpp - echo -n ' version = "' >> ../PVersion.cpp - echo -n ${version} >> ../PVersion.cpp - echo '";' >> ../PVersion.cpp - echo "}" >> ../PVersion.cpp - echo "" >> ../PVersion.cpp - echo "PVersion::~PVersion () " >> ../PVersion.cpp - echo "{" >> ../PVersion.cpp - echo "}" >> ../PVersion.cpp - echo "" >> ../PVersion.cpp - echo "const char* PVersion::getVersion ()" >> ../PVersion.cpp - echo "{" >> ../PVersion.cpp - echo " return version;" >> ../PVersion.cpp - echo "}" >> ../PVersion.cpp - - - $ chmod 755 _libcpp_git.sh - - * 2) Invoque it as the first built step in QTCreator - - Projects, build steps, add a step and move it to the first position - Enable : Yes - Name : Create Version.cpp - Command : Complete_path_to_the_script/_libcpp_svnversion.sh or - Complete_path_to_the_script/_libcpp_git.sh or - Work Dir : %{sourceDir} - - * @endcode - * - * - * @par Under XCode - * Project->Target->Add Target->Aggregate->Run Script - * @code - - git=/usr/bin/git - version=`$git describe --tags --long` - - echo "/ ** " > ../PVersion.cpp - echo ' * @class PVersion PVersion.cpp \"PVersion.cpp\" ' >> ../PVersion.cpp - echo " * @file PVersion.cpp " >> ../PVersion.cpp - echo " * @brief Parchis Class: Simply used to return the subversion number " >> ../PVersion.cpp - echo " * " >> ../PVersion.cpp - echo " * ---------------------------------------------------------------------------" >> ../PVersion.cpp - echo " * / " >> ../PVersion.cpp - echo " " >> ../PVersion.cpp - echo " " >> ../PVersion.cpp - echo "//--------------------------------------------------------------------------- " >> ../PVersion.cpp - echo " " >> ../PVersion.cpp - echo '#include "PVersion.h" ' >> ../PVersion.cpp - echo " " >> ../PVersion.cpp - echo "//--------------------------------------------------------------------------- " >> ../PVersion.cpp - echo " " >> ../PVersion.cpp - echo "//--------------------------------------------------------------------------- " >> ../PVersion.cpp - echo " " >> ../PVersion.cpp - echo " " >> ../PVersion.cpp - echo "#pragma mark - " >> ../PVersion.cpp - echo "#pragma mark Public Methods " >> ../PVersion.cpp - echo " " >> ../PVersion.cpp - echo "//--------------------------------------------------------------------------- " >> ../PVersion.cpp - echo " " >> ../PVersion.cpp - echo "/ ** " >> ../PVersion.cpp - echo " * Constructor of PVersion " >> ../PVersion.cpp - echo " * " >> ../PVersion.cpp - echo " * / " >> ../PVersion.cpp - echo "PVersion::PVersion () " >> ../PVersion.cpp - echo "{ " >> ../PVersion.cpp - - echo -n ' version = "' >> ../PVersion.cpp - echo -n ${version} >> ../PVersion.cpp - echo '";' >> ../PVersion.cpp - - echo "} " >> ../PVersion.cpp - echo " " >> ../PVersion.cpp - echo "//--------------------------------------------------------------------------- " >> ../PVersion.cpp - echo " " >> ../PVersion.cpp - echo "/ ** " >> ../PVersion.cpp - echo " * Destructor of PVersion " >> ../PVersion.cpp - echo " * " >> ../PVersion.cpp - echo " * / " >> ../PVersion.cpp - echo "PVersion::~PVersion () " >> ../PVersion.cpp - echo "{ " >> ../PVersion.cpp - echo "} " >> ../PVersion.cpp - echo " " >> ../PVersion.cpp - echo "//--------------------------------------------------------------------------- " >> ../PVersion.cpp - echo " " >> ../PVersion.cpp - echo "/ ** " >> ../PVersion.cpp - echo " * Getter: Return the version of Parchis Engine " >> ../PVersion.cpp - echo " * " >> ../PVersion.cpp - echo " * @return the version of parchis engine " >> ../PVersion.cpp - echo " * / " >> ../PVersion.cpp - echo "const char* PVersion::getVersion () " >> ../PVersion.cpp - echo "{ " >> ../PVersion.cpp - echo " return version; " >> ../PVersion.cpp - echo "} " >> ../PVersion.cpp - echo " " >> ../PVersion.cpp - echo "//--------------------------------------------------------------------------- " >> ../PVersion.cpp - echo " " >> ../PVersion.cpp - echo "//--------------------------------------------------------------------------- " >> ../PVersion.cpp - echo " " >> ../PVersion.cpp - - - * @endcode */ - #ifndef PVERSION_H #define PVERSION_H diff --git a/src/my_lib/CMakeLists.txt b/src/my_lib/CMakeLists.txt deleted file mode 100644 index 24ee589..0000000 --- a/src/my_lib/CMakeLists.txt +++ /dev/null @@ -1,58 +0,0 @@ -# Fichero `cmake` específico para mi librería -# - -# Defino cuales son los fuentes y las cabeceras que quiero -# incluir en mi librería. -set(LIBRARY_SOURCES - "${CMAKE_CURRENT_SOURCE_DIR}/my_lib.cc" - ) -set(LIBRARY_HEADERS - "${CMAKE_CURRENT_SOURCE_DIR}/my_lib.h" - ) -set(LIBRARY_INCLUDES - "./" - "${CMAKE_BINARY_DIR}/configured_files/include" - ) - -# Defino que quiero "linkar" con mi librería -add_library(${LIBRARY_NAME} STATIC ${LIBRARY_SOURCES} ${LIBRARY_HEADERS}) -target_include_directories(${LIBRARY_NAME} PUBLIC ${LIBRARY_INCLUDES}) - -if(NOT DEFINED IGNORELIBS) # Ignoro las librerias para subir la doc a github pages - target_link_libraries( - ${LIBRARY_NAME} - PRIVATE - # Descomentar/comentar lo que te interese o añade más... - # Nota: Necesitarás compilarlas desde el CMakeLists.txt principal. - # revisa la sección del gestor de paquetes. - - #nlohmann_json::nlohmann_json - #fmt::fmt - #cxxopts::cxxopts - spdlog::spdlog) -endif() - -# Si habilité el añadir más warnings, lo ejecuto aquí -if(${ENABLE_WARNINGS}) - target_set_warnings( - TARGET - ${LIBRARY_NAME} - ENABLE - ${ENABLE_WARNINGS} - AS_ERRORS - ${ENABLE_WARNINGS_AS_ERRORS}) -endif() - -# Si habilité LTO lo ejecuto aquí -if(${ENABLE_LTO}) - target_enable_lto( - TARGET - ${LIBRARY_NAME} - ENABLE - ON) -endif() - -# Si habilité CLANG Tidy lo ejecuto. -if(${ENABLE_CLANG_TIDY}) - add_clang_tidy_to_target(${LIBRARY_NAME}) -endif()