CMake and GitHub Actions update installations

This commit is contained in:
Syping 2021-12-02 03:14:19 +01:00
parent 9132f92410
commit eed3290633
4 changed files with 28 additions and 48 deletions

View File

@ -1,20 +1,15 @@
name: Ubuntu name: Ubuntu
on: on: push
push:
branches: [ master ]
pull_request:
branches: [ master ]
env:
BUILD_TYPE: Release
jobs: jobs:
build: Release:
runs-on: ubuntu-latest runs-on: ubuntu-latest
env:
BUILD_TYPE: Release
steps: steps:
- uses: actions/checkout@v2 - uses: actions/checkout@v2
with: with:
submodules: recursive submodules: recursive
- name: Install packages - name: Install packages
run: | run: |
@ -25,13 +20,10 @@ jobs:
- name: Build - name: Build
run: cmake --build ${{github.workspace}}/build --config ${{env.BUILD_TYPE}} run: cmake --build ${{github.workspace}}/build --config ${{env.BUILD_TYPE}}
- name: Install - name: Install
run: sudo cmake --install ${{github.workspace}}/build --config ${{env.BUILD_TYPE}} run: cmake --install ${{github.workspace}}/build --config ${{env.BUILD_TYPE}} --prefix ${{github.workspace}}/install/usr/local
- name: Upload - name: Upload
uses: actions/upload-artifact@v2 uses: actions/upload-artifact@v2
with: with:
name: Ubuntu name: Ubuntu
path: | path: |
/usr/local/bin/ragephoto-extract ${{github.workspace}}/install/
/usr/local/lib/libragephoto.so
/usr/local/lib/pkgconfig/ragephoto.pc
/usr/local/include/RagePhoto/

View File

@ -1,20 +1,15 @@
name: WebAssembly name: WebAssembly
on: on: push
push:
branches: [ master ]
pull_request:
branches: [ master ]
env:
BUILD_TYPE: Release
jobs: jobs:
build: Release:
runs-on: ubuntu-latest runs-on: ubuntu-latest
env:
BUILD_TYPE: Release
steps: steps:
- uses: actions/checkout@v2 - uses: actions/checkout@v2
with: with:
submodules: recursive submodules: recursive
- name: Setup emsdk - name: Setup emsdk
uses: mymindstorm/setup-emsdk@v11 uses: mymindstorm/setup-emsdk@v11

View File

@ -1,20 +1,15 @@
name: Windows name: Windows
on: on: push
push:
branches: [ master ]
pull_request:
branches: [ master ]
env:
BUILD_TYPE: Release
jobs: jobs:
build: Release:
runs-on: windows-latest runs-on: windows-latest
env:
BUILD_TYPE: Release
steps: steps:
- uses: actions/checkout@v2 - uses: actions/checkout@v2
with: with:
submodules: recursive submodules: recursive
- uses: ilammy/msvc-dev-cmd@v1 - uses: ilammy/msvc-dev-cmd@v1
- name: Configure CMake - name: Configure CMake
@ -22,16 +17,10 @@ jobs:
- name: Build - name: Build
run: cmake --build ${{github.workspace}}/build --config ${{env.BUILD_TYPE}} run: cmake --build ${{github.workspace}}/build --config ${{env.BUILD_TYPE}}
- name: Install - name: Install
run: cmake --install ${{github.workspace}}/build --config ${{env.BUILD_TYPE}} --prefix ${{github.workspace}}/build run: cmake --install ${{github.workspace}}/build --config ${{env.BUILD_TYPE}} --prefix ${{github.workspace}}/install
- name: Upload - name: Upload
uses: actions/upload-artifact@v2 uses: actions/upload-artifact@v2
with: with:
name: Windows MSVC name: Windows MSVC
path: | path: |
${{github.workspace}}/build/libragephoto.dll ${{github.workspace}}/install/
${{github.workspace}}/build/libragephoto.dll.manifest
${{github.workspace}}/build/ragephoto.exp
${{github.workspace}}/build/ragephoto.lib
${{github.workspace}}/build/ragephoto-extract.exe
${{github.workspace}}/build/ragephoto-extract.exe.manifest
${{github.workspace}}/build/include/RagePhoto/

View File

@ -27,13 +27,11 @@ set(CMAKE_CXX_STANDARD_REQUIRED ON)
# RagePhoto CMake includes # RagePhoto CMake includes
include(cmake/unicode.cmake) include(cmake/unicode.cmake)
# RagePhoto WebAssembly ON/OFF # RagePhoto WebAssembly ON
if (EMSCRIPTEN) if (EMSCRIPTEN)
set(EM_ON ON) set(EM_ON ON)
set(EM_OFF OFF)
else() else()
set(EM_ON OFF) set(EM_ON OFF)
set(EM_OFF ON)
endif() endif()
# RagePhoto Source files # RagePhoto Source files
@ -105,9 +103,15 @@ target_include_directories(ragephoto PUBLIC
${ragephoto_BINARY_DIR}/include ${ragephoto_BINARY_DIR}/include
${ragephoto_SOURCE_DIR}/src ${ragephoto_SOURCE_DIR}/src
) )
install(TARGETS ragephoto DESTINATION ${CMAKE_INSTALL_LIBDIR}) install(TARGETS ragephoto
ARCHIVE DESTINATION ${CMAKE_INSTALL_LIBDIR}
LIBRARY DESTINATION ${CMAKE_INSTALL_LIBDIR}
RUNTIME DESTINATION ${CMAKE_INSTALL_BINDIR}
)
install(FILES ${RAGEPHOTO_HEADERS} DESTINATION ${CMAKE_INSTALL_INCLUDEDIR}/RagePhoto) install(FILES ${RAGEPHOTO_HEADERS} DESTINATION ${CMAKE_INSTALL_INCLUDEDIR}/RagePhoto)
install(FILES ${ragephoto_BINARY_DIR}/pkgconfig/ragephoto.pc DESTINATION ${CMAKE_INSTALL_LIBDIR}/pkgconfig) if (UNIX)
install(FILES ${ragephoto_BINARY_DIR}/pkgconfig/ragephoto.pc DESTINATION ${CMAKE_INSTALL_LIBDIR}/pkgconfig)
endif()
# RagePhoto WebAssembly Target # RagePhoto WebAssembly Target
if (EMSCRIPTEN) if (EMSCRIPTEN)