From fde39adf32e011c0000412540179a3df6e00830a Mon Sep 17 00:00:00 2001 From: Tristan Youngs Date: Thu, 12 Feb 2026 09:07:59 +0000 Subject: [PATCH 1/4] Use conan2. --- CMakeLists.txt | 31 ++++++++++++++++++++++--------- conanfile.txt | 4 ++-- 2 files changed, 24 insertions(+), 11 deletions(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index 22c0bd3..e6cdd27 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -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") @@ -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) diff --git a/conanfile.txt b/conanfile.txt index da7ae3b..6cc9636 100644 --- a/conanfile.txt +++ b/conanfile.txt @@ -3,7 +3,7 @@ cli11/1.9.1 fmt/8.1.1 [generators] -cmake +CMakeToolchain [options] -fmt:header_only=True +fmt/*:header_only=True From 3b39245f0adec16896018472784fcfea5c496f0b Mon Sep 17 00:00:00 2001 From: Tristan Youngs Date: Thu, 12 Feb 2026 09:08:57 +0000 Subject: [PATCH 2/4] Conan2 in CI. --- .github/workflows/build/linux/action.yml | 2 +- .github/workflows/build/osx/action.yml | 2 +- .github/workflows/build/windows/action.yml | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/.github/workflows/build/linux/action.yml b/.github/workflows/build/linux/action.yml index d4bbc3d..70f6cc6 100644 --- a/.github/workflows/build/linux/action.yml +++ b/.github/workflows/build/linux/action.yml @@ -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 diff --git a/.github/workflows/build/osx/action.yml b/.github/workflows/build/osx/action.yml index 19d1b03..038df53 100644 --- a/.github/workflows/build/osx/action.yml +++ b/.github/workflows/build/osx/action.yml @@ -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 diff --git a/.github/workflows/build/windows/action.yml b/.github/workflows/build/windows/action.yml index 84f020b..4714eb4 100644 --- a/.github/workflows/build/windows/action.yml +++ b/.github/workflows/build/windows/action.yml @@ -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 From 0f01e89c5874d24705417798c6af93a39ac91555 Mon Sep 17 00:00:00 2001 From: Tristan Youngs Date: Thu, 12 Feb 2026 09:56:10 +0000 Subject: [PATCH 3/4] Conan profile detect. --- .github/workflows/build/linux/action.yml | 1 + .github/workflows/build/osx/action.yml | 1 + .github/workflows/build/windows/action.yml | 2 +- 3 files changed, 3 insertions(+), 1 deletion(-) diff --git a/.github/workflows/build/linux/action.yml b/.github/workflows/build/linux/action.yml index 70f6cc6..9a53c87 100644 --- a/.github/workflows/build/linux/action.yml +++ b/.github/workflows/build/linux/action.yml @@ -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 diff --git a/.github/workflows/build/osx/action.yml b/.github/workflows/build/osx/action.yml index 038df53..7d579ef 100644 --- a/.github/workflows/build/osx/action.yml +++ b/.github/workflows/build/osx/action.yml @@ -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 diff --git a/.github/workflows/build/windows/action.yml b/.github/workflows/build/windows/action.yml index 4714eb4..f1bbed6 100644 --- a/.github/workflows/build/windows/action.yml +++ b/.github/workflows/build/windows/action.yml @@ -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 From 5972fa3fedfd9acfd78096c45cd00a8bd9a6d14b Mon Sep 17 00:00:00 2001 From: Tristan Youngs Date: Thu, 12 Feb 2026 10:00:30 +0000 Subject: [PATCH 4/4] Fix workflow inputs. --- .github/workflows/build/action.yml | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/.github/workflows/build/action.yml b/.github/workflows/build/action.yml index 93c5d6a..9e264f0 100644 --- a/.github/workflows/build/action.yml +++ b/.github/workflows/build/action.yml @@ -1,6 +1,11 @@ name: Build description: Stub action for multi-platform builds +inputs: + cacheOnly: + type: boolean + default: false + runs: using: "composite" steps: @@ -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'