Skip to content

Commit

Permalink
Merge branch 'standardcel' into master
Browse files Browse the repository at this point in the history
  • Loading branch information
SevenSpheres committed Sep 15, 2021
2 parents 9a05ae6 + 506d7c6 commit 5047366
Show file tree
Hide file tree
Showing 23 changed files with 1,079 additions and 722 deletions.
6 changes: 3 additions & 3 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -43,13 +43,13 @@ jobs:
-password "${{ secrets.GITHUB_TOKEN }}"
- name: 'Install dependencies'
run: vcpkg --triplet=${{matrix.platform}}-windows install --recurse libpng libjpeg-turbo gettext luajit fmt libepoxy eigen3 freetype cspice ffmpeg qt5-base
run: vcpkg --triplet=${{matrix.platform}}-windows install --recurse libpng libjpeg-turbo gettext luajit fmt libepoxy eigen3 freetype cspice qt5-base

- name: 'Checkout source code'
uses: actions/checkout@v2

- name: 'Configure CMake'
run: cmake -B ${{github.workspace}}/build -DCMAKE_TOOLCHAIN_FILE=c:/vcpkg/scripts/buildsystems/vcpkg.cmake -DVCPKG_TARGET_TRIPLET=${{matrix.platform}}-windows -DCMAKE_GENERATOR_PLATFORM=${{matrix.generator_platform}} -DENABLE_SPICE=ON -DENABLE_TOOLS=ON -DENABLE_TESTS=ON -DENABLE_SDL=OFF -DENABLE_QT=ON -DENABLE_FFMPEG=ON -DENABLE_DATA=OFF
run: cmake -B ${{github.workspace}}/build -DCMAKE_TOOLCHAIN_FILE=c:/vcpkg/scripts/buildsystems/vcpkg.cmake -DVCPKG_TARGET_TRIPLET=${{matrix.platform}}-windows -DCMAKE_GENERATOR_PLATFORM=${{matrix.generator_platform}} -DENABLE_SPICE=ON -DENABLE_TOOLS=ON -DENABLE_TESTS=ON -DENABLE_SDL=OFF -DENABLE_QT=ON -DENABLE_DATA=OFF

- name: Build
run: cmake --build ${{github.workspace}}/build --config ${{env.BUILD_TYPE}} -- /maxcpucount:2 /nologo
Expand All @@ -66,7 +66,7 @@ jobs:
working-directory: ${{github.workspace}}/build/src/celestia
run: |
7z a celestia-dep.${{matrix.platform}}.7z ${{env.BUILD_TYPE}}\*
7z a celestia-win.${{matrix.platform}}.7z win32\${{env.BUILD_TYPE}}\*
7z a celestia-win.${{matrix.platform}}.7z win32\${{env.BUILD_TYPE}}\* win32\res\${{env.BUILD_TYPE}}\res_*.dll
c:\vcpkg\ports\qt5-base\qtdeploy.ps1 qt\${{env.BUILD_TYPE}}\
7z a celestia-qt.${{matrix.platform}}.7z qt\${{env.BUILD_TYPE}}\*
cd ..\tools
Expand Down
52 changes: 52 additions & 0 deletions cmake/windres.cmake
Original file line number Diff line number Diff line change
@@ -0,0 +1,52 @@
function(_WINDRES_GET_UNIQUE_TARGET_NAME _name _unique_name)
set(propertyName "_WINDRES_UNIQUE_COUNTER_${_name}")
get_property(currentCounter GLOBAL PROPERTY "${propertyName}")
if(NOT currentCounter)
set(currentCounter 1)
endif()
set(${_unique_name} "${_name}_${currentCounter}" PARENT_SCOPE)
math(EXPR currentCounter "${currentCounter} + 1")
set_property(GLOBAL PROPERTY ${propertyName} ${currentCounter} )
endfunction()

macro(WINDRES_CREATE_TRANSLATIONS _rcFile _firstPoFileArg)
# make it a real variable, so we can modify it here
set(_firstPoFile "${_firstPoFileArg}")

set(_addToAll)
if(${_firstPoFile} STREQUAL "ALL")
set(_addToAll "ALL")
set(_firstPoFile)
endif()

set(_dllFiles)
foreach(_currentPoFile ${_firstPoFile} ${ARGN})
get_filename_component(_absFile ${_currentPoFile} ABSOLUTE)
get_filename_component(_lang ${_absFile} NAME_WE)
set(_locRcFile ${CMAKE_CURRENT_BINARY_DIR}/celestia_${_lang}.rc)
set(_dllFile res_${_lang})

add_custom_command(
OUTPUT ${_locRcFile}
COMMAND perl ${CMAKE_SOURCE_DIR}/po/translate_resources.pl ${_lang}
DEPENDS ${_absFile}
)

add_library(${_dllFile} MODULE ${_locRcFile})
set_target_properties(${_dllFile} PROPERTIES PREFIX "" LINKER_LANGUAGE C)
if(MSVC)
set_target_properties(${_dllFile} PROPERTIES LINK_FLAGS "/MANIFEST:NO /NODEFAULTLIB /NOENTRY")
endif()

install(TARGETS ${_dllFile} LIBRARY DESTINATION ${CMAKE_INSTALL_BINDIR})
set(_dllFiles ${_dllFiles} ${_dllFile})
endforeach()

if(NOT TARGET resources)
add_custom_target(resources)
endif()

_WINDRES_GET_UNIQUE_TARGET_NAME(resources uniqueTargetName)
add_custom_target(${uniqueTargetName} ${_addToAll} DEPENDS ${_dllFiles})
add_dependencies(resources ${uniqueTargetName})
endmacro()
Loading

0 comments on commit 5047366

Please sign in to comment.