Skip to content

Commit

Permalink
cmake build type
Browse files Browse the repository at this point in the history
  • Loading branch information
scivision committed Oct 11, 2021
1 parent 1c9047b commit b77a64c
Show file tree
Hide file tree
Showing 3 changed files with 12 additions and 15 deletions.
9 changes: 5 additions & 4 deletions .github/workflows/ci_cmake.yml
Original file line number Diff line number Diff line change
@@ -1,5 +1,8 @@
name: ci_cmake

env:
CMAKE_BUILD_TYPE: Release

on:
push:
paths:
Expand All @@ -16,8 +19,7 @@ jobs:
- run: cmake -B build -G "MinGW Makefiles"
- run: cmake --build build --parallel

- run: ctest -V
working-directory: build
- run: ctest --test-dir build

linux:
runs-on: ubuntu-latest
Expand All @@ -27,5 +29,4 @@ jobs:
- run: cmake -B build
- run: cmake --build build --parallel

- run: ctest -V
working-directory: build
- run: ctest --test-dir build
12 changes: 4 additions & 8 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -1,10 +1,7 @@
cmake_minimum_required (VERSION 3.7)
cmake_minimum_required (VERSION 3.14...3.21)

if(NOT CMAKE_BUILD_TYPE)
set(CMAKE_BUILD_TYPE "Release" CACHE STRING "default build type")
endif()

project(snpcal LANGUAGES Fortran)
project(snpcal
LANGUAGES Fortran)

include(CTest)

Expand All @@ -25,8 +22,7 @@ configure_file(snpcal.dat ${CMAKE_CURRENT_BINARY_DIR} COPYONLY)

#--- install

install(TARGETS snpcal
RUNTIME DESTINATION bin)
install(TARGETS snpcal TYPE RUNTIME)

install(FILES ${snpcal_SOURCE_DIR}/snpcal.dat
DESTINATION bin
Expand Down
6 changes: 3 additions & 3 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -16,15 +16,15 @@ Modified:
Assuming any modern Fortran compiler (tested with Gfortran, PGI, Flang and Intel `ifort`):

```sh
cmake ..
cmake -B build

cmake --build .
cmake --build build
```

test output with

```sh
ctest -V
ctest --test-dir build
```

## Usage
Expand Down

0 comments on commit b77a64c

Please # to comment.