2023-05-30 11:07:50 +03:00
|
|
|
CMAKE_MINIMUM_REQUIRED(VERSION 2.8.11)
|
|
|
|
PROJECT(WindowsXPKg)
|
|
|
|
SET(CMAKE_CXX_STANDARD 17)
|
|
|
|
|
2023-06-01 18:54:11 +03:00
|
|
|
set(OPENSSL_USE_STATIC_LIBS TRUE)
|
|
|
|
find_package(PkgConfig REQUIRED)
|
|
|
|
pkg_search_module(OPENSSL REQUIRED openssl)
|
2023-05-30 22:37:13 +03:00
|
|
|
|
2023-06-01 18:54:11 +03:00
|
|
|
if (!OPENSSL_FOUND)
|
|
|
|
message(FATAL_ERROR "OpenSSL Development Libraries Not Found")
|
|
|
|
endif()
|
2023-05-30 22:37:13 +03:00
|
|
|
|
2023-06-01 20:55:36 +03:00
|
|
|
include(cmake/CPM.cmake)
|
|
|
|
|
|
|
|
# include json runtime library
|
|
|
|
CPMAddPackage(
|
|
|
|
NAME nlohmann_json
|
|
|
|
GITHUB_REPOSITORY nlohmann/json
|
|
|
|
VERSION 3.11.2)
|
|
|
|
|
|
|
|
configure_file(keys.json keys.json COPYONLY)
|
2023-06-01 18:54:11 +03:00
|
|
|
|
|
|
|
set(BUILD_SHARED_LIBS OFF)
|
|
|
|
set(CMAKE_EXE_LINKER_FLAGS "-static")
|
2023-06-01 20:55:36 +03:00
|
|
|
ADD_EXECUTABLE(xpkey main.cpp xp.cpp key.cpp util.cpp cli.cpp)
|
2023-05-30 22:37:13 +03:00
|
|
|
TARGET_INCLUDE_DIRECTORIES(xpkey PUBLIC crypto)
|
2023-06-01 20:55:36 +03:00
|
|
|
TARGET_LINK_LIBRARIES(xpkey PUBLIC crypto nlohmann_json::nlohmann_json)
|
2023-06-01 18:54:11 +03:00
|
|
|
|
2023-06-01 20:55:36 +03:00
|
|
|
ADD_EXECUTABLE(srv2003key server.cpp key.cpp util.cpp cli.cpp)
|
2023-06-01 18:54:11 +03:00
|
|
|
TARGET_INCLUDE_DIRECTORIES(srv2003key PUBLIC crypto)
|
2023-06-01 20:55:36 +03:00
|
|
|
TARGET_LINK_LIBRARIES(srv2003key PUBLIC crypto nlohmann_json::nlohmann_json)
|