From 8088c455ff2e45896715eae81afd20d4893bad83 Mon Sep 17 00:00:00 2001 From: Andrew Date: Thu, 1 Jun 2023 18:54:11 +0300 Subject: [PATCH] Revert CMakeLists.txt --- CMakeLists.txt | 29 +++++++++++++++++++++++------ 1 file changed, 23 insertions(+), 6 deletions(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index 7854bbe..7797025 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -2,13 +2,30 @@ CMAKE_MINIMUM_REQUIRED(VERSION 2.8.11) PROJECT(WindowsXPKg) SET(CMAKE_CXX_STANDARD 17) -FIND_PACKAGE(PkgConfig REQUIRED) -PKG_SEARCH_MODULE(OPENSSL REQUIRED openssl) +set(OPENSSL_USE_STATIC_LIBS TRUE) +find_package(PkgConfig REQUIRED) +pkg_search_module(OPENSSL REQUIRED openssl) -IF(!OPENSSL_FOUND) - MESSAGE(FATAL_ERROR "OpenSSL Not Found") -ENDIF() +if (!OPENSSL_FOUND) + message(FATAL_ERROR "OpenSSL Development Libraries Not Found") +endif() -ADD_EXECUTABLE(xpkey main.cpp xp.cpp server.cpp key.cpp util.cpp cli.cpp) +# generate bink.h +add_custom_command( + OUTPUT bink.h + COMMAND ${PROJECT_SOURCE_DIR}/convert_keys_to_cpp.py + WORKING_DIRECTORY ${PROJECT_SOURCE_DIR} + DEPENDS bink.h +) + +set(BUILD_SHARED_LIBS OFF) +set(CMAKE_EXE_LINKER_FLAGS "-static") +ADD_EXECUTABLE(xpkey xp_algorithm.cpp shared.cpp bink.h) TARGET_INCLUDE_DIRECTORIES(xpkey PUBLIC crypto) TARGET_LINK_LIBRARIES(xpkey PUBLIC crypto) +add_dependencies(xpkey bink.h) + +ADD_EXECUTABLE(srv2003key server_algorithm.cpp shared.cpp bink.h) +TARGET_INCLUDE_DIRECTORIES(srv2003key PUBLIC crypto) +TARGET_LINK_LIBRARIES(srv2003key PUBLIC crypto) +add_dependencies(srv2003key bink.h) \ No newline at end of file