Skip to content

Commit

Permalink
matlab: more explicit error if CMake missing
Browse files Browse the repository at this point in the history
  • Loading branch information
scivision committed Sep 30, 2020
1 parent 779dfd5 commit 7442e67
Show file tree
Hide file tree
Showing 3 changed files with 15 additions and 4 deletions.
9 changes: 8 additions & 1 deletion +iri2016/cmake.m
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,14 @@ function cmake(srcdir)
srcdir (1,1) string
end

cmd = "ctest -S" + fullfile(srcdir, "setup.cmake") + " -VV";
cmd = "cmake --version";
ret = system(cmd);
if ret ~= 0
error('iri2016:cmake:runtime_error', 'CMake not found')
end

cmd = "ctest -S " + fullfile(srcdir, "setup.cmake") + " -VV";
disp(cmd)

ret = system(cmd);
assert(ret==0, 'failed to build IRI')
Expand Down
3 changes: 1 addition & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,9 +2,8 @@

[![image](https://zenodo.org/badge/DOI/10.5281/zenodo.240895.svg)](https://doi.org/10.5281/zenodo.240895)
![Actions Status](https://github.com/space-physics/iri2016/workflows/ci/badge.svg)
[![codecov](https://codecov.io/gh/space-physics/iri2016/branch/master/graph/badge.svg)](https://codecov.io/gh/space-physics/iri2016)
[![PyPi version](https://img.shields.io/pypi/pyversions/iri2016.svg)](https://pypi.python.org/pypi/iri2016)
[![PyPi Download stats](http://pepy.tech/badge/iri2016)](http://pepy.tech/project/iri2016)
[![PyPi Download stats](https://static.pepy.tech/badge/iri2016)](https://pepy.tech/project/iri2016)


![image](./figures/iri2DExample02.gif)
Expand Down
7 changes: 6 additions & 1 deletion src/iri2016/CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -1,12 +1,15 @@
cmake_minimum_required(VERSION 3.13)

if(NOT CMAKE_BUILD_TYPE)
set(CMAKE_BUILD_TYPE Release CACHE STRING "Debug or Release")
endif()

project(iri2016
LANGUAGES Fortran
DESCRIPTION "IRI2016 command line driver"
HOMEPAGE_URL https://github.com/space-physics/iri2016)
enable_testing()

include(CTest)

# --- compiler options

Expand Down Expand Up @@ -45,9 +48,11 @@ target_link_libraries(iri2016_driver iri2016)
set_target_properties(iri2016_driver PROPERTIES
RUNTIME_OUTPUT_DIRECTORY ${CMAKE_CURRENT_SOURCE_DIR})

if(BUILD_TESTING)
add_executable(test_iri2016 src/test.f90)
target_link_libraries(test_iri2016 iri2016)
add_test(NAME IRI2016
COMMAND $<TARGET_FILE:test_iri2016>
WORKING_DIRECTORY ${CMAKE_CURRENT_SOURCE_DIR})
set_tests_properties(IRI2016 PROPERTIES TIMEOUT 15)
endif(BUILD_TESTING)

0 comments on commit 7442e67

Please sign in to comment.