From eed329063399dfc6f102eeb91bbf9ae7b2a2ca63 Mon Sep 17 00:00:00 2001 From: Syping Date: Thu, 2 Dec 2021 03:14:19 +0100 Subject: [PATCH] CMake and GitHub Actions update installations --- .github/workflows/ubuntu.yml | 22 +++++++--------------- .github/workflows/webassembly.yml | 15 +++++---------- .github/workflows/windows.yml | 25 +++++++------------------ CMakeLists.txt | 14 +++++++++----- 4 files changed, 28 insertions(+), 48 deletions(-) diff --git a/.github/workflows/ubuntu.yml b/.github/workflows/ubuntu.yml index 2565755..af7aba9 100644 --- a/.github/workflows/ubuntu.yml +++ b/.github/workflows/ubuntu.yml @@ -1,20 +1,15 @@ name: Ubuntu -on: - push: - branches: [ master ] - pull_request: - branches: [ master ] - -env: - BUILD_TYPE: Release +on: push jobs: - build: + Release: runs-on: ubuntu-latest + env: + BUILD_TYPE: Release steps: - uses: actions/checkout@v2 - with: + with: submodules: recursive - name: Install packages run: | @@ -25,13 +20,10 @@ jobs: - name: Build run: cmake --build ${{github.workspace}}/build --config ${{env.BUILD_TYPE}} - 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 uses: actions/upload-artifact@v2 with: name: Ubuntu path: | - /usr/local/bin/ragephoto-extract - /usr/local/lib/libragephoto.so - /usr/local/lib/pkgconfig/ragephoto.pc - /usr/local/include/RagePhoto/ + ${{github.workspace}}/install/ diff --git a/.github/workflows/webassembly.yml b/.github/workflows/webassembly.yml index 08eebb4..339b25f 100644 --- a/.github/workflows/webassembly.yml +++ b/.github/workflows/webassembly.yml @@ -1,20 +1,15 @@ name: WebAssembly -on: - push: - branches: [ master ] - pull_request: - branches: [ master ] - -env: - BUILD_TYPE: Release +on: push jobs: - build: + Release: runs-on: ubuntu-latest + env: + BUILD_TYPE: Release steps: - uses: actions/checkout@v2 - with: + with: submodules: recursive - name: Setup emsdk uses: mymindstorm/setup-emsdk@v11 diff --git a/.github/workflows/windows.yml b/.github/workflows/windows.yml index 17cf964..bfe889a 100644 --- a/.github/workflows/windows.yml +++ b/.github/workflows/windows.yml @@ -1,20 +1,15 @@ name: Windows -on: - push: - branches: [ master ] - pull_request: - branches: [ master ] - -env: - BUILD_TYPE: Release +on: push jobs: - build: + Release: runs-on: windows-latest + env: + BUILD_TYPE: Release steps: - uses: actions/checkout@v2 - with: + with: submodules: recursive - uses: ilammy/msvc-dev-cmd@v1 - name: Configure CMake @@ -22,16 +17,10 @@ jobs: - name: Build run: cmake --build ${{github.workspace}}/build --config ${{env.BUILD_TYPE}} - 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 uses: actions/upload-artifact@v2 with: name: Windows MSVC path: | - ${{github.workspace}}/build/libragephoto.dll - ${{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/ + ${{github.workspace}}/install/ diff --git a/CMakeLists.txt b/CMakeLists.txt index 4008313..e998c25 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -27,13 +27,11 @@ set(CMAKE_CXX_STANDARD_REQUIRED ON) # RagePhoto CMake includes include(cmake/unicode.cmake) -# RagePhoto WebAssembly ON/OFF +# RagePhoto WebAssembly ON if (EMSCRIPTEN) set(EM_ON ON) - set(EM_OFF OFF) else() set(EM_ON OFF) - set(EM_OFF ON) endif() # RagePhoto Source files @@ -105,9 +103,15 @@ target_include_directories(ragephoto PUBLIC ${ragephoto_BINARY_DIR}/include ${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_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 if (EMSCRIPTEN)