1
0
Fork 0

Move build_* variable computation back to variables.cmake

This commit is contained in:
Ilya Fedin 2022-08-22 03:12:18 +04:00 committed by John Preston
parent 6f77ab1f86
commit 5f980167f7
2 changed files with 42 additions and 42 deletions

View file

@ -8,52 +8,11 @@ include(CMakeDependentOption)
set(DESKTOP_APP_SPECIAL_TARGET "" CACHE STRING "Use special platform target, like 'macstore' for Mac App Store.")
set(build_macstore 0)
set(build_winstore 0) # 32 or 64 bit
set(build_win64 0) # normal or uwp
set(build_winstore64 0)
if (WIN32)
if (DESKTOP_APP_SPECIAL_TARGET STREQUAL "win64")
set(build_win64 1)
elseif (DESKTOP_APP_SPECIAL_TARGET STREQUAL "uwp")
set(build_winstore 1)
elseif (DESKTOP_APP_SPECIAL_TARGET STREQUAL "uwp64")
set(build_win64 1)
set(build_winstore 1)
set(build_winstore64 1)
elseif (CMAKE_SIZEOF_VOID_P EQUAL 8)
set(build_win64 1)
endif()
elseif (APPLE)
if (DESKTOP_APP_SPECIAL_TARGET STREQUAL "macstore")
set(build_macstore 1)
endif()
else()
if (DESKTOP_APP_SPECIAL_TARGET)
if (CMAKE_CXX_COMPILER_ID STREQUAL "GNU")
set(CMAKE_AR "gcc-ar")
set(CMAKE_RANLIB "gcc-ranlib")
set(CMAKE_NM "gcc-nm")
elseif (CMAKE_CXX_COMPILER_ID STREQUAL "Clang")
set(CMAKE_AR "llvm-ar")
set(CMAKE_RANLIB "llvm-ranlib")
set(CMAKE_NM "llvm-nm")
endif()
endif()
endif()
if (build_win64)
get_filename_component(libs_loc "../Libraries/win64" REALPATH)
else()
get_filename_component(libs_loc "../Libraries" REALPATH)
endif()
get_filename_component(libs_loc "../Libraries" REALPATH)
set(libs_loc_exists 0)
if (EXISTS ${libs_loc})
set(libs_loc_exists 1)
endif()
cmake_dependent_option(DESKTOP_APP_USE_PACKAGED "Find libraries using CMake instead of exact paths." OFF libs_loc_exists ON)
function(report_bad_special_target)

View file

@ -49,3 +49,44 @@ if ((WIN32
AND NOT DESKTOP_APP_DISABLE_SPELLCHECK)
set(add_hunspell_library 1)
endif()
set(build_macstore 0)
set(build_winstore 0) # 32 or 64 bit
set(build_win64 0) # normal or uwp
set(build_winstore64 0)
if (WIN32)
if (DESKTOP_APP_SPECIAL_TARGET STREQUAL "win64")
set(build_win64 1)
elseif (DESKTOP_APP_SPECIAL_TARGET STREQUAL "uwp")
set(build_winstore 1)
elseif (DESKTOP_APP_SPECIAL_TARGET STREQUAL "uwp64")
set(build_win64 1)
set(build_winstore 1)
set(build_winstore64 1)
elseif (CMAKE_SIZEOF_VOID_P EQUAL 8)
set(build_win64 1)
endif()
elseif (APPLE)
if (DESKTOP_APP_SPECIAL_TARGET STREQUAL "macstore")
set(build_macstore 1)
endif()
else()
if (DESKTOP_APP_SPECIAL_TARGET)
if (CMAKE_CXX_COMPILER_ID STREQUAL "GNU")
set(CMAKE_AR "gcc-ar")
set(CMAKE_RANLIB "gcc-ranlib")
set(CMAKE_NM "gcc-nm")
elseif (CMAKE_CXX_COMPILER_ID STREQUAL "Clang")
set(CMAKE_AR "llvm-ar")
set(CMAKE_RANLIB "llvm-ranlib")
set(CMAKE_NM "llvm-nm")
endif()
endif()
endif()
if (build_win64)
get_filename_component(libs_loc "../Libraries/win64" REALPATH)
else()
get_filename_component(libs_loc "../Libraries" REALPATH)
endif()