-
Notifications
You must be signed in to change notification settings - Fork 88
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Signed-off-by: Coelacanthus <[email protected]>
- Loading branch information
1 parent
aa80656
commit 086e8fb
Showing
12 changed files
with
57 additions
and
83 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,45 +1,23 @@ | ||
option(LINUX_MINGW32 "Build for windows on Linux" OFF) | ||
cmake_minimum_required (VERSION 3.8) | ||
project (lpac) | ||
|
||
list(APPEND CMAKE_MODULE_PATH "${CMAKE_CURRENT_SOURCE_DIR}/cmake") | ||
|
||
if (APPLE) | ||
message(STATUS "Building for macOS") | ||
set(CMAKE_OSX_ARCHITECTURES "arm64;x86_64") | ||
set(CMAKE_SYSTEM_NAME Darwin) | ||
endif() | ||
|
||
if(LINUX_MINGW32) | ||
set(CMAKE_SYSTEM_NAME Windows) | ||
|
||
set(TOOLCHAIN_PREFIX x86_64-w64-mingw32) | ||
|
||
set(CMAKE_C_COMPILER ${TOOLCHAIN_PREFIX}-gcc) | ||
set(CMAKE_CXX_COMPILER ${TOOLCHAIN_PREFIX}-g++) | ||
set(CMAKE_Fortran_COMPILER ${TOOLCHAIN_PREFIX}-gfortran) | ||
set(CMAKE_RC_COMPILER ${TOOLCHAIN_PREFIX}-windres) | ||
|
||
set(CMAKE_FIND_ROOT_PATH /usr/${TOOLCHAIN_PREFIX}) | ||
|
||
set(CMAKE_FIND_ROOT_PATH_MODE_PROGRAM NEVER) | ||
set(CMAKE_FIND_ROOT_PATH_MODE_LIBRARY ONLY) | ||
set(CMAKE_FIND_ROOT_PATH_MODE_INCLUDE ONLY) | ||
endif() | ||
|
||
if(CYGWIN) | ||
set(CMAKE_SYSTEM_NAME Windows) | ||
message(STATUS "Building for Cygwin") | ||
add_definitions(-DHAVE_TIMEGM=1) | ||
endif() | ||
|
||
cmake_minimum_required (VERSION 3.8) | ||
project (lpac) | ||
|
||
|
||
include_directories(.) | ||
add_subdirectory(cjson) | ||
add_subdirectory(euicc) | ||
add_subdirectory(interface) | ||
add_subdirectory(src) | ||
if(LINUX_MINGW32) | ||
if(MINGW) | ||
add_subdirectory(dlfcn-win32) | ||
set(DL_LIBRARY dlfcn-win32) | ||
else() | ||
set(DL_LIBRARY dl) | ||
endif() |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,3 +1,3 @@ | ||
include_directories(.) | ||
aux_source_directory(. LIB_CJSON_SRCS) | ||
aux_source_directory(${CMAKE_CURRENT_SOURCE_DIR} LIB_CJSON_SRCS) | ||
add_library(cjson-static STATIC ${LIB_CJSON_SRCS}) | ||
target_include_directories(cjson-static PUBLIC $<BUILD_INTERFACE:${CMAKE_CURRENT_SOURCE_DIR}/..>) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,15 @@ | ||
set(CMAKE_SYSTEM_NAME Windows) | ||
|
||
set(TOOLCHAIN_PREFIX x86_64-w64-mingw32) | ||
|
||
set(CMAKE_C_COMPILER ${TOOLCHAIN_PREFIX}-gcc) | ||
set(CMAKE_CXX_COMPILER ${TOOLCHAIN_PREFIX}-g++) | ||
set(CMAKE_Fortran_COMPILER ${TOOLCHAIN_PREFIX}-gfortran) | ||
set(CMAKE_RC_COMPILER ${TOOLCHAIN_PREFIX}-windres) | ||
|
||
set(CMAKE_FIND_ROOT_PATH /usr/${TOOLCHAIN_PREFIX}) | ||
|
||
set(CMAKE_FIND_ROOT_PATH_MODE_PROGRAM NEVER) | ||
set(CMAKE_FIND_ROOT_PATH_MODE_LIBRARY ONLY) | ||
set(CMAKE_FIND_ROOT_PATH_MODE_INCLUDE ONLY) | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,3 +1,3 @@ | ||
include_directories(.) | ||
aux_source_directory(. LIB_DLFCN_SRCS) | ||
aux_source_directory(${CMAKE_CURRENT_SOURCE_DIR} LIB_DLFCN_SRCS) | ||
add_library(dlfcn-win32 STATIC ${LIB_DLFCN_SRCS}) | ||
target_include_directories(dlfcn-win32 PUBLIC $<BUILD_INTERFACE:${CMAKE_CURRENT_SOURCE_DIR}/..>) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,7 +1,5 @@ | ||
add_subdirectory(asn1c) | ||
include_directories(asn1c) | ||
include_directories(asn1c/asn1) | ||
aux_source_directory(. LIB_EUICC_SRCS) | ||
add_library (euicc STATIC ${LIB_EUICC_SRCS}) | ||
target_link_libraries(euicc euiccasn1) | ||
target_link_libraries(euicc cjson-static) | ||
aux_source_directory(${CMAKE_CURRENT_SOURCE_DIR} LIB_EUICC_SRCS) | ||
add_library(euicc STATIC ${LIB_EUICC_SRCS}) | ||
target_link_libraries(euicc euiccasn1 cjson-static) | ||
target_include_directories(euicc PUBLIC $<BUILD_INTERFACE:${CMAKE_CURRENT_SOURCE_DIR}/..>) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,10 +1,11 @@ | ||
include_directories(.) | ||
aux_source_directory(asn1 LIB_EUICC_ASN1_SRCS) | ||
add_library (euiccasn1 STATIC ${LIB_EUICC_ASN1_SRCS}) | ||
aux_source_directory(${CMAKE_CURRENT_SOURCE_DIR}/asn1 LIB_EUICC_ASN1_SRCS) | ||
add_library(euiccasn1 STATIC ${LIB_EUICC_ASN1_SRCS}) | ||
target_compile_definitions(euiccasn1 PRIVATE HAVE_CONFIG_H) | ||
target_include_directories(euiccasn1 PUBLIC | ||
$<BUILD_INTERFACE:${CMAKE_CURRENT_SOURCE_DIR}/asn1> | ||
$<BUILD_INTERFACE:${CMAKE_CURRENT_SOURCE_DIR}>) | ||
|
||
option(LINUX_MINGW32 "Build for windows on Linux" OFF) | ||
if(LINUX_MINGW32) | ||
if(MINGW) | ||
add_subdirectory(mingw32) | ||
target_link_libraries(euiccasn1 euiccasn1mingw32) | ||
endif() |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,3 +1,3 @@ | ||
include_directories(.) | ||
aux_source_directory(. LIB_EUICC_ASN1_MINGW32_SRCS) | ||
add_library (euiccasn1mingw32 STATIC ${LIB_EUICC_ASN1_MINGW32_SRCS}) | ||
aux_source_directory(${CMAKE_CURRENT_SOURCE_DIR} LIB_EUICC_ASN1_MINGW32_SRCS) | ||
add_library(euiccasn1mingw32 STATIC ${LIB_EUICC_ASN1_MINGW32_SRCS}) | ||
target_include_directories(euiccasn1mingw32 PUBLIC $<BUILD_INTERFACE:${CMAKE_CURRENT_SOURCE_DIR}>) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,27 +1,26 @@ | ||
option(LINUX_MINGW32 "Build for windows on Linux" OFF) | ||
|
||
add_library(apduinterface_pcsc SHARED pcsc.c) | ||
target_link_libraries(apduinterface_pcsc cjson-static) | ||
target_link_libraries(apduinterface_pcsc euicc cjson-static) | ||
set_target_properties(apduinterface_pcsc PROPERTIES LIBRARY_OUTPUT_DIRECTORY "${CMAKE_BINARY_DIR}/output") | ||
set_target_properties(apduinterface_pcsc PROPERTIES RUNTIME_OUTPUT_DIRECTORY "${CMAKE_BINARY_DIR}/output") | ||
install(TARGETS apduinterface_pcsc LIBRARY DESTINATION lib/lpac) | ||
|
||
if(LINUX_MINGW32 OR CYGWIN) | ||
if(MINGW OR CYGWIN) | ||
target_link_libraries(apduinterface_pcsc winscard) | ||
elseif (APPLE) | ||
elseif(APPLE) | ||
target_link_libraries(apduinterface_pcsc "-framework PCSC") | ||
else() | ||
find_package(PCSCLite) | ||
target_link_libraries(apduinterface_pcsc PCSCLite::PCSCLite) | ||
endif() | ||
|
||
add_library(apduinterface_at SHARED at.c) | ||
target_link_libraries(apduinterface_at euicc) | ||
set_target_properties(apduinterface_at PROPERTIES LIBRARY_OUTPUT_DIRECTORY "${CMAKE_BINARY_DIR}/output") | ||
set_target_properties(apduinterface_at PROPERTIES RUNTIME_OUTPUT_DIRECTORY "${CMAKE_BINARY_DIR}/output") | ||
install(TARGETS apduinterface_at LIBRARY DESTINATION lib/lpac) | ||
|
||
add_library(apduinterface_stdio SHARED stdio.c) | ||
target_link_libraries(apduinterface_stdio cjson-static) | ||
target_link_libraries(apduinterface_stdio euicc cjson-static) | ||
set_target_properties(apduinterface_stdio PROPERTIES LIBRARY_OUTPUT_DIRECTORY "${CMAKE_BINARY_DIR}/output") | ||
set_target_properties(apduinterface_stdio PROPERTIES RUNTIME_OUTPUT_DIRECTORY "${CMAKE_BINARY_DIR}/output") | ||
install(TARGETS apduinterface_stdio LIBRARY DESTINATION lib/lpac) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,19 +1,12 @@ | ||
option(LINUX_MINGW32 "Build for windows on Linux" OFF) | ||
|
||
|
||
add_library(httpinterface_curl SHARED curl.c) | ||
if(LINUX_MINGW32) | ||
target_link_libraries(httpinterface_curl dlfcn-win32) | ||
else() | ||
target_link_libraries(httpinterface_curl dl) | ||
endif() | ||
target_link_libraries(httpinterface_curl euicc ${DL_LIBRARY}) | ||
set_target_properties(httpinterface_curl PROPERTIES LIBRARY_OUTPUT_DIRECTORY "${CMAKE_BINARY_DIR}/output") | ||
set_target_properties(httpinterface_curl PROPERTIES RUNTIME_OUTPUT_DIRECTORY "${CMAKE_BINARY_DIR}/output") | ||
install(TARGETS httpinterface_curl LIBRARY DESTINATION lib/lpac) | ||
|
||
|
||
add_library(httpinterface_stdio SHARED stdio.c) | ||
target_link_libraries(httpinterface_stdio cjson-static) | ||
target_link_libraries(httpinterface_stdio euicc cjson-static) | ||
set_target_properties(httpinterface_stdio PROPERTIES LIBRARY_OUTPUT_DIRECTORY "${CMAKE_BINARY_DIR}/output") | ||
set_target_properties(httpinterface_stdio PROPERTIES RUNTIME_OUTPUT_DIRECTORY "${CMAKE_BINARY_DIR}/output") | ||
install(TARGETS httpinterface_stdio LIBRARY DESTINATION lib/lpac) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,28 +1,18 @@ | ||
option(LINUX_MINGW32 "Build for windows on Linux" OFF) | ||
|
||
if(APPLE) | ||
set(RPATH_BINARY_PATH "@loader_path") | ||
else() | ||
set(RPATH_BINARY_PATH "$ORIGIN") | ||
endif() | ||
|
||
include_directories(.) | ||
aux_source_directory(. DIR_LPAC_SRCS) | ||
aux_source_directory(applet DIR_LPAC_SRCS) | ||
aux_source_directory(applet/chip DIR_LPAC_SRCS) | ||
aux_source_directory(applet/notification DIR_LPAC_SRCS) | ||
aux_source_directory(applet/profile DIR_LPAC_SRCS) | ||
aux_source_directory(${CMAKE_CURRENT_SOURCE_DIR} DIR_LPAC_SRCS) | ||
aux_source_directory(${CMAKE_CURRENT_SOURCE_DIR}/applet DIR_LPAC_SRCS) | ||
aux_source_directory(${CMAKE_CURRENT_SOURCE_DIR}/applet/chip DIR_LPAC_SRCS) | ||
aux_source_directory(${CMAKE_CURRENT_SOURCE_DIR}/applet/notification DIR_LPAC_SRCS) | ||
aux_source_directory(${CMAKE_CURRENT_SOURCE_DIR}/applet/profile DIR_LPAC_SRCS) | ||
add_executable(lpac ${DIR_LPAC_SRCS}) | ||
set_target_properties(lpac PROPERTIES | ||
RUNTIME_OUTPUT_DIRECTORY "${CMAKE_BINARY_DIR}/output" | ||
BUILD_RPATH "${RPATH_BINARY_PATH}" | ||
) | ||
target_link_libraries(lpac euicc) | ||
|
||
if(LINUX_MINGW32) | ||
target_link_libraries(lpac dlfcn-win32) | ||
else() | ||
target_link_libraries(lpac dl) | ||
endif() | ||
|
||
install(TARGETS lpac RUNTIME DESTINATION bin) | ||
target_link_libraries(lpac euicc ${DL_LIBRARY}) | ||
target_include_directories(lpac PUBLIC $<BUILD_INTERFACE:${CMAKE_CURRENT_SOURCE_DIR}>) |