LunaTranslator/cpp/libs/libs.cmake

58 lines
2.3 KiB
CMake
Raw Normal View History

2024-10-22 11:41:47 +08:00

2024-11-04 23:10:41 +08:00
add_library(nlohmann INTERFACE)
target_include_directories(nlohmann INTERFACE ${CMAKE_CURRENT_LIST_DIR})
2024-05-19 07:14:35 +08:00
2024-11-06 06:46:35 +08:00
option(IS_LUNAHOOK "IS_LUNAHOOK" OFF)
if(IS_LUNAHOOK)
2024-11-15 07:15:44 +08:00
add_subdirectory(${CMAKE_CURRENT_LIST_DIR}/minhook ${CMAKE_BINARY_DIR}/minhook)
2024-11-06 06:46:35 +08:00
else()
2024-11-30 08:45:58 +08:00
# add_library(Detours ${CMAKE_CURRENT_LIST_DIR}/Detours/src/creatwth.cpp ${CMAKE_CURRENT_LIST_DIR}/Detours/src/detours.cpp ${CMAKE_CURRENT_LIST_DIR}/Detours/src/modules.cpp ${CMAKE_CURRENT_LIST_DIR}/Detours/src/disasm.cpp)
# target_include_directories(Detours PUBLIC ${CMAKE_CURRENT_LIST_DIR}/Detours/src)
2024-11-06 06:46:35 +08:00
2024-11-15 07:15:44 +08:00
add_library(wil INTERFACE)
target_include_directories(wil INTERFACE ${CMAKE_CURRENT_LIST_DIR}/wil/include)
2024-11-04 23:10:41 +08:00
2024-11-15 07:15:44 +08:00
add_subdirectory(${CMAKE_CURRENT_LIST_DIR}/tinymp3 ${CMAKE_BINARY_DIR}/tinymp3)
add_subdirectory(${CMAKE_CURRENT_LIST_DIR}/rapidfuzz-cpp ${CMAKE_BINARY_DIR}/rapidfuzz-cpp)
2024-11-04 23:10:41 +08:00
2024-11-15 07:15:44 +08:00
add_library(webview2 INTERFACE)
target_include_directories(webview2 INTERFACE ${CMAKE_CURRENT_LIST_DIR}/webview2/Microsoft.Web.WebView2.1.0.2535.41/build/native/include)
2024-01-29 03:24:33 +08:00
2024-11-06 06:46:35 +08:00
2024-11-15 07:15:44 +08:00
option(USE_VCLTL "USE_VCLTL" ON)
if(USE_VCLTL)
if(${CMAKE_SIZEOF_VOID_P} EQUAL 4)
set(LTLPlatform "Win32")
endif()
if(WINXP)
set(WindowsTargetPlatformMinVersion "5.1.2600.0")
endif()
include("${CMAKE_CURRENT_LIST_DIR}/VC-LTL helper for cmake.cmake")
endif()
2024-11-04 23:10:41 +08:00
2024-11-15 07:15:44 +08:00
file(GLOB Clipper2LibSrc ${CMAKE_CURRENT_LIST_DIR}/Clipper2/CPP/Clipper2Lib/src/*.cpp)
add_library(Clipper2Lib ${Clipper2LibSrc})
target_include_directories(Clipper2Lib PUBLIC ${CMAKE_CURRENT_LIST_DIR}/Clipper2/CPP/Clipper2Lib/include)
2024-11-05 15:46:45 +08:00
2024-11-15 07:15:44 +08:00
if(${CMAKE_SIZEOF_VOID_P} EQUAL 8)
set(OnnxRuntime_DIR ${CMAKE_CURRENT_LIST_DIR}/onnxruntime-static/windows-x64)
set(OpenCV_DIR ${CMAKE_CURRENT_LIST_DIR}/opencv-static/windows-x64)
set(OpenCV_ARCH x64)
else()
set(OnnxRuntime_DIR ${CMAKE_CURRENT_LIST_DIR}/onnxruntime-static/windows-x86)
set(OpenCV_DIR ${CMAKE_CURRENT_LIST_DIR}/opencv-static/windows-x86)
set(OpenCV_ARCH x86)
endif()
set(OpenCV_RUNTIME vc16)
2024-11-15 03:04:53 +08:00
endif()
option(WINXP "WINXP" OFF)
if(WINXP)
2024-11-15 08:27:40 +08:00
add_definitions(-DWINXP=${WINXP})
2024-11-15 07:15:44 +08:00
set(YY_Thunks_for_WinXP ${CMAKE_CURRENT_LIST_DIR}/YY-Thunks/objs/X86/YY_Thunks_for_WinXP.obj)
2024-11-15 03:04:53 +08:00
else()
2024-11-15 07:15:44 +08:00
set(YY_Thunks_for_WinXP)
2024-11-06 06:46:35 +08:00
endif()