Project Started with a basic template with cmake
This commit is contained in:
parent
2071e185a4
commit
5d080d092d
|
|
@ -0,0 +1,2 @@
|
|||
build/
|
||||
bin/
|
||||
|
|
@ -0,0 +1,13 @@
|
|||
cmake_minimum_required(VERSION 3.20)
|
||||
|
||||
project(Contarius)
|
||||
|
||||
set(CMAKE_C_STANDARD 99)
|
||||
|
||||
include_directories(include)
|
||||
|
||||
set(CMAKE_RUNTIME_OUTPUT_DIRECTORY ${PROJECT_SOURCE_DIR}/bin)
|
||||
|
||||
|
||||
add_subdirectory(src)
|
||||
add_subdirectory(docs)
|
||||
21
README.md
21
README.md
|
|
@ -1,2 +1,23 @@
|
|||
# Contarius
|
||||
Contarius é um software para criar razonetes.
|
||||
|
||||
## Instrução de Compilação
|
||||
Antes de compilar é necessário ter as seguintes dependencias:
|
||||
|
||||
- GCC
|
||||
- CMAKE
|
||||
- Doxygen
|
||||
- Latex
|
||||
|
||||
Ao Compilar o programa será compilado conjuntamente a documentação do código
|
||||
|
||||
Para compilar basta executar:
|
||||
|
||||
``` bash
|
||||
|
||||
cmake -S . -B build
|
||||
cd build
|
||||
cmake --build .
|
||||
|
||||
|
||||
```
|
||||
|
|
|
|||
|
|
@ -0,0 +1,52 @@
|
|||
include(FindLATEX)
|
||||
option(DOCS "Build The Documentation")
|
||||
|
||||
find_package(Doxygen)
|
||||
find_package(LATEX COMPONENTS PDFLATEX REQUIRED)
|
||||
|
||||
|
||||
if(DOXYGEN_FOUND)
|
||||
set(DOXYGEN_IN ${CMAKE_CURRENT_SOURCE_DIR}/../docs/Doxyfile.in)
|
||||
set(DOXYGEN_OUT ${CMAKE_CURRENT_BINARY_DIR}/Doxyfile)
|
||||
|
||||
configure_file(${DOXYGEN_IN} ${DOXYGEN_OUT} @ONLY)
|
||||
message("Doxygen build started")
|
||||
|
||||
# Note the option ALL which allows to build the docs together with the application
|
||||
add_custom_target(doc_doxygen ALL
|
||||
COMMAND ${DOXYGEN_EXECUTABLE} ${DOXYGEN_OUT}
|
||||
WORKING_DIRECTORY ${CMAKE_CURRENT_BINARY_DIR}
|
||||
COMMENT "Generating API documentation with Doxygen"
|
||||
VERBATIM )
|
||||
if(LATEX_PDFLATEX_FOUND)
|
||||
|
||||
if(UNIX)
|
||||
set(MAKE_COMMAND "make")
|
||||
elseif(WIN32)
|
||||
set(MAKE_COMMAND "make.bat")
|
||||
endif()
|
||||
|
||||
message("PDFLATEX Found: ${PDFLATEX_COMPILER}")
|
||||
file(MAKE_DIRECTORY ${PROJECT_SOURCE_DIR}/bin/docs)
|
||||
set(PDF_OUTPUT_DIR "${PROJECT_SOURCE_DIR}/bin/docs")
|
||||
add_custom_target(
|
||||
build_docs_pdf ALL
|
||||
|
||||
COMMAND ${MAKE_COMMAND}
|
||||
WORKING_DIRECTORY "${PROJECT_SOURCE_DIR}/build/docs/latex"
|
||||
COMMENT "Building PDF Documentation..."
|
||||
VERBATIM
|
||||
)
|
||||
add_custom_command(
|
||||
TARGET build_docs_pdf POST_BUILD
|
||||
COMMAND ${CMAKE_COMMAND} -E copy_if_different
|
||||
"${PROJECT_SOURCE_DIR}/build/docs/latex/refman.pdf"
|
||||
"${PDF_OUTPUT_DIR}/Contarius.pdf"
|
||||
COMMENT "Copying PDF documentation to ${PDF_OUTPUT_DIR}..."
|
||||
)
|
||||
else()
|
||||
message(FATAL_ERROR "pdflatex not found. LaTeX is required to build the documentation.")
|
||||
endif()
|
||||
else (DOXYGEN_FOUND)
|
||||
message("Doxygen needs to be installed to generate the Doxygen documentation")
|
||||
endif (DOXYGEN_FOUND)
|
||||
File diff suppressed because it is too large
Load Diff
|
|
@ -0,0 +1,5 @@
|
|||
set(SOURCE_FILES main.c)
|
||||
|
||||
add_executable(Contarius ${SOURCE_FILES})
|
||||
|
||||
target_include_directories(Contarius PRIVATE ${CMAKE_CURRENT_SOURCE_DIR}/../include)
|
||||
|
|
@ -0,0 +1,9 @@
|
|||
#include <stdio.h>
|
||||
|
||||
|
||||
|
||||
int main(){
|
||||
|
||||
printf("Contarius is Being Made (SomeHow)...\n");
|
||||
return 0;
|
||||
}
|
||||
Loading…
Reference in New Issue