2024-02-07 20:59:24 +08:00
|
|
|
cmake_minimum_required(VERSION 3.16)
|
|
|
|
|
|
|
|
project(LunaHook)
|
|
|
|
|
|
|
|
set(CMAKE_MSVC_RUNTIME_LIBRARY "MultiThreaded$<$<CONFIG:Debug>:Debug>")
|
|
|
|
|
|
|
|
set(CMAKE_MODULE_PATH ${CMAKE_MODULE_PATH} ${CMAKE_CURRENT_SOURCE_DIR}/cmake)
|
|
|
|
|
|
|
|
add_compile_options(
|
|
|
|
/std:c++17
|
|
|
|
/MP
|
|
|
|
/wd4018
|
|
|
|
/wd4819
|
|
|
|
/wd4244
|
|
|
|
/wd4267
|
|
|
|
/DVERSION="${VERSION}"
|
|
|
|
/DUNICODE
|
|
|
|
/D_UNICODE
|
|
|
|
)
|
|
|
|
|
2024-02-08 17:14:01 +08:00
|
|
|
if(NOT CMAKE_BUILD_TYPE)
|
|
|
|
set(CMAKE_BUILD_TYPE Release)
|
|
|
|
endif()
|
|
|
|
|
2024-02-07 20:59:24 +08:00
|
|
|
if(${CMAKE_SIZEOF_VOID_P} EQUAL 8)
|
|
|
|
set(bitappendix "64")
|
|
|
|
else()
|
|
|
|
set(bitappendix "32")
|
|
|
|
endif()
|
|
|
|
|
2024-02-10 12:43:51 +08:00
|
|
|
if(NOT DEFINED LANGUAGE)
|
|
|
|
set(LANGUAGE English)
|
|
|
|
endif()
|
|
|
|
|
2024-04-26 20:23:31 +08:00
|
|
|
if(NOT DEFINED BUILD_CORE)
|
|
|
|
set(BUILD_CORE ON)
|
|
|
|
endif()
|
|
|
|
if(NOT DEFINED BUILD_PLUGIN)
|
|
|
|
set(BUILD_PLUGIN ON)
|
|
|
|
endif()
|
|
|
|
|
2024-04-20 12:15:10 +08:00
|
|
|
if(NOT DEFINED WINXP)
|
2024-04-21 17:38:47 +08:00
|
|
|
set(WINXPAPP "")
|
2024-04-20 12:15:10 +08:00
|
|
|
else()
|
2024-04-21 17:38:47 +08:00
|
|
|
set(WINXPAPP "_winxp")
|
2024-04-20 12:15:10 +08:00
|
|
|
endif()
|
|
|
|
|
2024-02-10 12:43:51 +08:00
|
|
|
add_definitions(-DLANGUAGE=${LANGUAGE})
|
|
|
|
|
2024-04-21 17:38:47 +08:00
|
|
|
set(CMAKE_FINAL_OUTPUT_DIRECTORY ${CMAKE_SOURCE_DIR}/builds/${CMAKE_BUILD_TYPE}_x${bitappendix}_${LANGUAGE}${WINXPAPP})
|
|
|
|
set(binary_out_putpath ${CMAKE_SOURCE_DIR}/builds/${CMAKE_BUILD_TYPE}_${LANGUAGE}${WINXPAPP})
|
2024-02-10 12:43:51 +08:00
|
|
|
#set(CMAKE_ARCHIVE_OUTPUT_DIRECTORY $<1:${CMAKE_FINAL_OUTPUT_DIRECTORY}>)
|
2024-02-08 16:45:23 +08:00
|
|
|
set(CMAKE_LIBRARY_OUTPUT_DIRECTORY $<1:${binary_out_putpath}>)
|
|
|
|
set(CMAKE_RUNTIME_OUTPUT_DIRECTORY $<1:${binary_out_putpath}>)
|
2024-02-07 20:59:24 +08:00
|
|
|
|
|
|
|
include_directories(.)
|
|
|
|
include(libs/libs.cmake)
|
|
|
|
|
|
|
|
include_directories(include)
|
2024-04-10 03:17:53 +08:00
|
|
|
set(CMAKE_MODULE_PATH ${CMAKE_MODULE_PATH} ${CMAKE_SOURCE_DIR}/version)
|
|
|
|
include(generate_product_version)
|
|
|
|
|
2024-11-01 23:34:22 +08:00
|
|
|
set(VERSION_MAJOR 5)
|
|
|
|
set(VERSION_MINOR 0)
|
|
|
|
set(VERSION_PATCH 0)
|
2024-04-10 03:17:53 +08:00
|
|
|
set(VERSION_REVISION 0)
|
|
|
|
|
2024-04-26 20:23:31 +08:00
|
|
|
if(BUILD_CORE)
|
2024-02-07 20:59:24 +08:00
|
|
|
add_subdirectory(include)
|
|
|
|
add_subdirectory(LunaHook)
|
2024-04-26 20:23:31 +08:00
|
|
|
add_subdirectory(LunaHost)
|
2024-04-26 19:06:02 +08:00
|
|
|
endif()
|
2024-04-26 20:23:31 +08:00
|
|
|
|
|
|
|
if(BUILD_PLUGIN)
|
|
|
|
add_subdirectory(LunaHost/GUI/Plugin)
|
|
|
|
endif()
|