Skip to content

Commit

Permalink
Merge remote-tracking branch 'origin/develop'
Browse files Browse the repository at this point in the history
  • Loading branch information
qucals committed Aug 24, 2021
2 parents 5ebceff + 18cc21a commit e2c4cb1
Show file tree
Hide file tree
Showing 23 changed files with 864 additions and 366 deletions.
51 changes: 0 additions & 51 deletions .github/workflows/cmake_github.yml

This file was deleted.

55 changes: 55 additions & 0 deletions .github/workflows/macos.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,55 @@
name: MacOS

on:
push:
branches:
- master
- develop
pull_request:
branches: [ master ]

env:
BUILD_TYPE: Release
CMAKE_BUILD_DIR: ${{ github.workspace }}/build/

jobs:
build:
name: Deploy on MacOS
runs-on: macos-latest

steps:
- uses: actions/checkout@v2
with:
submodules: true

- name: Install deps
run: |
brew update
brew install curl
- name: Configure VKAPI Library CMake
run: cmake -B ${{ env.CMAKE_BUILD_DIR }} -DBUILD_EXAMPLES=OFF -DCMAKE_BUILD_TYPE=${{ env.BUILD_TYPE }}

- name: Build VKAPI Library
run: cmake --build ${{ env.CMAKE_BUILD_DIR }} --config ${{ env.BUILD_TYPE }}

- name: Install VKAPI Library
run: cmake --build ${{ env.CMAKE_BUILD_DIR }} --target install --config ${{ env.BUILD_TYPE }}

# Configure, Build and Install WE - With Examples
- name: Configure VKAPI Library CMake WE
run: cmake -B ${{ env.CMAKE_BUILD_DIR }} -DBUILD_EXAMPLES=ON -DCMAKE_BUILD_TYPE=${{ env.BUILD_TYPE }}

- name: Build VKAPI Library WE
run: cmake --build ${{ env.CMAKE_BUILD_DIR }} --config ${{ env.BUILD_TYPE }}

- name: Install VKAPI Library WE
run: cmake --build ${{ env.CMAKE_BUILD_DIR }} --target install --config ${{ env.BUILD_TYPE }}

- name: Test
working-directory: ${{ env.CMAKE_BUILD_DIR }}
# Execute tests defined by the CMake configuration.
# See https://cmake.org/cmake/help/latest/manual/ctest.1.html for more detail
run: ctest -C ${{ env.BUILD_TYPE }}


56 changes: 56 additions & 0 deletions .github/workflows/ubuntu.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,56 @@
name: Ubuntu

on:
push:
branches:
- master
- develop
pull_request:
branches: [ master ]

env:
BUILD_TYPE: Release
CMAKE_BUILD_DIR: ${{ github.workspace }}/build/

jobs:
build:
name: Deploy on Ubuntu
runs-on: ubuntu-latest

steps:
- uses: actions/checkout@v2
with:
submodules: true

- name: Install deps
run: |
sudo apt update
sudo apt upgrade
sudo apt install curl
sudo apt-get install libcurl4-openssl-dev
- name: Configure VKAPI Library CMake
run: cmake -B ${{ env.CMAKE_BUILD_DIR }} -DBUILD_EXAMPLES=OFF -DCMAKE_BUILD_TYPE=${{ env.BUILD_TYPE }}

- name: Build VKAPI Library
run: cmake --build ${{ env.CMAKE_BUILD_DIR }} --config ${{ env.BUILD_TYPE }}

- name: Install VKAPI Library
run: cmake --build ${{ env.CMAKE_BUILD_DIR }} --target install --config ${{ env.BUILD_TYPE }}

# Configure, Build and Install WE - With Examples
- name: Configure VKAPI Library CMake WE
run: cmake -B ${{ env.CMAKE_BUILD_DIR }} -DBUILD_EXAMPLES=ON -DCMAKE_BUILD_TYPE=${{ env.BUILD_TYPE }}

- name: Build VKAPI Library WE
run: cmake --build ${{ env.CMAKE_BUILD_DIR }} --config ${{ env.BUILD_TYPE }}

- name: Install VKAPI Library WE
run: cmake --build ${{ env.CMAKE_BUILD_DIR }} --target install --config ${{ env.BUILD_TYPE }}

- name: Test
working-directory: ${{ env.CMAKE_BUILD_DIR }}
# Execute tests defined by the CMake configuration.
# See https://cmake.org/cmake/help/latest/manual/ctest.1.html for more detail
run: ctest -C ${{ env.BUILD_TYPE }}

56 changes: 56 additions & 0 deletions .github/workflows/windows.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,56 @@
name: Windows

on:
push:
branches:
- master
- develop
pull_request:
branches: [ master ]

env:
BUILD_TYPE: Release
CMAKE_BUILD_DIR: ${{ github.workspace }}/build

jobs:
build:
name: Deploy on Windows
runs-on: windows-latest

steps:
- uses: actions/checkout@v2
with:
submodules: true

- name: Install deps
uses: crazy-max/ghaction-chocolatey@v1
with:
args: install curl

- name: Configure VKAPI Library CMake
run: |
cd ${{ github.workspace }}
mkdir build
cmake -B ${{ env.CMAKE_BUILD_DIR }} -DBUILD_EXAMPLES=OFF -DCMAKE_BUILD_TYPE=${{ env.BUILD_TYPE }}
- name: Build VKAPI Library
run: cmake --build ${{ env.CMAKE_BUILD_DIR }} --config ${{ env.BUILD_TYPE }}

- name: Install VKAPI Library
run: cmake --build ${{ env.CMAKE_BUILD_DIR }} --target install --config ${{ env.BUILD_TYPE }}

# Configure, Build and Install WE - With Examples
- name: Configure VKAPI Library CMake WE
run: cmake -B ${{ env.CMAKE_BUILD_DIR }} -DBUILD_EXAMPLES=ON -DCMAKE_BUILD_TYPE=${{ env.BUILD_TYPE }}

- name: Build VKAPI Library WE
run: cmake --build ${{ env.CMAKE_BUILD_DIR }} --config ${{ env.BUILD_TYPE }}

- name: Install VKAPI Library WE
run: cmake --build ${{ env.CMAKE_BUILD_DIR }} --target install --config ${{ env.BUILD_TYPE }}

- name: Test
working-directory: ${{ env.CMAKE_BUILD_DIR }}
# Execute tests defined by the CMake configuration.
# See https://cmake.org/cmake/help/latest/manual/ctest.1.html for more detail
run: ctest -C ${{ env.BUILD_TYPE }}
Empty file added .gitmodules
Empty file.
18 changes: 14 additions & 4 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,10 @@ file(GLOB TARGET_HEADERS "./include/*.hpp")
if(BUILD_LIBRARY)
add_library(${PROJECT_NAME} STATIC ${TARGET_SRC} ${TARGET_HEADERS})
else()
set(CMAKE_CXX_FLAGS " -lcurl")
if(UNIX)
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -pthread")
endif()
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -lcurl")
add_executable(${PROJECT_NAME} ${TARGET_SRC} ${TARGET_HEADERS})
endif()

Expand All @@ -39,10 +42,17 @@ target_include_directories(${PROJECT_NAME} PUBLIC ${CMAKE_INSTALL_INCLUDEDIR})
# Include json
target_link_directories(${PROJECT_NAME} PUBLIC ${NLOHMANN_JSON_PATH})

add_definitions(-DCURL_STATICLIB)
# Link curl
if(UNIX)
find_package(CURL REQUIRED)
target_link_directories(${PROJECT_NAME} PUBLIC ${CURL_INCLUDE_DIR})
else()
include(FindPkgConfig)
# find_package(CURL REQUIRED)
pkg_check_modules(CURL libcurl REQUIRED)
endif()

find_package(CURL REQUIRED)
target_link_directories(${PROJECT_NAME} PUBLIC ${CURL_INCLUDE_DIR})
target_link_libraries(${PROJECT_NAME} PUBLIC CURL::libcurl)

set_target_properties(
${PROJECT_NAME} PROPERTIES
Expand Down
7 changes: 6 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,12 @@
<div align="center">

[![Status](https://img.shields.io/badge/status-active-success.svg)]()
![Workflow](https://github.com/qucals/VK-API/actions/workflows/cmake_github.yml/badge.svg)
[![CodeFactor](https://www.codefactor.io/repository/github/qucals/VK-API/badge/master)](https://www.codefactor.io/repository/github/qucals/VK-API/overview/master)
<br>
[![Workflow](https://github.com/qucals/VK-API/actions/workflows/macos.yml/badge.svg)]()
[![Workflow](https://github.com/qucals/VK-API/actions/workflows/ubuntu.yml/badge.svg)]()
[![Workflow](https://github.com/qucals/VK-API/actions/workflows/windows.yml/badge.svg)]()
<br>
[![GitHub Issues](https://img.shields.io/github/issues/qucals/VK-API.svg)](https://github.com/qucals/VK-API/issues)
[![GitHub Pull Requests](https://img.shields.io/github/issues-pr/qucals/VK-API.svg)](https://github.com/qucals/VK-API/pulls)
[![License](https://img.shields.io/github/license/qucals/VK-API)](/LICENSE)
Expand Down
5 changes: 4 additions & 1 deletion examples/1/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,10 @@ cmake_minimum_required(VERSION 3.5)
set(PROJECT_NAME Example1)
project(${PROJECT_NAME} LANGUAGES CXX)

set(CMAKE_CXX_FLAGS "-lcurl")
if(UNIX)
set(CMAKE_CXX_FLAGS "-L/usr/local/lib/ -L/usr/lib/ ${CMAKE_CXX_FLAGS} -pthread")
endif()
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -lcurl")

set(VKAPI_DIR ../../lib/cmake)
find_package(VKAPI CONFIG REQUIRED)
Expand Down
5 changes: 4 additions & 1 deletion examples/2/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,10 @@ cmake_minimum_required(VERSION 3.5)
set(PROJECT_NAME Example2)
project(${PROJECT_NAME} LANGUAGES CXX)

set(CMAKE_CXX_FLAGS "-lcurl")
if(UNIX)
set(CMAKE_CXX_FLAGS "-L/usr/local/lib/ -L/usr/lib/ ${CMAKE_CXX_FLAGS} -pthread")
endif()
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -lcurl")

set(VKAPI_DIR ../../lib/cmake)
find_package(VKAPI CONFIG REQUIRED)
Expand Down
Loading

0 comments on commit e2c4cb1

Please sign in to comment.