Skip to content

Commit

Permalink
GH-actions and CMake: fix ImGui builds.
Browse files Browse the repository at this point in the history
Also deactivated ImGui build for coverage builds etc.
  • Loading branch information
GPMueller committed Dec 22, 2020
1 parent eb61ec6 commit 19a962f
Show file tree
Hide file tree
Showing 2 changed files with 27 additions and 6 deletions.
18 changes: 12 additions & 6 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -27,13 +27,19 @@ jobs:
build-type: Release
env:
BUILD_TYPE: ${{ matrix.build-type }}
CMAKE_FLAGS: -DSPIRIT_UI_CXX_USE_QT=OFF
CMAKE_FLAGS: -DSPIRIT_UI_USE_IMGUI=ON -DSPIRIT_UI_CXX_USE_QT=OFF
OMP_NUM_THREADS: 4
EXCLUDETESTS: ${{ matrix.excludetests }}

steps:
- uses: actions/checkout@v2

- name: Install required system packages
if: matrix.os == 'ubuntu-latest'
run: |
sudo apt update
sudo apt install xorg-dev libglu1-mesa-dev libgtk-3-dev
- name: Create build folder
run: cmake -E make_directory ${{runner.workspace}}/build

Expand Down Expand Up @@ -66,7 +72,7 @@ jobs:
runs-on: ubuntu-latest
env:
BUILD_TYPE: Release
CMAKE_FLAGS: -DSPIRIT_UI_CXX_USE_QT=OFF -DSPIRIT_TEST_COVERAGE=ON
CMAKE_FLAGS: -DSPIRIT_UI_USE_IMGUI=OFF -DSPIRIT_UI_CXX_USE_QT=OFF -DSPIRIT_TEST_COVERAGE=ON

steps:
- uses: actions/checkout@v2
Expand Down Expand Up @@ -119,7 +125,7 @@ jobs:
runs-on: ubuntu-latest
env:
BUILD_TYPE: Release
CMAKE_FLAGS: -DSPIRIT_UI_CXX_USE_QT=OFF -DSPIRIT_ENABLE_PINNING=ON -DSPIRIT_ENABLE_DEFECTS=ON
CMAKE_FLAGS: -DSPIRIT_UI_USE_IMGUI=OFF -DSPIRIT_UI_CXX_USE_QT=OFF -DSPIRIT_ENABLE_PINNING=ON -DSPIRIT_ENABLE_DEFECTS=ON

steps:
- uses: actions/checkout@v2
Expand Down Expand Up @@ -155,7 +161,7 @@ jobs:
- os: ubuntu-18.04
env:
BUILD_TYPE: Release
CMAKE_FLAGS: -DSPIRIT_UI_CXX_USE_QT=OFF -DSPIRIT_USE_CUDA=ON -DSPIRIT_CUDA_ARCH=sm_70
CMAKE_FLAGS: -DSPIRIT_UI_USE_IMGUI=OFF -DSPIRIT_UI_CXX_USE_QT=OFF -DSPIRIT_USE_CUDA=ON -DSPIRIT_CUDA_ARCH=sm_70

steps:
- uses: actions/checkout@v2
Expand All @@ -180,7 +186,7 @@ jobs:
runs-on: ubuntu-18.04
env:
BUILD_TYPE: Release
CMAKE_FLAGS: -DSPIRIT_UI_CXX_USE_QT=ON
CMAKE_FLAGS: -DSPIRIT_UI_USE_IMGUI=OFF -DSPIRIT_UI_CXX_USE_QT=ON

steps:
- uses: actions/checkout@v2
Expand Down Expand Up @@ -247,7 +253,7 @@ jobs:
os: [ubuntu-latest, macos-latest, windows-latest]
env:
BUILD_TYPE: Release
CMAKE_FLAGS: -DSPIRIT_UI_CXX_USE_QT=OFF
CMAKE_FLAGS: -DSPIRIT_UI_USE_IMGUI=OFF -DSPIRIT_UI_CXX_USE_QT=OFF
SPIRIT_ADD_VERSION_SUFFIX: true

steps:
Expand Down
15 changes: 15 additions & 0 deletions ui-cpp/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -182,6 +182,21 @@ if( SPIRIT_UI_USE_IMGUI )
target_sources( nativefiledialog PRIVATE ${NFD_SRC_DIR}/nfd_emscripten.cpp )
elseif( UNIX )
target_sources( nativefiledialog PRIVATE ${NFD_SRC_DIR}/nfd_gtk.c )

# Use the package PkgConfig to detect GTK+ headers/library files
FIND_PACKAGE( PkgConfig REQUIRED )
PKG_CHECK_MODULES( GTK REQUIRED gtk+-3.0 )

# Setup CMake to use GTK+, tell the compiler where to look for headers
# and the linker where to look for libraries
target_include_directories( nativefiledialog PUBLIC ${GTK_INCLUDE_DIRS} )
target_link_directories( nativefiledialog PUBLIC ${GTK_LIBRARY_DIRS} )

# Add other flags to the compiler
add_definitions( ${GTK_CFLAGS_OTHER} )

# Link the target to the GTK+ libraries
target_link_libraries( nativefiledialog ${GTK_LIBRARIES} )
endif()
endif()
####################################################################
Expand Down

0 comments on commit 19a962f

Please sign in to comment.