Skip to content

Commit

Permalink
improve cmake structure and fix build
Browse files Browse the repository at this point in the history
  • Loading branch information
hofbi committed Feb 26, 2019
1 parent 0e55831 commit 00f0ede
Show file tree
Hide file tree
Showing 4 changed files with 44 additions and 43 deletions.
2 changes: 1 addition & 1 deletion .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ install: true
script:
- mkdir -p build
- cd build && cmake ..; make; cd ..
- mkdir -p export && cp build/*.pdf build/git.id export
- mkdir -p export && cp build/doc/*.pdf build/template-files/*.pdf build/git.id export
- echo "# This branch is for deployment only" >> export/README.md

deploy:
Expand Down
44 changes: 2 additions & 42 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -3,51 +3,11 @@ cmake_minimum_required(VERSION 2.8)
project(LaTeX4Ei NONE)
include(UseLATEX)

file(COPY ${CMAKE_CURRENT_SOURCE_DIR}/template-files/latex4ei
DESTINATION ${CMAKE_CURRENT_BINARY_DIR}/template-files
)

file(COPY ${CMAKE_CURRENT_SOURCE_DIR}/template-files/latex4ei
DESTINATION ${CMAKE_CURRENT_BINARY_DIR}/doc
)
add_subdirectory(doc)
add_subdirectory(template-files)

add_custom_target(
writegitid ALL
COMMAND ${CMAKE_CURRENT_SOURCE_DIR}/write-gitid.sh
WORKING_DIRECTORY ${CMAKE_CURRENT_BINARY_DIR}
)

add_latex_document(
template-files/cheatsheet_template.tex
FORCE_PDF
IMAGE_DIRS template-files/img
DEPENDS writegitid
)

add_latex_document(
template-files/cheatsheet_example.tex
FORCE_PDF
IMAGE_DIRS template-files/img
DEPENDS writegitid
)

add_latex_document(
template-files/report_example.tex
FORCE_PDF
IMAGE_DIRS template-files/img
DEPENDS writegitid
)

add_latex_document(
doc/LaTeX4EI-Template-Documentation.tex
FORCE_PDF
IMAGE_DIRS template-files/img
DEPENDS writegitid
)

add_latex_document(
doc/Scientific-Package-Documentation.tex
FORCE_PDF
IMAGE_DIRS template-files/img
DEPENDS writegitid
)
17 changes: 17 additions & 0 deletions doc/CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
file(COPY ${PROJECT_SOURCE_DIR}/template-files/latex4ei
DESTINATION ${CMAKE_CURRENT_BINARY_DIR}
)

add_latex_document(
LaTeX4EI-Template-Documentation.tex
FORCE_PDF
IMAGE_DIRS img
DEPENDS writegitid
)

add_latex_document(
Scientific-Package-Documentation.tex
FORCE_PDF
IMAGE_DIRS img
DEPENDS writegitid
)
24 changes: 24 additions & 0 deletions template-files/CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
file(COPY ${CMAKE_CURRENT_SOURCE_DIR}/latex4ei
DESTINATION ${CMAKE_CURRENT_BINARY_DIR}
)

add_latex_document(
cheatsheet_template.tex
FORCE_PDF
IMAGE_DIRS img
DEPENDS writegitid
)

add_latex_document(
cheatsheet_example.tex
FORCE_PDF
IMAGE_DIRS img
DEPENDS writegitid
)

add_latex_document(
report_example.tex
FORCE_PDF
IMAGE_DIRS img
DEPENDS writegitid
)

0 comments on commit 00f0ede

Please sign in to comment.