From 134c045d27ac26f8448f4da047bd4a24a3c78b29 Mon Sep 17 00:00:00 2001
From: jlaura <jlaura@usgs.gov>
Date: Fri, 10 Aug 2018 11:54:00 -0700
Subject: [PATCH] Fixes upload to anaconda cloud (#76)

* Updates travis

* turns off failing test

* Travis not pulling g++6

* Adds travis deploy

* Updates CMake builds to optionally build CSM

* No need to specify py verison - no py

* Testing PATHS for conda build

* build from root

* trying cmake paths in quotes for travis

* Loacal tests passing, not trying my fork

* Updates meta.yaml to point back to upstream

* Erroneous option for building tests
---
 .travis.yml     |  2 +-
 CMakeLists.txt  | 13 +++++++------
 recipe/build.sh |  3 +--
 3 files changed, 9 insertions(+), 9 deletions(-)

diff --git a/.travis.yml b/.travis.yml
index b0269cf..0a6166a 100644
--- a/.travis.yml
+++ b/.travis.yml
@@ -41,9 +41,9 @@ script:
   - cmake -DCOVERAGE=ON ..
   - cmake --build .
   - ctest
+  - cd ..
 
 after_success:
-  - cd .. && source activate base
   - conda install -y -q conda-build anaconda-client
   # Pull the libcsm for the build from our anaconda channel
   - conda config --add channels usgs-astrogeology
diff --git a/CMakeLists.txt b/CMakeLists.txt
index 1e09399..195f865 100644
--- a/CMakeLists.txt
+++ b/CMakeLists.txt
@@ -64,9 +64,10 @@ else()
 endif()
 
 
-
-include(CTest)
-
-enable_testing()
-
-add_subdirectory(tests)
+# Optional build or link against CSM
+option (BUILD_TESTS "Build tests" ON)
+if(BUILD_TESTS)
+  include(CTest)
+  enable_testing()
+  add_subdirectory(tests)
+endif()
diff --git a/recipe/build.sh b/recipe/build.sh
index 3f5c025..257773c 100644
--- a/recipe/build.sh
+++ b/recipe/build.sh
@@ -1,5 +1,4 @@
 #!/bin/sh
-source activate base
 mkdir build && cd build
-cmake -DCMAKE_BUILD_TYPE=Release -DCMAKE_INSTALL_PREFIX=$PREFIX -DBUILD_CSM=OFF ..
+cmake -DCMAKE_BUILD_TYPE=Release -DCMAKE_INSTALL_PREFIX=$PREFIX -DBUILD_CSM=OFF -DBUILD_TESTS=OFF ..
 make install
-- 
GitLab