Skip to content

Commit

Permalink
Squashed changes from #303
Browse files Browse the repository at this point in the history
  • Loading branch information
kremius committed Mar 18, 2017
1 parent 3b08783 commit 93808e0
Show file tree
Hide file tree
Showing 2 changed files with 101 additions and 4 deletions.
59 changes: 55 additions & 4 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,10 @@ option(BUILD_COVER "Generate test coverage" OFF)
set(CMAKE_MODULE_PATH ${CMAKE_MODULE_PATH} "${CMAKE_SOURCE_DIR}/cmake/Modules/")

include(ClangFormat)
if (WIN32)
set(CMAKE_INSTALL_SYSTEM_RUNTIME_LIBS_SKIP ON)
include(InstallRequiredSystemLibraries)
endif()

##################################
### Start search dependencies
Expand Down Expand Up @@ -36,6 +40,9 @@ else()
message(FATAL_ERROR "Unable to find Qt5Core!")
endif()

get_target_property(QtCore_location Qt5::Core LOCATION)
message(STATUS "${QtCore_location}")

find_package(Qt5Network REQUIRED)
if(Qt5Network_FOUND)
message(STATUS "Qt5Network has been found")
Expand Down Expand Up @@ -136,10 +143,17 @@ if(BUILD_TESTS)

configure_file(tests/CMakeLists.txt
googletest-download/CMakeLists.txt)
execute_process(COMMAND ${CMAKE_COMMAND} -G "${CMAKE_GENERATOR}" .
WORKING_DIRECTORY ${CMAKE_BINARY_DIR}/googletest-download )
execute_process(COMMAND ${CMAKE_COMMAND} --build .
WORKING_DIRECTORY ${CMAKE_BINARY_DIR}/googletest-download )
IF(CMAKE_BUILD_TYPE MATCHES DEBUG) # Build gtest in release if so.
execute_process(COMMAND ${CMAKE_COMMAND} -G "${CMAKE_GENERATOR}" .
WORKING_DIRECTORY ${CMAKE_BINARY_DIR}/googletest-download )
execute_process(COMMAND ${CMAKE_COMMAND} --build .
WORKING_DIRECTORY ${CMAKE_BINARY_DIR}/googletest-download )
ELSE()
execute_process(COMMAND ${CMAKE_COMMAND} -G "${CMAKE_GENERATOR}" -DCMAKE_BUILD_TYPE=Release .
WORKING_DIRECTORY ${CMAKE_BINARY_DIR}/googletest-download )
execute_process(COMMAND ${CMAKE_COMMAND} --build . --config Release
WORKING_DIRECTORY ${CMAKE_BINARY_DIR}/googletest-download )
ENDIF()

# Prevent GoogleTest from overriding our compiler/linker options
# when building with Visual Studio
Expand Down Expand Up @@ -396,6 +410,43 @@ install(TARGETS KVEngine Launcher
install(FILES ${CMAKE_BINARY_DIR}/metadata.json
DESTINATION ${CMAKE_CURRENT_SOURCE_DIR}/${EXEC_DIR}/)

install(FILES ${CMAKE_INSTALL_SYSTEM_RUNTIME_LIBS}
DESTINATION ${CMAKE_CURRENT_SOURCE_DIR}/${EXEC_DIR}/
COMPONENT Applications)

IF(DEFINED ENV{APPVEYOR_BUILD_FOLDER}) # Are we building on Appveyor?
FILE(TO_CMAKE_PATH $ENV{QT5DIR} QT_DIR)
install(FILES ${QT_DIR}/msvc2013_opengl/bin/icudt53.dll
DESTINATION ${CMAKE_CURRENT_SOURCE_DIR}/${EXEC_DIR}/)
install(FILES ${QT_DIR}/msvc2013_opengl/bin/icuin53.dll
DESTINATION ${CMAKE_CURRENT_SOURCE_DIR}/${EXEC_DIR}/)
install(FILES ${QT_DIR}/msvc2013_opengl/bin/icuuc53.dll
DESTINATION ${CMAKE_CURRENT_SOURCE_DIR}/${EXEC_DIR}/)
install(FILES ${QT_DIR}/msvc2013_opengl/plugins/platforms/qwindows.dll
DESTINATION ${CMAKE_CURRENT_SOURCE_DIR}/${EXEC_DIR}/platforms/)
install(FILES ${QT_DIR}/msvc2013_opengl/plugins/platforms/qoffscreen.dll
DESTINATION ${CMAKE_CURRENT_SOURCE_DIR}/${EXEC_DIR}/platforms/)
install(FILES ${QT_DIR}/msvc2013_opengl/plugins/platforms/qminimal.dll
DESTINATION ${CMAKE_CURRENT_SOURCE_DIR}/${EXEC_DIR}/platforms/)
install(FILES ${QT_DIR}/msvc2013_opengl/bin/Qt5Core.dll
DESTINATION ${CMAKE_CURRENT_SOURCE_DIR}/${EXEC_DIR}/)
install(FILES ${QT_DIR}/msvc2013_opengl/bin/Qt5Gui.dll
DESTINATION ${CMAKE_CURRENT_SOURCE_DIR}/${EXEC_DIR}/)
install(FILES ${QT_DIR}/msvc2013_opengl/bin/Qt5Network.dll
DESTINATION ${CMAKE_CURRENT_SOURCE_DIR}/${EXEC_DIR}/)
install(FILES ${QT_DIR}/msvc2013_opengl/bin/Qt5OpenGL.dll
DESTINATION ${CMAKE_CURRENT_SOURCE_DIR}/${EXEC_DIR}/)
install(FILES ${QT_DIR}/msvc2013_opengl/bin/Qt5Widgets.dll
DESTINATION ${CMAKE_CURRENT_SOURCE_DIR}/${EXEC_DIR}/)
install(FILES ${CMAKE_CURRENT_SOURCE_DIR}/lpng1612/projects/vstudio/Release/libpng16.dll
DESTINATION ${CMAKE_CURRENT_SOURCE_DIR}/${EXEC_DIR})
install(FILES ${CMAKE_CURRENT_SOURCE_DIR}/SFML-2.3/bin/sfml-system-2.dll
DESTINATION ${CMAKE_CURRENT_SOURCE_DIR}/${EXEC_DIR})
install(FILES ${CMAKE_CURRENT_SOURCE_DIR}/SFML-2.3/bin/sfml-audio-2.dll
DESTINATION ${CMAKE_CURRENT_SOURCE_DIR}/${EXEC_DIR})
install(FILES ${CMAKE_CURRENT_SOURCE_DIR}/SFML-2.3/bin/OpenAL32.dll
DESTINATION ${CMAKE_CURRENT_SOURCE_DIR}/${EXEC_DIR})
ENDIF()
###
### Install rules
#####################################
46 changes: 46 additions & 0 deletions appveyor.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,46 @@
version: 1.0.{build}
image: Visual Studio 2013

environment:
QT5DIR: C:\Qt\5.4

install:
# Install SFML
- ps: wget http://www.sfml-dev.org/files/SFML-2.3-windows-vc12-32-bit.zip -Outfile SFML.zip
- cmd: 7z x SFML.zip
- cmd: SET SFML_ROOT=%CD%\SFML-2.3
# Install libpng
- ps: wget https://sourceforge.net/projects/libpng/files/libpng16/older-releases/1.6.12/lpng1612.7z/download -Outfile lpng1612.7z -UserAgent [Microsoft.PowerShell.Commands.PSUserAgent]::FireFox
- cmd: 7z x lpng1612.7z
- cmd: SET PNG_INCLUDE_DIR=%CD%\lpng1612
- cmd: SET PNG_LIBRARY_DIR=%CD%\lpng1612\projects\vstudio\Release
# Install zlib
- ps: wget http://zlib.net/zlib128-dll.zip -Outfile zlib128-dll.zip
- cmd: 7z x zlib128-dll.zip -o%CD%\zlib128-dll
- ps: wget http://zlib.net/zlib128.zip -Outfile zlib128.zip
- cmd: 7z x zlib128.zip
- cmd: SET ZLIB_ROOT=%CD%\zlib128-dll
# Build libpng
- cmd: cd lpng1612\projects\vstudio
- cmd: '"C:\Program Files (x86)\Microsoft Visual Studio 12.0\VC\vcvarsall.bat" x86'
- cmd: msbuild vstudio.sln /tv:12.0 /p:Configuration=Release
- cmd: msbuild vstudio.sln /tv:12.0 /p:Configuration="Release Library"
- cmd: cd %APPVEYOR_BUILD_FOLDER%
- cmd: SET CMAKE_PREFIX_PATH=%QT5DIR%\msvc2013_opengl

build_script:
- cmd: cmake -DCMAKE_BUILD_TYPE=Release -DBUILD_TESTS=On
- cmd: cmake --build . --target install --config Release -- /logger:"C:\Program Files\AppVeyor\BuildAgent\Appveyor.MSBuildLogger.dll"

after_build:
- ps: Get-ChildItem Exec
# - cmd: COPY zlib128-dll\zlib1.dll Exec
# - cmd: COPY SFML-2.3\sfml-system-2.dll Exec

artifacts:
- path: Exec
name: Client Executable

test_script:
- cmd: cd Exec
- cmd: KVEngine.exe --run-tests

0 comments on commit 93808e0

Please sign in to comment.