Skip to content
Closed
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
48 changes: 0 additions & 48 deletions .github/workflows/_build_and_package.yml
Original file line number Diff line number Diff line change
Expand Up @@ -61,51 +61,3 @@ jobs:
conanHash: ${{ inputs.conanHash }}
msvcVersion: ${{ inputs.msvcVersion }}
osxTargetDeploymentVersion: ${{ inputs.osxTargetDeploymentVersion }}

BuildLinux:
strategy:
fail-fast: false
matrix:
target: [ dissolve, dissolve-gui ]
runs-on: ubuntu-latest
steps:
- name: 'Download Source Tarfiles'
uses: actions/download-artifact@v4
with:
name: source

- name: 'Unpack Source'
shell: bash
run: tar -xvf dissolve-versioned-source.tar

- name: "Build, Test, Package (Linux, ${{ matrix.target }})"
uses: "./.github/workflows/build"
with:
target: ${{ matrix.target }}
currentVersion: ${{ inputs.currentVersion }}
nixHash: ${{ inputs.nixHash }}
benchmark: ${{ inputs.benchmark }}
publishBenchmarks: ${{ inputs.publishBenchmarks }}

Package:
needs: Build
strategy:
fail-fast: false
matrix:
os: [ "${{ inputs.osxRunner }}", windows-latest ]
runs-on: ${{ matrix.os }}
steps:
- name: 'Download Source Tarfiles'
uses: actions/download-artifact@v4
with:
name: source

- name: 'Unpack Source'
shell: bash
run: tar -xvf dissolve-versioned-source.tar

- name: "Package (${{ matrix.os }})"
uses: "./.github/workflows/package"
with:
currentVersion: ${{ inputs.currentVersion }}
qtVersion: ${{ inputs.qtVersion }}
2 changes: 1 addition & 1 deletion .github/workflows/_checkout.yml
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ on:
default: "1.2.5"
conanfile:
type: string
default: cmake/Modules/conan-dissolve.cmake
default: conanfile.txt
publishType:
default: 'none'
type: string
Expand Down
4 changes: 2 additions & 2 deletions .github/workflows/build/osx/action.yml
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,7 @@ runs:
- name: Install Python Dependencies
shell: bash
run: |
pip3 install aqtinstall conan==1.* --break-system-packages
pip3 install aqtinstall conan --break-system-packages

- name: Install Qt
shell: bash
Expand Down Expand Up @@ -166,7 +166,7 @@ runs:
echo "Java Runtime Executable: ${JAVA_RUNTIME}"

# Set conan cache location
conan config set storage.download_cache="${GITHUB_WORKSPACE}/.conancache"
conan config home -cc core.download:download_cache="${GITHUB_WORKSPACE}/.conancache"

# Set minimum deployment target version
export MACOSX_DEPLOYMENT_TARGET=${{ inputs.targetDeploymentVersion }}
Expand Down
8 changes: 3 additions & 5 deletions .github/workflows/build/windows/action.yml
Original file line number Diff line number Diff line change
Expand Up @@ -63,7 +63,7 @@ runs:

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

#
# Install Qt
Expand Down Expand Up @@ -172,9 +172,7 @@ runs:
if: ${{ steps.cache-conan.outputs.cache-hit != 'true' }}
shell: bash
run: |
conan profile new default --detect --force
conan profile update settings.compiler="Visual Studio" default
conan profile update settings.compiler.version=17 default
conan profile detect

- name: Build
if: ${{ inputs.cacheOnly == 'false' }}
Expand All @@ -192,7 +190,7 @@ runs:
JAVA_EXE="${JAVA_HOME_21_X64}\bin\java.exe"

# Set conan cache location
conan config set storage.download_cache="${GITHUB_WORKSPACE}/.conancache"
conan config home -cc core.download:download_cache="${GITHUB_WORKSPACE}/.conancache"

# Build
mkdir build && cd build
Expand Down
15 changes: 0 additions & 15 deletions .github/workflows/pr.yml
Original file line number Diff line number Diff line change
Expand Up @@ -21,12 +21,6 @@ jobs:
with:
checkoutRef: ${{ github.event.pull_request.head.sha }}

QC:
needs: [Checkout]
uses: "./.github/workflows/_qc.yml"
with:
nixHash: ${{ needs.Checkout.outputs.nixHash }}

BuildAndPackage:
needs: [Checkout]
uses: "./.github/workflows/_build_and_package.yml"
Expand All @@ -47,12 +41,3 @@ jobs:
uses: "./.github/workflows/_clean_cache.yml"
with:
branch: 'refs/pull/${{ github.event.pull_request.number }}/merge'

Web:
needs: [Checkout]
uses: "./.github/workflows/_website.yml"
with:
publishType: 'none'
displayMajorVersion: ${{ needs.Checkout.outputs.currentVersionMajor }}
displayMinorVersion: ${{ needs.Checkout.outputs.currentVersionMinor }}
hugoVersion: ${{ needs.Checkout.outputs.hugoVersion }}
85 changes: 47 additions & 38 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -1,5 +1,28 @@
cmake_minimum_required(VERSION 3.15)
project(Dissolve)
cmake_minimum_required(VERSION 3.24)

# 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)

# Set up the project
project(Dissolve LANGUAGES CXX C)

# Add our custom module search path
list(APPEND CMAKE_MODULE_PATH "${PROJECT_SOURCE_DIR}/cmake/Modules")

set(DESCRIPTION "Dissolve")
set(AUTHOR "Team Dissolve")
Expand All @@ -20,32 +43,12 @@ cmake_policy(SET CMP0020 NEW)
# Request C++17 Standard Support (Required for std::optional and auto types in lambda parameters)
set(CMAKE_CXX_STANDARD 20)

# Add our custom module search path
list(APPEND CMAKE_MODULE_PATH "${PROJECT_SOURCE_DIR}/cmake/Modules")

# We are setting up a development environment in MSVC
option(MSVC_DEV "Configuration is for a Visual Studio 2022 dev environment" OFF)

# Install GSL (GNU Scientific Library) with Conan for Windows and Unix-like systems
option(CONAN_GSL "Use conan to find GSL" ON)

# Include Conan Packages
option(CONAN "Use conan to find dependencies" ON)
if(CONAN)
if(CONAN_GSL)
list(APPEND EXTRA_CONAN_REQUIRES gsl/2.7.1)
endif(CONAN_GSL)
# Add local dirs to cmake Module search path
list(APPEND CMAKE_MODULE_PATH ${CMAKE_BINARY_DIR})
list(APPEND CMAKE_PREFIX_PATH ${CMAKE_BINARY_DIR})

if(BUILD_BENCHMARKS)
list(APPEND EXTRA_CONAN_REQUIRES benchmark/1.8.4)
endif(BUILD_BENCHMARKS)

include(conan-dissolve)
endif(CONAN)

# Find core dependencies
set(CORE_LINK_LIBS "")
find_package(CLI11 REQUIRED)
Expand All @@ -64,20 +67,25 @@ list(APPEND CORE_LINK_LIBS ${GSL_LIBS})
set(antlr4-cppruntime_INCLUDE_DIRS "")
set(antlr4-cppruntime_LIBS "")
find_package(antlr4-runtime REQUIRED)
if(NOT antlr4-cppruntime_INCLUDE_DIRS)
# nix
if(ANTLR4_INCLUDE_DIR)
set(antlr4-cppruntime_INCLUDE_DIRS ${ANTLR4_INCLUDE_DIR})
link_directories(${ANTLR4_LIB_DIR})
set(antlr4-cppruntime_LIBS "antlr4-runtime")
else(ANTLR4_INCLUDE_DIR)
message(ERROR "Failed to find Antlr4 cpp runtime.")
endif(ANTLR4_INCLUDE_DIR)
endif(NOT antlr4-cppruntime_INCLUDE_DIRS)
message(STATUS "Antlr4 cpp runtime includes: ${antlr4-cppruntime_INCLUDE_DIRS}")
message(STATUS "Antlr4 cpp runtime libs: ${antlr4-cppruntime_LIBS}")
include_directories(${antlr4-cppruntime_INCLUDE_DIRS})
list(APPEND CORE_LINK_LIBS ${antlr4-cppruntime_LIBS})
if(CONAN)
include_directories(${antlr4-runtime_INCLUDE_DIRS})
list(APPEND CORE_LINK_LIBS antlr4_shared)
else(CONAN)
if(NOT antlr4-cppruntime_INCLUDE_DIRS)
# nix
if(ANTLR4_INCLUDE_DIR)
set(antlr4-cppruntime_INCLUDE_DIRS ${ANTLR4_INCLUDE_DIR})
link_directories(${ANTLR4_LIB_DIR})
set(antlr4-cppruntime_LIBS "antlr4-runtime")
else(ANTLR4_INCLUDE_DIR)
message(ERROR "Failed to find Antlr4 cpp runtime.")
endif(ANTLR4_INCLUDE_DIR)
endif(NOT antlr4-cppruntime_INCLUDE_DIRS)
message(STATUS "Antlr4 cpp runtime includes: ${antlr4-cppruntime_INCLUDE_DIRS}")
message(STATUS "Antlr4 cpp runtime libs: ${antlr4-cppruntime_LIBS}")
include_directories(${antlr4-cppruntime_INCLUDE_DIRS})
list(APPEND CORE_LINK_LIBS ${antlr4-cppruntime_LIBS})
endif(CONAN)

# Find Antlr4 Java Binary
find_package(ANTLR REQUIRED)
Expand All @@ -97,11 +105,12 @@ if(MULTI_THREADING)
add_definitions("-DMULTITHREADING")
find_package(TBB REQUIRED)
include_directories(${TBB_INCLUDE_DIRS})
include_directories(${DPL_INCLUDE_DIRS})
list(APPEND THREADING_LINK_LIBS "TBB::tbb")
if(CONAN)
find_package(ParallelSTL REQUIRED)
include_directories(${pstl_ParallelSTL_INCLUDE_DIRS})
list(APPEND THREADING_LINK_LIBS ${pstl_ParallelSTL_LINK_LIBS})
include_directories(${ParallelSTL_INCLUDE_DIRS})
list(APPEND THREADING_LINK_LIBS ${ParallelSTL_LINK_LIBS})
endif(CONAN)
message("Threading Link Libs: ${THREADING_LINK_LIBS}")
endif(MULTI_THREADING)
Expand Down
43 changes: 0 additions & 43 deletions cmake/Modules/conan-dissolve.cmake

This file was deleted.

20 changes: 20 additions & 0 deletions conanfile.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
[requires]
cli11/1.9.1
pugixml/1.11
onetbb/2021.10.0
onedpl/2022.3.0
toml11/3.7.0
antlr4-cppruntime/4.13.1
gsl/2.7.1
gtest/1.16.0
benchmark/1.8.4

[options]
pugixml/*:header_only=False
antlr4-cppruntime/*:shared=True

[layout]
cmake_layout

[generators]
CMakeDeps
4 changes: 2 additions & 2 deletions src/gui/models/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -156,8 +156,8 @@ find_package(Qt6 REQUIRED COMPONENTS Core Qml)
add_library(models ${models_SRCS} ${models_MOC_SRCS} ${types_SRCS})

target_include_directories(
models PRIVATE ${PROJECT_SOURCE_DIR}/src ${PROJECT_BINARY_DIR}/src ${CONAN_INCLUDE_DIRS_PUGIXML} ${Qt6Widgets_INCLUDE_DIRS}
${FREETYPE_INCLUDE_DIRS} ${Qt6Quick_INCLUDE_DIRS}
models PRIVATE ${PROJECT_SOURCE_DIR}/src ${PROJECT_BINARY_DIR}/src ${Qt6Widgets_INCLUDE_DIRS} ${FREETYPE_INCLUDE_DIRS}
${Qt6Quick_INCLUDE_DIRS}
)

target_link_libraries(models PRIVATE Qt6::Core Qt6::Qml)
Expand Down
Loading