Skip to content

Commit

Permalink
3318: Provide 64-bit windows builds (TrenchBroom#3319)
Browse files Browse the repository at this point in the history
* 3318: move existing FreeImage.h

* 3318: import FreeImage 3.18.0 x86 binaries/header from:

http://downloads.sourceforge.net/freeimage/FreeImage3180Win32Win64.zip

* 3318: adapt freeimage CMakeLists.txt to support x64 and Win32

* 3318: delete old freetype windows binaries

* 3318: add freetype windows binaries submodule

* 3318: cmake updates to reflect new freetype windows binaries

* 3318: update GET_BUILD_PLATFORM macro

* 3318: update to appveyor build scripts

* 3318: include platform in getBuildIdStr() / BUILD_ID_STR

so we can distinguish win32/win64 in crash reports / screenshots

* 3318: move freeimage to BinaryLibs

* fix build
  • Loading branch information
ericwa authored Jul 4, 2020
1 parent fb5690e commit 60ba694
Show file tree
Hide file tree
Showing 32 changed files with 39 additions and 2,168 deletions.
6 changes: 6 additions & 0 deletions .gitmodules
Original file line number Diff line number Diff line change
Expand Up @@ -4,3 +4,9 @@
[submodule "lib/Catch2"]
path = lib/Catch2
url = https://github.com/catchorg/Catch2
[submodule "lib/freetype/freetype-windows-binaries"]
path = lib/freetype/freetype-windows-binaries
url = https://github.com/ubawurinna/freetype-windows-binaries
[submodule "lib/BinaryLibs"]
path = lib/BinaryLibs
url = https://github.com/TrenchBroom/BinaryLibs
2 changes: 0 additions & 2 deletions app/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -148,7 +148,6 @@ macro(configure_app_target APP_TARGET_NAME SHOULD_BUILD_MANUAL)
add_custom_command(TARGET ${APP_TARGET_NAME} POST_BUILD
COMMAND ${CMAKE_COMMAND} -E copy_if_different "$<TARGET_FILE:freeimage>" "$<TARGET_FILE_DIR:${APP_TARGET_NAME}>"
COMMAND ${CMAKE_COMMAND} -E copy_if_different "$<TARGET_FILE:freetype>" "$<TARGET_FILE_DIR:${APP_TARGET_NAME}>"
COMMAND ${CMAKE_COMMAND} -E copy_if_different "$<TARGET_FILE:z>" "$<TARGET_FILE_DIR:${APP_TARGET_NAME}>"
COMMAND ${CMAKE_COMMAND} -E copy_if_different "$<TARGET_FILE:Qt5::Widgets>" "$<TARGET_FILE_DIR:${APP_TARGET_NAME}>"
COMMAND ${CMAKE_COMMAND} -E copy_if_different "$<TARGET_FILE:Qt5::Gui>" "$<TARGET_FILE_DIR:${APP_TARGET_NAME}>"
COMMAND ${CMAKE_COMMAND} -E copy_if_different "$<TARGET_FILE:Qt5::Core>" "$<TARGET_FILE_DIR:${APP_TARGET_NAME}>"
Expand Down Expand Up @@ -272,7 +271,6 @@ if(WIN32)
install(FILES
$<TARGET_FILE:freeimage>
$<TARGET_FILE:freetype>
$<TARGET_FILE:z>
$<TARGET_FILE:Qt5::Widgets>
$<TARGET_FILE:Qt5::Gui>
$<TARGET_FILE:Qt5::Core>
Expand Down
2 changes: 1 addition & 1 deletion appveyor.bat
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ cppcheck --version
mkdir cmakebuild
cd cmakebuild

cmake .. -G"Visual Studio 16 2019" -T v142 -A Win32 -DCMAKE_PREFIX_PATH="%QT5_INSTALL_DIR%" -DCMAKE_BUILD_TYPE=Release -DCMAKE_CXX_FLAGS="/WX" -DTB_SUPPRESS_PCH=1
cmake .. -G"Visual Studio 16 2019" -T v142 -A "%TB_ARCH%" -DCMAKE_PREFIX_PATH="%QT5_INSTALL_DIR%" -DCMAKE_BUILD_TYPE=Release -DCMAKE_CXX_FLAGS="/WX" -DTB_SUPPRESS_PCH=1

REM -DCMAKE_CXX_FLAGS=/WX

Expand Down
9 changes: 7 additions & 2 deletions appveyor.yml
Original file line number Diff line number Diff line change
@@ -1,8 +1,13 @@
image: Visual Studio 2019
version: 2.0.0-appveyor-{build}
environment:
QT5_INSTALL_DIR: 'C:\Qt\5.12\msvc2017'
PATH: '%Qt5_INSTALL_DIR%\bin;%PATH%'
matrix:
- TB_ARCH: Win32
QT5_INSTALL_DIR: 'C:\Qt\5.12\msvc2017'
PATH: '%Qt5_INSTALL_DIR%\bin;%PATH%'
- TB_ARCH: x64
QT5_INSTALL_DIR: 'C:\Qt\5.12\msvc2017_64'
PATH: '%Qt5_INSTALL_DIR%\bin;%PATH%'
install:
- cinst pandoc
- cinst cppcheck
Expand Down
8 changes: 7 additions & 1 deletion cmake/Utils.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -173,7 +173,13 @@ endmacro(GET_GIT_DESCRIBE)

macro(GET_BUILD_PLATFORM PLATFORM_NAME)
if(WIN32)
set(${PLATFORM_NAME} "Win32")
if(CMAKE_VS_PLATFORM_NAME STREQUAL "Win32")
set(${PLATFORM_NAME} "Win32")
elseif(CMAKE_VS_PLATFORM_NAME STREQUAL "x64")
set(${PLATFORM_NAME} "Win64")
else()
message(ERROR "Unsupported CMAKE_VS_PLATFORM_NAME ${CMAKE_VS_PLATFORM_NAME}")
endif()
elseif(APPLE)
set(${PLATFORM_NAME} "MacOSX")
elseif(UNIX)
Expand Down
1 change: 1 addition & 0 deletions common/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -1136,6 +1136,7 @@ endif()
set_compiler_config(common)

# Create the cmake script for generating the version information
get_build_platform(COMMON_PLATFORM_NAME)
configure_file("${CMAKE_CURRENT_SOURCE_DIR}/cmake/GenerateVersion.cmake.in" "${CMAKE_CURRENT_BINARY_DIR}/GenerateVersion.cmake" @ONLY)
target_include_directories(common PRIVATE ${CMAKE_CURRENT_BINARY_DIR})
add_custom_target(generate_version ${CMAKE_COMMAND} -P "${CMAKE_CURRENT_BINARY_DIR}/GenerateVersion.cmake")
Expand Down
1 change: 0 additions & 1 deletion common/benchmark/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,6 @@ if(WIN32)
add_custom_command(TARGET common-benchmark POST_BUILD
COMMAND ${CMAKE_COMMAND} -E copy_if_different "$<TARGET_FILE:freeimage>" "$<TARGET_FILE_DIR:common-benchmark>"
COMMAND ${CMAKE_COMMAND} -E copy_if_different "$<TARGET_FILE:freetype>" "$<TARGET_FILE_DIR:common-benchmark>"
COMMAND ${CMAKE_COMMAND} -E copy_if_different "$<TARGET_FILE:z>" "$<TARGET_FILE_DIR:common-benchmark>"
COMMAND ${CMAKE_COMMAND} -E copy_if_different "$<TARGET_FILE:Qt5::Widgets>" "$<TARGET_FILE_DIR:common-benchmark>"
COMMAND ${CMAKE_COMMAND} -E copy_if_different "$<TARGET_FILE:Qt5::Gui>" "$<TARGET_FILE_DIR:common-benchmark>"
COMMAND ${CMAKE_COMMAND} -E copy_if_different "$<TARGET_FILE:Qt5::Core>" "$<TARGET_FILE_DIR:common-benchmark>"
Expand Down
2 changes: 2 additions & 0 deletions common/cmake/GenerateVersion.cmake.in
Original file line number Diff line number Diff line change
Expand Up @@ -4,4 +4,6 @@ get_git_describe("@GIT_EXECUTABLE@" "@CMAKE_SOURCE_DIR@" GIT_DESCRIBE)
get_app_version(GIT_DESCRIBE APP_VERSION_YEAR APP_VERSION_NUMBER)
set(APP_BUILD_TYPE "@CMAKE_BUILD_TYPE@")

set(APP_BUILD_PLATFORM "@COMMON_PLATFORM_NAME@")

configure_file("@COMMON_SOURCE_DIR@/Version.h.in" "@CMAKE_CURRENT_BINARY_DIR@/Version.h" @ONLY)
2 changes: 1 addition & 1 deletion common/src/Version.h.in
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
#define VERSION_NUMBER @APP_VERSION_NUMBER@

#define BUILD_TYPE "@APP_BUILD_TYPE@"
#define BUILD_ID_STR "@GIT_DESCRIBE@ @APP_BUILD_TYPE@"
#define BUILD_ID_STR "@GIT_DESCRIBE@ @APP_BUILD_TYPE@ @APP_BUILD_PLATFORM@"

#define VERSION_STR "@APP_VERSION_YEAR@.@APP_VERSION_NUMBER@"
#define VERSION_RC @APP_VERSION_YEAR@,@APP_VERSION_NUMBER@
1 change: 0 additions & 1 deletion common/test/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -128,7 +128,6 @@ if(WIN32)
add_custom_command(TARGET common-test POST_BUILD
COMMAND ${CMAKE_COMMAND} -E copy_if_different "$<TARGET_FILE:freeimage>" "$<TARGET_FILE_DIR:common-test>"
COMMAND ${CMAKE_COMMAND} -E copy_if_different "$<TARGET_FILE:freetype>" "$<TARGET_FILE_DIR:common-test>"
COMMAND ${CMAKE_COMMAND} -E copy_if_different "$<TARGET_FILE:z>" "$<TARGET_FILE_DIR:common-test>"
COMMAND ${CMAKE_COMMAND} -E copy_if_different "$<TARGET_FILE:Qt5::Widgets>" "$<TARGET_FILE_DIR:common-test>"
COMMAND ${CMAKE_COMMAND} -E copy_if_different "$<TARGET_FILE:Qt5::Gui>" "$<TARGET_FILE_DIR:common-test>"
COMMAND ${CMAKE_COMMAND} -E copy_if_different "$<TARGET_FILE:Qt5::Core>" "$<TARGET_FILE_DIR:common-test>"
Expand Down
1 change: 0 additions & 1 deletion dump-shortcuts/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,6 @@ if(WIN32)
add_custom_command(TARGET dump-shortcuts POST_BUILD
COMMAND ${CMAKE_COMMAND} -E copy_if_different "$<TARGET_FILE:freeimage>" "$<TARGET_FILE_DIR:dump-shortcuts>"
COMMAND ${CMAKE_COMMAND} -E copy_if_different "$<TARGET_FILE:freetype>" "$<TARGET_FILE_DIR:dump-shortcuts>"
COMMAND ${CMAKE_COMMAND} -E copy_if_different "$<TARGET_FILE:z>" "$<TARGET_FILE_DIR:dump-shortcuts>"
COMMAND ${CMAKE_COMMAND} -E copy_if_different "$<TARGET_FILE:Qt5::Widgets>" "$<TARGET_FILE_DIR:dump-shortcuts>"
COMMAND ${CMAKE_COMMAND} -E copy_if_different "$<TARGET_FILE:Qt5::Gui>" "$<TARGET_FILE_DIR:dump-shortcuts>"
COMMAND ${CMAKE_COMMAND} -E copy_if_different "$<TARGET_FILE:Qt5::Core>" "$<TARGET_FILE_DIR:dump-shortcuts>"
Expand Down
1 change: 1 addition & 0 deletions lib/BinaryLibs
Submodule BinaryLibs added at c29849
2 changes: 1 addition & 1 deletion lib/CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
add_subdirectory(Catch2)
add_subdirectory(freeimage)
add_subdirectory(BinaryLibs)
add_subdirectory(freetype)
add_subdirectory(glew)
add_subdirectory(kdl)
Expand Down
69 changes: 0 additions & 69 deletions lib/freeimage/CMakeLists.txt

This file was deleted.

Binary file removed lib/freeimage/bin/osx/libfreeimage.a
Binary file not shown.
Binary file removed lib/freeimage/bin/win32/FreeImage.dll
Binary file not shown.
Binary file removed lib/freeimage/bin/win32/FreeImage.lib
Binary file not shown.
Binary file removed lib/freeimage/bin/win32/libfreeimage.a
Binary file not shown.
Loading

0 comments on commit 60ba694

Please sign in to comment.