Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 7 additions & 0 deletions .github/workflows/build/action.yml
Original file line number Diff line number Diff line change
@@ -1,6 +1,11 @@
name: Build
description: Stub action for multi-platform builds

inputs:
cacheOnly:
type: boolean
default: false

runs:
using: "composite"
steps:
Expand All @@ -12,6 +17,8 @@ runs:
- name: Build (Nix)
if: runner.os == 'Linux'
uses: "./.github/workflows/build/nix"
with:
cacheOnly: ${{ inputs.cacheOnly }}

- name: Build (OSX)
if: runner.os == 'MacOS'
Expand Down
3 changes: 2 additions & 1 deletion .github/workflows/build/linux/action.yml
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ runs:
- name: Install Python Dependencies
shell: bash
run: |
pip3 install --user conan==1.*
pip3 install --user conan

- name: Download HDF5 Artifacts
shell: bash
Expand All @@ -44,6 +44,7 @@ runs:
HDF5_DIR="$(pwd)/${{ env.hdf5tag }}"
GSL_DIR="/tmp/gsl"
mkdir build && cd build
conan profile detect
conan install ../
cmake ../ -G Ninja -DLOCAL_STATIC_HDF5:bool=true -DHDF5_DIR:path=${HDF5_DIR} -DLOCAL_STATIC_GSL:bool=true -DGSL_DIR:path=${GSL_DIR}
ninja
Expand Down
3 changes: 2 additions & 1 deletion .github/workflows/build/osx/action.yml
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ runs:
- name: Install Python Dependencies
shell: bash
run: |
pip3 install --user conan==1.* --break-system-packages
pip3 install --user conan

- name: Download HDF5 Artifacts
shell: bash
Expand All @@ -31,6 +31,7 @@ runs:
HDF5_DIR="$(pwd)/${{ env.hdf5tag }}"
mkdir build && cd build

conan profile detect
conan install ../
cmake ../ -G Ninja -DLOCAL_STATIC_HDF5:bool=true -DHDF5_DIR:path=${HDF5_DIR}
ninja
Expand Down
4 changes: 2 additions & 2 deletions .github/workflows/build/windows/action.yml
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ runs:

- name: Install Python Dependencies
shell: bash
run: pip3 install conan==1.*
run: pip3 install conan

- name: Install MinGW
shell: bash
Expand All @@ -32,7 +32,7 @@ runs:
shell: bash
run: |
export PATH="$(python3 -m site --user-base)/bin:$PATH"
conan profile new default --detect
conan profile detect
conan profile update settings.compiler="gcc" default
conan profile update settings.compiler.version=11 default
conan profile update settings.compiler.libcxx=libstdc++11 default
Expand Down
31 changes: 22 additions & 9 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -1,7 +1,26 @@
cmake_minimum_required(VERSION 3.10)
project(np)
include(CMakePrintHelpers)

# Use Conan for dependency provision?
option(CONAN "Use conan to find dependencies" ON)
if(CONAN)
# Fetch and include conan_provider.cmake if it doesn't exist
if(NOT EXISTS "${CMAKE_CURRENT_LIST_DIR}/cmake/Modules/conan_provider.cmake")
message(STATUS "Downloading conan_provider.cmake from https://github.com/conan-io/cmake-conan")
file(DOWNLOAD "https://raw.githubusercontent.com/conan-io/cmake-conan/refs/heads/develop2/conan_provider.cmake"
"${CMAKE_CURRENT_LIST_DIR}/cmake/Modules/conan_provider.cmake"
)
endif()

# Add local dirs to cmake Module search path
list(APPEND CMAKE_MODULE_PATH ${CMAKE_BINARY_DIR})
list(APPEND CMAKE_PREFIX_PATH ${CMAKE_BINARY_DIR})

list(APPEND CMAKE_PROJECT_TOP_LEVEL_INCLUDES "cmake/Modules/conan_provider.cmake")
endif(CONAN)

project(np LANGUAGES CXX)

include(CMakePrintHelpers)

set(DESCRIPTION "NeXuS Processor")
set(AUTHOR "Jared Swift and Tristan Youngs")
Expand All @@ -18,13 +37,7 @@ include(ExternalProject)

set(CMAKE_MODULE_PATH "${HDF5_DIR}/share/cmake/;${CMAKE_MODULE_PATH}")

# Include Conan Packages
option(CONAN "Use conan to find dependencies" ON)
if(CONAN)
include(${CMAKE_BINARY_DIR}/conanbuildinfo.cmake)
conan_basic_setup(TARGETS)
include_directories(${CONAN_INCLUDE_DIRS_FMT})
else(CONAN)
if(NOT CONAN)
find_package(fmt REQUIRED)
find_package(CLI11 REQUIRED)
endif(CONAN)
Expand Down
4 changes: 2 additions & 2 deletions conanfile.txt
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ cli11/1.9.1
fmt/8.1.1

[generators]
cmake
CMakeToolchain

[options]
fmt:header_only=True
fmt/*:header_only=True
Loading