Skip to content

Commit

Permalink
Merge pull request #12 from LBNL-ETA/MovingOutBSDFXMLParser
Browse files Browse the repository at this point in the history
Moving out bsdfxml parser
  • Loading branch information
vidanovic authored Dec 2, 2024
2 parents 6dfce87 + 79423a8 commit 58908bb
Show file tree
Hide file tree
Showing 32 changed files with 324 additions and 2,591 deletions.
70 changes: 65 additions & 5 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
@@ -1,23 +1,49 @@
name: Build and test

on: [push, pull_request]
on: [push, pull_request]

env:
# Customize the CMake build type here (Release, Debug, RelWithDebInfo, etc.)
BUILD_TYPE: Release

jobs:
build:
windows:
name: ${{ matrix.os }}-${{ matrix.arch }}
runs-on: ${{ matrix.os }}
strategy:
fail-fast: false
matrix:
os: [windows-2019, windows-2022]
arch: [x86, x64]

steps:
- name: Checkout repository
uses: actions/checkout@v4

- name: Configure CMake
# Configure CMake in a 'build' subdirectory. `CMAKE_BUILD_TYPE` is only required if you are using a single-configuration generator such as make.
# See https://cmake.org/cmake/help/latest/variable/CMAKE_BUILD_TYPE.html?highlight=cmake_build_type
run: cmake -B ${{github.workspace}}/build -DCMAKE_BUILD_TYPE=${{env.BUILD_TYPE}}

- name: Build
# Build your program with the given configuration
run: cmake --build ${{github.workspace}}/build --config ${{env.BUILD_TYPE}}

- name: Test
working-directory: ${{github.workspace}}/build
run: ctest -C RELEASE -V

mac:
name: ${{ matrix.os }}
runs-on: ${{ matrix.os }}
strategy:
fail-fast: false
matrix:
os: [windows-2019, macos-latest, ubuntu-latest]
#arch: [x86, x64]
os: [macos-13, macos-latest]

steps:
- name: Checkout repository
uses: actions/checkout@v2
uses: actions/checkout@v4

- name: Configure CMake
# Configure CMake in a 'build' subdirectory. `CMAKE_BUILD_TYPE` is only required if you are using a single-configuration generator such as make.
Expand All @@ -31,3 +57,37 @@ jobs:
- name: Test
working-directory: ${{github.workspace}}/build
run: ctest -C RELEASE -V

linux:
name: ${{ matrix.os }}-${{ matrix.arch }}
runs-on: ${{ matrix.os }}
strategy:
fail-fast: false
matrix:
os: [ ubuntu-24.04]
arch: [x86_64, aarch64]

steps:
- name: Checkout repository
uses: actions/checkout@v4

- name: Install QEMU for aarch64 emulation
uses: docker/setup-qemu-action@v2
with:
platforms: all

- name: Upgrade gcc
run: sudo apt-get install -y gcc g++

- name: Configure CMake
# Configure CMake in a 'build' subdirectory. `CMAKE_BUILD_TYPE` is only required if you are using a single-configuration generator such as make.
# See https://cmake.org/cmake/help/latest/variable/CMAKE_BUILD_TYPE.html?highlight=cmake_build_type
run: cmake -B ${{github.workspace}}/build -DCMAKE_BUILD_TYPE=${{env.BUILD_TYPE}}

- name: Build
# Build your program with the given configuration
run: cmake --build ${{github.workspace}}/build --config ${{env.BUILD_TYPE}}

- name: Test
working-directory: ${{github.workspace}}/build
run: ctest -C RELEASE -V
50 changes: 22 additions & 28 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -39,41 +39,31 @@ set(JSON_BuildTests OFF CACHE BOOL "")

include(FetchContent)

if(NOT TARGET nlohmann_json)
FetchContent_Declare(
nlohmann_json
GIT_REPOSITORY https://github.com/nlohmann/json.git
GIT_TAG "db53bda"
)

FetchContent_MakeAvailable(nlohmann_json)
endif()
set(nlohmann_Branch "v3.11.3")

if(NOT TARGET xmlParser)
FetchContent_Declare(
xmlParser
GIT_REPOSITORY https://github.com/LBNL-ETA/XMLParser.git
GIT_TAG "v1.0.1"
)
FetchContent_Declare(
nlohmann_json
GIT_REPOSITORY https://github.com/nlohmann/json.git
GIT_TAG ${nlohmann_Branch}
)
FetchContent_MakeAvailable(nlohmann_json)

FetchContent_MakeAvailable(xmlParser)
endif()

if(NOT TARGET FileParse)
set(BUILD_FileParse_tests OFF CACHE BOOL "Build FileParse tests" FORCE)
set(BUILD_BSDFXMLParser_Tests OFF CACHE BOOL "Build BSDFXMLParser tests" FORCE)

FetchContent_Declare(
FileParse
GIT_REPOSITORY https://github.com/LBNL-ETA/FileParse.git
GIT_TAG "Version_1.0"
)
set(BSDFXMLParser_Branch "Version_0.0.1")

FetchContent_MakeAvailable(FileParse)
endif()
FetchContent_Declare(
BSDFXMLParser
GIT_REPOSITORY https://github.com/LBNL-ETA/BSDFXMLParser.git
GIT_TAG ${BSDFXMLParser_Branch}
)

FetchContent_MakeAvailable(BSDFXMLParser)

# Set include directories for FileParse
set(FileParse_INCLUDE_DIRS "${fileparse_SOURCE_DIR}/include")
include_directories(${FileParse_INCLUDE_DIRS})
set(BSDFXMLParser_INCLUDE_DIRS "${bsdfxmlparser_SOURCE_DIR}/src")
include_directories(${BSDFXMLParser_INCLUDE_DIRS})

# Add your target
add_subdirectory(src)
Expand Down Expand Up @@ -102,3 +92,7 @@ if(BUILD_Optical_Measurement_Parser_Tests)
add_test(NAME OpticalMeasurementParser-test
COMMAND ${CMAKE_RUNTIME_OUTPUT_DIRECTORY}/OpticalMeasurementParser-test --gtest_catch_exceptions=0)
endif()

# Setting variable for parent projects so it can be checked if same version is used
set_property(TARGET ${LIB_NAME} PROPERTY BSDFXMLParser_Branch ${BSDFXMLParser_Branch})
set_property(TARGET ${LIB_NAME} PROPERTY nlohmann_Branch ${nlohmann_Branch})
165 changes: 0 additions & 165 deletions src/BSDFXML/Data.hpp

This file was deleted.

Loading

0 comments on commit 58908bb

Please sign in to comment.