From 506ca3ff2e1eb1819263b99a94ca4c76b4b91ed7 Mon Sep 17 00:00:00 2001 From: Jesse Mapel Date: Sat, 1 Dec 2018 12:16:31 -0700 Subject: [PATCH] Added GSL (#40) * added environment file * Added GSL * Fixed travis.yml: * Maybed actually fixed travis * More travis fixes --- .travis.yml | 5 +++-- CMakeLists.txt | 12 ++++++++++-- environment.yml | 8 ++++++++ src/eal.cpp | 5 +++-- 4 files changed, 24 insertions(+), 6 deletions(-) create mode 100644 environment.yml diff --git a/.travis.yml b/.travis.yml index 9025a3e..5e262d1 100644 --- a/.travis.yml +++ b/.travis.yml @@ -18,7 +18,7 @@ matrix: - MATRIX_EVAL="CXX=g++-7 && CC=gcc-7" - os: osx osx_image: xcode9.4 - env: + env: - MATRIX_EVAL="CXX=clang++ && CC=clang" before_install: @@ -39,7 +39,8 @@ install: fi - bash miniconda.sh -b -p $HOME/miniconda - export PATH="$HOME/miniconda/bin:$PATH" - - conda install -y -c conda-forge cmake + - conda env create -f environment.yml -n eal + - source activate eal script: - mkdir build diff --git a/CMakeLists.txt b/CMakeLists.txt index 60154b7..3e904ad 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -17,6 +17,9 @@ include(CTest) set(CMAKE_CXX_STANDARD 11) +# Third Party Dependencies +find_package(GSL) + # Library setup add_library(usgsephem SHARED src/eal.cpp @@ -28,13 +31,18 @@ set_target_properties(usgsephem PROPERTIES set(EPHEM_INCLUDE_DIRS "${CMAKE_CURRENT_SOURCE_DIR}/include/" "${CMAKE_CURRENT_SOURCE_DIR}/include/json") target_include_directories(usgsephem + PRIVATE + ${GSL_INCLUDE_DIRS} PUBLIC - "${EPHEM_INCLUDE_DIRS}" + ${EPHEM_INCLUDE_DIRS} ) # Setup for GoogleTest find_package (Threads) -target_link_libraries(usgsephem PUBLIC +target_link_libraries(usgsephem + PRIVATE + ${GSL_LIBRARIES} + PUBLIC gtest ${CMAKE_THREAD_LIBS_INIT}) # Setup for ctest diff --git a/environment.yml b/environment.yml new file mode 100644 index 0000000..6452d76 --- /dev/null +++ b/environment.yml @@ -0,0 +1,8 @@ +name: eal + +channels: + - conda-forge + +dependencies: + - cmake>=3.10 + - gsl diff --git a/src/eal.cpp b/src/eal.cpp index 8d51810..364088c 100644 --- a/src/eal.cpp +++ b/src/eal.cpp @@ -1,12 +1,13 @@ - #include "eal.h" #include + +#include + #include using json = nlohmann::json; - using namespace eal; -- GitLab