From d7d5908c9a485814905eea7c0952c90a74ecb92d Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?J=C3=B8rgen=20Sverre=20Lien=20Sell=C3=A6g?= Date: Thu, 14 Jan 2021 02:36:35 +0100 Subject: [PATCH] add documentation and include fltk and GraphLib as dependencies --- CMakeLists.txt | 32 +++++++++++++++++++++++++++++--- README.md | 12 +++++++++--- 2 files changed, 38 insertions(+), 6 deletions(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index 2baea1b..d601a97 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -1,13 +1,39 @@ cmake_minimum_required(VERSION 3.0) - project(cpp-main) -set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -std=c++1y -Wall -Wextra") +# setting the needed compile flags +set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -std=c++17") +# append the cmake search path to include the cmake-files to help build the +# project in lib/GraphLib/cmake_modules set(CMAKE_MODULE_PATH ${CMAKE_MODULE_PATH} "${CMAKE_SOURCE_DIR}/lib/GraphLib/cmake_modules") +# these two lines sets the variables starting with MathGL and FLTK used by +# add_executable and include_directories. find_package(MathGL REQUIRED) +find_package(FLTK REQUIRED) + +# these two lines turn off building of tests and examples of the GraphLib library +# building of tests and examples is rarely done while developing. +# see ./lib/GraphLib/CMakeLists.txt:L23 to see how these affect the library. +set(BUILD_EXAMPLES off) +set(ENABLE_TESTING off) +# this line includes the library GraphLib in lib/GraphLib add_subdirectory("./lib/GraphLib") -add_executable(cpp-main main.cpp ${MATHGL_LIBRARIES}) +include_directories( + ${MathGL_INCLUDE_DIRS} + ${FLTK_INCLUDE_DIR} + + # The following line might also be ${PROJECT_SOURCE_DIR}/lib/GraphLib/graphlib + # If your examples say #include you keep the next value as + # ${PROJECT_SOURCE_DIR}/lib/GraphLib. If it is #include you change it to + # how its mentioned before. + ${PROJECT_SOURCE_DIR}/lib/GraphLib +) + +add_executable(cpp-main main.cpp ${MATHGL_LIBRARIES} ${FLTK_LIBRARIES}) + + +# final notes diff --git a/README.md b/README.md index 86883e2..0f61849 100644 --- a/README.md +++ b/README.md @@ -3,8 +3,9 @@ ## Usage ```sh git clone https://voss.sarvern.no/zalox/cpp-skeleton-graphlib-fltk +# with juci you can stop after this step and open the folder is +# saved and press Ctrl+Enter cd -# with juci you can stop on this step and open the folder is saved and press Ctrl+Enter mkdir build cd build cmake .. @@ -16,5 +17,10 @@ make Arch: ```sh # use yay, pacaur or yaourt -yay -S mathgl blas -``` \ No newline at end of file +yay -S mathgl blas fltk +# the `doxygen` package is optional for generation of html documentation +# Note: MathGl can take a while to build on slow systems – such as a laptop. +``` + +## NOTE +See notes in CMakeLists.txt \ No newline at end of file