Skip to content

Commit

Permalink
deb パッケージでの libaribb1 / libaribb25 のインストールディレクトリを /usr/lib/(arch)-lin…
Browse files Browse the repository at this point in the history
…ux-gnu 以下に変更
  • Loading branch information
tsukumijima committed Apr 11, 2023
1 parent c406a0c commit f4e4c91
Showing 1 changed file with 28 additions and 2 deletions.
30 changes: 28 additions & 2 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
cmake_minimum_required(VERSION 3.1)

#Higher than 3.21
# Higher than 3.21
if(CMAKE_VERSION VERSION_GREATER 3.21)
cmake_policy(SET CMP0128 NEW)
endif()
Expand All @@ -22,7 +22,7 @@ include(GenerateExportHeader)
include(GNUInstallDirs)
find_package(PCSC REQUIRED)

if (UNIX OR MSYS)
if(UNIX OR MSYS)
find_program(LDCONFIG_EXECUTABLE "ldconfig")
set(WITH_PCSC_PACKAGE "libpcsclite" CACHE STRING "pkg-config package name for PC/SC")
set(WITH_PCSC_LIBRARY "" CACHE STRING "library name for PC/SC")
Expand All @@ -36,6 +36,32 @@ if(NOT WIN32)
option(USE_NEON "enable NEON" OFF)
endif()

if(UNIX AND NOT CYGWIN)
# アーキテクチャ情報を取得
set(ARCH ${CMAKE_SYSTEM_PROCESSOR})

# アーキテクチャに応じたGNUトリプレットを生成
if(ARCH STREQUAL "x86_64")
set(ARCH_TRIPLET "x86_64-linux-gnu")
elseif(ARCH STREQUAL "aarch64")
set(ARCH_TRIPLET "aarch64-linux-gnu")
else()
message(WARNING "Unknown architecture: ${ARCH}. Defaulting to x86_64.")
set(ARCH_TRIPLET "x86_64-linux-gnu")
endif()

# インストール先のディレクトリを指定
if(CMAKE_INSTALL_PREFIX_INITIALIZED_TO_DEFAULT)
set(CMAKE_INSTALL_PREFIX "/usr/local" CACHE PATH "default install path" FORCE)
endif()

if(CMAKE_INSTALL_PREFIX STREQUAL "/usr")
set(CMAKE_INSTALL_LIBDIR "lib/${ARCH_TRIPLET}")
else()
set(CMAKE_INSTALL_LIBDIR "lib")
endif()
endif()

# ---------- set variable (libaribb1) ----------

set(ARIBB1_LIB_NAME "aribb1")
Expand Down

0 comments on commit f4e4c91

Please sign in to comment.