Skip to content

Commit

Permalink
Merge pull request #184 from ipadjen/fix/win-build
Browse files Browse the repository at this point in the history
Improve github actions
  • Loading branch information
hugoledoux authored Jul 19, 2024
2 parents 055c3e7 + 0bc80b0 commit a6804b7
Show file tree
Hide file tree
Showing 3 changed files with 72 additions and 15 deletions.
58 changes: 58 additions & 0 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,58 @@
name: Build

on:
push:
# branches: [ main, develop ]
pull_request:
workflow_dispatch:

# A workflow run is made up of one or more jobs that can run sequentially or in parallel
jobs:
build-linux:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- name: Install dependencies
run: |
sudo apt-get update
sudo apt-get install libgmp-dev libmpfr-dev libboost-all-dev libeigen3-dev libgeos-dev
- name: Download CGAL
run: |
wget https://github.com/CGAL/cgal/releases/download/v5.6.1/CGAL-5.6.1-library.tar.xz -P ${{ github.workspace }}
cd ${{ github.workspace }}
tar -xvf CGAL-5.6.1-library.tar.xz
- name: Build
run: |
mkdir build && cd build
cmake .. -DCGAL_DIR=${{ github.workspace }}/CGAL-5.6.1 && make -j4
build-macos:
runs-on: macos-latest
steps:
- uses: actions/checkout@v4
- name: Install dependencies
run: |
brew update
brew upgrade || true
brew install cmake boost cgal eigen geos
- name: Build
run: |
mkdir build && cd build
cmake .. && make -j4
build-windows:
runs-on: windows-latest
env:
VCPKG_DEFAULT_TRIPLET: x64-windows
VCPKG_INSTALLATION_ROOT: C:\vcpkg
VCPKG_FEATURE_FLAGS: manifests
steps:
- uses: actions/checkout@v4
- name: Build
run: |
vcpkg install
mkdir Release
cd Release
cmake .. -DCMAKE_TOOLCHAIN_FILE="$env:VCPKG_INSTALLATION_ROOT\scripts\buildsystems\vcpkg.cmake" -DVCPKG_TARGET_TRIPLET=x64-windows
cmake --build . --parallel 4 --config Release
Original file line number Diff line number Diff line change
@@ -1,19 +1,17 @@
# This is a basic workflow to help you get started with Actions

name: CI

name: Win CD

# on:
# push:
# branches: [ main, develop ]

on:
release:
types: [created]
types: [published]
workflow_dispatch:

# A workflow run is made up of one or more jobs that can run sequentially or in parallel
jobs:
Windows-build:
build-windows:
name: Build Windows
runs-on: windows-latest
env:
Expand All @@ -37,4 +35,4 @@ jobs:
uses: actions/upload-artifact@main
with:
name: val3dity-win64
path: Release/val3dity-win64.zip
path: Release/val3dity-win64.zip
17 changes: 9 additions & 8 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,6 @@ cmake_minimum_required (VERSION 3.16)
project( val3dity )



add_definitions(-std=c++14)

set( CMAKE_BUILD_TYPE "Release")
Expand Down Expand Up @@ -46,17 +45,20 @@ include(CGAL_Eigen3_support)
find_package( Boost REQUIRED COMPONENTS filesystem)

if ( NOT Boost_FOUND )
message(SEND_ERROR "val3dity requires the Boost library")
message( SEND_ERROR "val3dity requires the Boost library" )
return()
endif()

# GEOS
find_package( GEOS REQUIRED )
if ( NOT GEOS_FOUND )
message(SEND_ERROR "val3dity requires the GEOS library")
find_package( GEOS CONFIG REQUIRED )
if ( GEOS_FOUND )
get_target_property(GEOS_LOCATION GEOS::geos_c LOCATION)
message( STATUS "Found GEOS: ${GEOS_LOCATION}" )
else()
message( SEND_ERROR "val3dity requires the GEOS library" )
endif()

include_directories( ${GEOS_INCLUDE_DIR} )
#include_directories( ${GEOS_INCLUDE_DIR} )
include_directories( ${CMAKE_CURRENT_SOURCE_DIR}/thirdparty )

FILE(GLOB_RECURSE THIRDPARTY thirdparty/*.cpp)
Expand All @@ -77,7 +79,6 @@ else()
add_executable(val3dity ${SRC_FILES})
endif()


target_link_libraries(val3dity CGAL::CGAL CGAL::Eigen3_support ${GEOS_LIBRARY} val3dity_thirdparty Boost::filesystem)
target_link_libraries(val3dity CGAL::CGAL CGAL::Eigen3_support GEOS::geos_c val3dity_thirdparty Boost::filesystem)

install(TARGETS val3dity DESTINATION bin)

0 comments on commit a6804b7

Please sign in to comment.