2022-12-21 20:30:44 +08:00
|
|
|
cmake_minimum_required(VERSION 3.0.0)
|
2023-06-26 18:23:47 +08:00
|
|
|
# include(ExternalProject)
|
2022-12-21 20:30:44 +08:00
|
|
|
project(wxhelper VERSION 1.0.0)
|
2023-06-26 18:23:47 +08:00
|
|
|
enable_language(ASM_MASM)
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
# SET(CMAKE_ASM_NASM_FLAGS "-w0")
|
2022-12-21 20:30:44 +08:00
|
|
|
|
|
|
|
|
|
|
|
set(CMAKE_CXX_STANDARD 17)
|
|
|
|
set(CMAKE_CXX_STANDARD_REQUIRED True)
|
2023-06-26 18:23:47 +08:00
|
|
|
set(CMAKE_POSITION_INDEPENDENT_CODE TRUE)
|
2022-12-21 20:30:44 +08:00
|
|
|
|
|
|
|
|
2023-06-26 18:23:47 +08:00
|
|
|
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} /D '_UNICODE' /D 'UNICODE' ")
|
2022-12-21 20:30:44 +08:00
|
|
|
|
2023-06-26 18:23:47 +08:00
|
|
|
file(GLOB CPP_FILES ${PROJECT_SOURCE_DIR}/src/*.cc ${PROJECT_SOURCE_DIR}/src/*.cpp ${PROJECT_SOURCE_DIR}/src/*.c )
|
2022-12-21 20:30:44 +08:00
|
|
|
|
2023-06-26 18:23:47 +08:00
|
|
|
file(GLOB ASM_FILES ${PROJECT_SOURCE_DIR}/src/*.asm )
|
2022-12-21 20:30:44 +08:00
|
|
|
|
2023-06-26 18:23:47 +08:00
|
|
|
include_directories(${VCPKG_INSTALLED_DIR}/x64-windows/include ${PROJECT_SOURCE_DIR}/spdlog/include ${DETOURS_INCLUDE_DIRS})
|
|
|
|
# include_directories(${VCPKG_INSTALLED_DIR}/x64-windows/include ${PROJECT_SOURCE_DIR}/spdlog/include )
|
2022-12-21 20:30:44 +08:00
|
|
|
|
|
|
|
|
2023-06-26 18:23:47 +08:00
|
|
|
|
|
|
|
add_subdirectory(spdlog)
|
|
|
|
add_subdirectory(source)
|
|
|
|
|
2023-03-31 21:21:35 +08:00
|
|
|
# find_package(spdlog CONFIG REQUIRED)
|
|
|
|
|
2023-06-26 18:23:47 +08:00
|
|
|
find_package(nlohmann_json CONFIG REQUIRED)
|
|
|
|
|
|
|
|
find_path(DETOURS_INCLUDE_DIRS "detours/detours.h")
|
|
|
|
find_library(DETOURS_LIBRARY detours REQUIRED)
|
2022-12-21 20:30:44 +08:00
|
|
|
|
2023-06-26 18:23:47 +08:00
|
|
|
|
|
|
|
add_library(wxhelper SHARED ${CPP_FILES} ${ASM_FILES} )
|
2022-12-21 20:30:44 +08:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
target_link_libraries(wxhelper PRIVATE nlohmann_json::nlohmann_json)
|
2023-06-26 18:23:47 +08:00
|
|
|
target_link_libraries(wxhelper PRIVATE spdlog::spdlog spdlog::spdlog_header_only)
|
|
|
|
target_link_libraries(wxhelper PRIVATE ${DETOURS_LIBRARY})
|
|
|
|
|
2022-12-21 20:30:44 +08:00
|
|
|
|
|
|
|
SET_TARGET_PROPERTIES(wxhelper PROPERTIES LINKER_LANGUAGE C
|
|
|
|
ARCHIVE_OUTPUT_DIRECTORY ${PROJECT_BINARY_DIR}/lib
|
|
|
|
LIBRARY_OUTPUT_DIRECTORY ${PROJECT_BINARY_DIR}/lib
|
|
|
|
RUNTIME_OUTPUT_DIRECTORY ${PROJECT_BINARY_DIR}/lib
|
|
|
|
OUTPUT_NAME "wxhelper"
|
|
|
|
PREFIX "")
|
|
|
|
|