lpac/CMakeLists.txt
Yegor Yefremov 5e5e3f2e8a
CMakeLists.txt: bump CMake version to 3.15 (#223)
This change fixes the following warning on the latest CMake versions:

CMake Deprecation Warning at CMakeLists.txt:1 (cmake_minimum_required):
  Compatibility with CMake < 3.10 will be removed from a future version of
  CMake.

  Update the VERSION argument <min> value.  Or, use the <min>...<max> syntax
  to tell CMake that the project requires at least <min> but has been updated
  to work with policies introduced by <max> or earlier.
2025-03-20 08:18:30 +08:00

67 lines
1.7 KiB
CMake

cmake_minimum_required (VERSION 3.15)
project (lpac
VERSION 2.1.0
HOMEPAGE_URL "https://github.com/estkme-group/lpac"
DESCRIPTION "C-based eUICC LPA."
LANGUAGES C)
set(CMAKE_C_STANDARD 99)
set(CMAKE_C_STANDARD_REQUIRED ON)
set(LPAC_CMAKE_MODULE_PATH "${CMAKE_CURRENT_SOURCE_DIR}/cmake")
list(APPEND CMAKE_MODULE_PATH ${LPAC_CMAKE_MODULE_PATH})
set(CMAKE_EXPORT_COMPILE_COMMANDS ON)
# add_compile_options(-Wall -Wextra -Wpedantic)
# Enable LTO when possible.
cmake_policy(SET CMP0069 NEW)
include(CheckIPOSupported)
check_ipo_supported(RESULT result OUTPUT output)
if(result)
if(NOT DEFINED CMAKE_INTERPROCEDURAL_OPTIMIZATION)
set(CMAKE_INTERPROCEDURAL_OPTIMIZATION TRUE)
endif()
else()
message(INFO "IPO is not supported: ${output}")
endif()
if (APPLE)
set(CMAKE_OSX_ARCHITECTURES "arm64;x86_64")
endif()
if(UNIX)
include(GNUInstallDirs)
if(NOT CMAKE_INSTALL_RPATH)
set(CMAKE_INSTALL_RPATH "${CMAKE_INSTALL_FULL_LIBDIR}/lpac")
endif()
endif()
if(WIN32)
add_subdirectory(dlfcn-win32)
set(DL_LIBRARY dlfcn-win32)
else()
set(DL_LIBRARY dl)
endif()
if(CPACK_GENERATOR)
set(CPACK_PACKAGE_VENDOR "eSTK.me Group")
set(CPACK_DEBIAN_PACKAGE_MAINTAINER "eSTK.me Group")
set(CPACK_DEBIAN_PACKAGE_DEPENDS "libc6")
set(CPACK_DEBIAN_PACKAGE_RECOMMENDS "libcurl, libpcsclite, pcscd")
set(CPACK_DEBIAN_FILE_NAME DEB-DEFAULT)
set(CPACK_RPM_PACKAGE_LICENSE "AGPL-3.0-only AND LGPL-2.0-only")
set(CPACK_RPM_PACKAGE_AUTOREQ "yes")
set(CPACK_RPM_PACKAGE_REQUIRES "libcurl, libpcsclite, pcscd")
include(CPack)
endif()
add_subdirectory(cjson)
add_subdirectory(euicc)
add_subdirectory(driver)
add_subdirectory(src)