diff --git a/.travis.yml b/.travis.yml new file mode 100644 index 0000000000000000000000000000000000000000..cf7700ca135e5193e7306f1c74007ceb76c7adc4 --- /dev/null +++ b/.travis.yml @@ -0,0 +1,22 @@ +language: generic + +os: + - linux + - osx + + install: + # Install a supported cmake version (>= 3.10) + - | + if [ "$TRAVIS_OS_NAME" == "linux" ]; then + wget https://repo.continuum.io/miniconda/Miniconda3-latest-Linux-x86_64.sh -O miniconda.sh; + else + curl -o miniconda.sh https://repo.continuum.io/miniconda/Miniconda3-latest-MacOSX-x86_64.sh; + fi + - bash miniconda.sh -b -p $HOME/miniconda + - export PATH="$HOME/miniconda/bin:$PATH" + - conda install -y -c usgs-astrogeology libcsm + - conda install -y -c conda-forge cmake pytest + +script: + - .run_build.sh + - pytest tests diff --git a/python/CMakeLists.txt b/python/CMakeLists.txt index 4addffdca46767a7ab5ef66abe84f5fa8d488697..9b0fe30f8fed98cc8eab69434d8dac5135dd7781 100644 --- a/python/CMakeLists.txt +++ b/python/CMakeLists.txt @@ -7,8 +7,11 @@ set(CMAKE_SWIG_FLAGS "") set_source_files_properties(../csmapi.i PROPERTIES CPLUSPLUS ON) -find_path(CSM_INCLUDE_DIR NAMES csm.h PATH_SUFFIXES csm) -find_library(CSM_LIBRARY NAMES csmapi) +find_path(CSM_INCLUDE_DIR NAMES csm.h + PATH_SUFFIXES csm + PATHS $ENV{CONDA_PREFIX}/include) +find_library(CSM_LIBRARY NAMES csmapi + PATHS $ENV{CONDA_PREFIX}/lib) include_directories(${CSM_INCLUDE_DIR}) diff --git a/recipe/build.sh b/recipe/build.sh new file mode 100644 index 0000000000000000000000000000000000000000..c789abd85a9557f6daedf272788c73bd443e9100 --- /dev/null +++ b/recipe/build.sh @@ -0,0 +1,5 @@ +source activate base +mkdir build && cd build +cmake -DCMAKE_BUILD_TYPE=Release -DCMAKE_INSTALL_PREFIX=$PREFIX .. +make +python python/setup.py install \ No newline at end of file diff --git a/recipe/meta.yaml b/recipe/meta.yaml new file mode 100644 index 0000000000000000000000000000000000000000..c619929d8422bc2f8b7421e19a2b59e4bde5de5f --- /dev/null +++ b/recipe/meta.yaml @@ -0,0 +1,23 @@ +package: + name: csmwrapper + version: "0.1.0" + +source: + git_url: https://github.com/USGS-Astrogeology/CSM-Swig.git + +requirements: + build: + - {{ compiler('cxx') }} + - cmake >=3.10 + - libcsm + +test: + commands: + - import csmapi + - import csmapi.Isd + + +about: + home: https://github.com/USGS-Astrogeology/CSM-Swig + license: None +summary: "SWIG Wrapper to generate bindings to the Community Sensor Model" \ No newline at end of file