Established a common architecture naming for the packages.

This commit is contained in:
Gonzalo Exequiel Pedone 2023-04-30 16:19:08 -03:00
parent d051bf6ea7
commit 4ab22d6f68
No known key found for this signature in database
GPG key ID: B8B09E63E9B85BAF
6 changed files with 156 additions and 64 deletions

View file

@ -31,37 +31,15 @@ if (APPLE)
set(APP_LIBDIR AkVirtualCamera.plugin/Contents/Frameworks) set(APP_LIBDIR AkVirtualCamera.plugin/Contents/Frameworks)
set(MAIN_EXECUTABLE AkVirtualCamera.plugin/Contents/MacOS/AkVirtualCamera) set(MAIN_EXECUTABLE AkVirtualCamera.plugin/Contents/MacOS/AkVirtualCamera)
set(PACKET_HIDE_ARCH false) set(PACKET_HIDE_ARCH false)
if (IS_ARM_TARGET)
if (IS_64BITS_TARGET)
set(PACKET_TARGET_ARCH arm64)
else ()
set(PACKET_TARGET_ARCH arm32)
endif()
else ()
if (IS_64BITS_TARGET)
set(PACKET_TARGET_ARCH x64)
else ()
set(PACKET_TARGET_ARCH x86)
endif()
endif()
set(QTIFW_TARGET_DIR "\@ApplicationsDir\@/AkVirtualCamera") set(QTIFW_TARGET_DIR "\@ApplicationsDir\@/AkVirtualCamera")
set(OUTPUT_FORMATS "MacPkg") set(OUTPUT_FORMATS "MacPkg")
elseif (WIN32) elseif (WIN32)
add_subdirectory(dshow) add_subdirectory(dshow)
set(TARGET_PLATFORM windows) set(TARGET_PLATFORM windows)
set(BUILD_INFO_FILE share/build-info.txt) set(BUILD_INFO_FILE share/build-info.txt)
set(MAIN_EXECUTABLE ${TARGET_ARCH}/AkVCamManager.exe) set(MAIN_EXECUTABLE ${WIN_TARGET_ARCH}/AkVCamManager.exe)
set(APP_LIBDIR ${TARGET_ARCH}) set(APP_LIBDIR ${WIN_TARGET_ARCH})
set(PACKET_HIDE_ARCH true) set(PACKET_HIDE_ARCH true)
if (IS_64BITS_TARGET)
set(PACKET_TARGET_ARCH win64)
else ()
set(PACKET_TARGET_ARCH win32)
endif()
set(OUTPUT_FORMATS "Nsis") set(OUTPUT_FORMATS "Nsis")
endif () endif ()

View file

@ -28,7 +28,7 @@ if (APPLE)
set(INSTALLPATH ${CMIO_PLUGIN_NAME}.plugin/Contents/Resources) set(INSTALLPATH ${CMIO_PLUGIN_NAME}.plugin/Contents/Resources)
elseif (WIN32) elseif (WIN32)
include(../dshow/dshow.cmake) include(../dshow/dshow.cmake)
set(INSTALLPATH ${TARGET_ARCH}) set(INSTALLPATH ${WIN_TARGET_ARCH})
endif () endif ()
add_executable(Manager add_executable(Manager

View file

@ -39,45 +39,10 @@ add_definitions(-DCOMMONS_APPNAME="${COMMONS_APPNAME}"
-DCOMMONS_VERSION="${VERSION}" -DCOMMONS_VERSION="${VERSION}"
-DPREFIX="${PREFIX}") -DPREFIX="${PREFIX}")
if (APPLE) if (WIN32)
check_cxx_source_compiles("
#ifndef __arm__
#error Not ARM
#endif
int main()
{
return 0;
}" IS_ARM_TARGET)
check_cxx_source_compiles("
#ifndef __x86_64__
#error Not x64
#endif
int main()
{
return 0;
}" IS_64BITS_TARGET)
elseif (WIN32)
check_cxx_source_compiles("
#ifndef _WIN64
#error Not x64
#endif
int main()
{
return 0;
}" IS_64BITS_TARGET)
add_definitions(-DUNICODE -D_UNICODE) add_definitions(-DUNICODE -D_UNICODE)
endif () endif ()
if (IS_64BITS_TARGET)
set(TARGET_ARCH x64 CACHE INTERNAL "")
else ()
set(TARGET_ARCH x86 CACHE INTERNAL "")
endif()
if (CMAKE_CXX_COMPILER_ID STREQUAL "GNU") if (CMAKE_CXX_COMPILER_ID STREQUAL "GNU")
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -static -static-libgcc -static-libstdc++") set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -static -static-libgcc -static-libstdc++")
endif() endif()
@ -85,3 +50,152 @@ endif()
if (DAILY_BUILD) if (DAILY_BUILD)
add_definitions(-DDAILY_BUILD) add_definitions(-DDAILY_BUILD)
endif () endif ()
# NOTE for other developers: TARGET_ARCH is intended to be used as a reference
# for the deploy tool, so don't rush on adding new architectures unless you
# want to create a binary distributable for that architecture.
# Webcamoid build is not affected in anyway by the value of TARGET_ARCH, if the
# build fails its something else and totally unrelated to that variable.
if (WIN32)
include(CheckCXXSourceCompiles)
check_cxx_source_compiles("
#include <windows.h>
#ifndef _M_X64
#error Not WIN64
#endif
int main()
{
return 0;
}" IS_WIN64_TARGET)
check_cxx_source_compiles("
#include <windows.h>
#ifndef _M_IX86
#error Not WIN32
#endif
int main()
{
return 0;
}" IS_WIN32_TARGET)
check_cxx_source_compiles("
#include <windows.h>
#ifndef _M_ARM64
#error Not ARM64
#endif
int main()
{
return 0;
}" IS_WIN64_ARM_TARGET)
check_cxx_source_compiles("
#include <windows.h>
#ifndef _M_ARM
#error Not ARM
#endif
int main()
{
return 0;
}" IS_WIN32_ARM_TARGET)
if (IS_WIN64_TARGET OR IS_WIN64_ARM_TARGET)
set(QTIFW_TARGET_DIR "\@ApplicationsDirX64\@/Webcamoid")
else ()
set(QTIFW_TARGET_DIR "\@ApplicationsDirX86\@/Webcamoid")
endif()
if (IS_WIN64_TARGET)
set(TARGET_ARCH win64)
set(WIN_TARGET_ARCH x64)
elseif (IS_WIN64_ARM_TARGET)
set(TARGET_ARCH win64_arm)
set(WIN_TARGET_ARCH arm64)
elseif (IS_WIN32_TARGET)
set(TARGET_ARCH win32)
set(WIN_TARGET_ARCH x86)
elseif (IS_WIN32_ARM_TARGET)
set(TARGET_ARCH win32_arm)
set(WIN_TARGET_ARCH arm32)
else ()
set(TARGET_ARCH unknown)
set(WIN_TARGET_ARCH unknown)
endif()
elseif (UNIX)
if (ANDROID)
set(TARGET_ARCH ${CMAKE_ANDROID_ARCH_ABI})
else ()
include(CheckCXXSourceCompiles)
check_cxx_source_compiles("
#ifndef __x86_64__
#error Not x64
#endif
int main()
{
return 0;
}" IS_X86_64_TARGET)
check_cxx_source_compiles("
#ifndef __i386__
#error Not x86
#endif
int main()
{
return 0;
}" IS_I386_TARGET)
check_cxx_source_compiles("
#ifndef __aarch64__
#error Not ARM64
#endif
int main()
{
return 0;
}" IS_ARM64_TARGET)
check_cxx_source_compiles("
#ifndef __arm__
#error Not ARM
#endif
int main()
{
return 0;
}" IS_ARM_TARGET)
check_cxx_source_compiles("
#ifndef __riscv
#error Not RISC-V
#endif
int main()
{
return 0;
}" IS_RISCV_TARGET)
if (IS_X86_64_TARGET)
set(TARGET_ARCH x64)
elseif (IS_I386_TARGET)
set(TARGET_ARCH x86)
elseif (IS_ARM64_TARGET)
set(TARGET_ARCH arm64)
elseif (IS_ARM_TARGET)
set(TARGET_ARCH arm32)
elseif (IS_RISCV_TARGET)
set(TARGET_ARCH riscv)
else ()
set(TARGET_ARCH unknown)
endif ()
endif ()
endif ()

View file

@ -24,7 +24,7 @@ set(CMAKE_CXX_STANDARD 11)
set(CMAKE_CXX_STANDARD_REQUIRED ON) set(CMAKE_CXX_STANDARD_REQUIRED ON)
include(../dshow.cmake) include(../dshow.cmake)
set(INSTALLPATH ${TARGET_ARCH}) set(INSTALLPATH ${WIN_TARGET_ARCH})
add_executable(Assistant add_executable(Assistant
src/main.cpp src/main.cpp

View file

@ -25,7 +25,7 @@ set(CMAKE_CXX_STANDARD 11)
set(CMAKE_CXX_STANDARD_REQUIRED ON) set(CMAKE_CXX_STANDARD_REQUIRED ON)
include(../dshow.cmake) include(../dshow.cmake)
set(INSTALLPATH ${TARGET_ARCH}) set(INSTALLPATH ${WIN_TARGET_ARCH})
add_library(VirtualCamera SHARED add_library(VirtualCamera SHARED
src/basefilter.cpp src/basefilter.cpp

View file

@ -5,7 +5,7 @@ sourcesDir = @CMAKE_SOURCE_DIR@
mainExecutable = @MAIN_EXECUTABLE@ mainExecutable = @MAIN_EXECUTABLE@
libDir = @APP_LIBDIR@ libDir = @APP_LIBDIR@
buildInfoFile = @BUILD_INFO_FILE@ buildInfoFile = @BUILD_INFO_FILE@
targetArch = @PACKET_TARGET_ARCH@ targetArch = @TARGET_ARCH@
version = @VERSION@ version = @VERSION@
outputFormats = @OUTPUT_FORMATS@ outputFormats = @OUTPUT_FORMATS@
hideArch = @PACKET_HIDE_ARCH@ hideArch = @PACKET_HIDE_ARCH@