Skip to content

Commit

Permalink
move cpptoml out
Browse files Browse the repository at this point in the history
  • Loading branch information
wztzjhn committed Sep 3, 2024
1 parent 046d901 commit 17ffdbf
Show file tree
Hide file tree
Showing 4 changed files with 45 additions and 3,277 deletions.
4 changes: 4 additions & 0 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,10 @@ find_package(ARPACK REQUIRED)
include_directories(SYSTEM ${ARPACK_INCLUDE_DIRS})
set(LIBS ${LIBS} ${ARPACK_LIBRARIES})

#cpptoml
find_package(CPPTOML REQUIRED)
include_directories(SYSTEM ${CPPTOML_INCLUDE_DIRS})

# Boost
find_package(Boost REQUIRED)
include_directories(SYSTEM ${Boost_INCLUDE_DIRS})
Expand Down
15 changes: 13 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -89,13 +89,24 @@ To learn how to use this library to design ED code for your own models, please r

- gfortran
- g++
- cpptoml
- pkg-config
- boost-dev

A single command to get them on **Ubuntu**:
For **Ubuntu**, a single command should suffice:

```
sudo apt install gfortran g++ pkg-config libboost-dev
sudo apt install gfortran g++ libcpptoml-dev pkg-config libboost-dev
```

For other Linux distros, cpptoml can be downloaded easily:

```
cd /tmp
wget https://github.com/skystrife/cpptoml/archive/refs/tags/v0.1.1.tar.gz
tar xf v0.1.1.tar.gz
cd cpptoml-0.1.1
cp include/cpptoml.h ~/installs/include
```

4. Install ARPACK-NG:
Expand Down
28 changes: 28 additions & 0 deletions cmake_modules/FindCPPTOML.cmake
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
# CPPTOML_INCLUDE_DIR = cpptoml.h
# CPPTOML_FOUND = true if CPPTOML is found

IF(CPPTOML_INCLUDE_DIRS)
FIND_PATH(CPPTOML_INCLUDE_DIR cpptoml.h ${CPPTOML_INCLUDE_DIRS})
ELSE(CPPTOML_INCLUDE_DIRS)
SET(TRIAL_PATHS
$ENV{HOME}/installs/include
/usr/include
/usr/local/include
/opt/homebrew/include
)
FIND_PATH(CPPTOML_INCLUDE_DIR cpptoml.h ${TRIAL_PATHS})
ENDIF(CPPTOML_INCLUDE_DIRS)
set(CPPTOML_INCLUDE_DIRS ${CPPTOML_INCLUDE_DIR})

IF(CPPTOML_INCLUDE_DIR)
MESSAGE(STATUS "CPPTOML_INCLUDE_DIR=${CPPTOML_INCLUDE_DIR}")
SET(CPPTOML_FOUND TRUE)
ELSE()
MESSAGE("CPPTOML NOT found.")
SET(CPPTOML_FOUND FALSE)
ENDIF()

MARK_AS_ADVANCED(
CPPTOML_INCLUDE_DIR
CPPTOML_FOUND
)
Loading

0 comments on commit 17ffdbf

Please sign in to comment.