aboutsummaryrefslogtreecommitdiff
path: root/libs/installer_fomod_plus/scanner/CMakeLists.txt
diff options
context:
space:
mode:
Diffstat (limited to 'libs/installer_fomod_plus/scanner/CMakeLists.txt')
-rw-r--r--libs/installer_fomod_plus/scanner/CMakeLists.txt54
1 files changed, 54 insertions, 0 deletions
diff --git a/libs/installer_fomod_plus/scanner/CMakeLists.txt b/libs/installer_fomod_plus/scanner/CMakeLists.txt
new file mode 100644
index 0000000..daea477
--- /dev/null
+++ b/libs/installer_fomod_plus/scanner/CMakeLists.txt
@@ -0,0 +1,54 @@
+cmake_minimum_required(VERSION 3.16)
+project(fomod_plus_scanner)
+
+include(FetchContent)
+set(project_type plugin)
+
+file(GLOB_RECURSE SCANNER_SOURCES CONFIGURE_DEPENDS
+ ${CMAKE_CURRENT_SOURCE_DIR}/*.cpp
+ ${CMAKE_CURRENT_SOURCE_DIR}/*.h
+ ${CMAKE_CURRENT_SOURCE_DIR}/*.ui
+ ${CMAKE_CURRENT_SOURCE_DIR}/*.qrc
+)
+
+add_library(fomod_plus_scanner SHARED ${SCANNER_SOURCES})
+
+FetchContent_Declare(json URL https://github.com/nlohmann/json/releases/download/v3.11.3/json.tar.xz)
+FetchContent_Declare(pugixml GIT_REPOSITORY https://github.com/zeux/pugixml GIT_TAG v1.14)
+FetchContent_MakeAvailable(pugixml json)
+
+target_include_directories(
+ fomod_plus_scanner
+ PUBLIC
+ ${CMAKE_CURRENT_SOURCE_DIR}
+ ${CMAKE_CURRENT_SOURCE_DIR}/../share
+ ${CMAKE_CURRENT_SOURCE_DIR}/../share/FOMODData
+ ${MO2_UIBASE_INCLUDE_DIRS}
+ ${MO2_ARCHIVE_INCLUDE_DIRS}
+)
+
+if (MSVC)
+ target_compile_options(
+ fomod_plus_scanner
+ PRIVATE
+ /bigobj
+ /W4
+ /WX
+ /wd4201
+ /wd4458
+ )
+endif ()
+
+target_link_libraries(fomod_plus_scanner PRIVATE mo2::uibase mo2::archive pugixml nlohmann_json::nlohmann_json)
+mo2_configure_plugin(fomod_plus_scanner NO_SOURCES WARNINGS OFF PRIVATE_DEPENDS archive)
+
+if (MSVC)
+ target_compile_options(fomod_plus_scanner PRIVATE $<$<CONFIG:RelWithDebInfo>:/Zi>)
+ target_link_options(fomod_plus_scanner PRIVATE $<$<CONFIG:RelWithDebInfo>:/DEBUG>)
+ install(FILES $<TARGET_PDB_FILE:fomod_plus_scanner>
+ DESTINATION ${CMAKE_RUNTIME_OUTPUT_DIRECTORY_RELWITHDEBINFO}
+ CONFIGURATIONS RelWithDebInfo
+ OPTIONAL)
+endif ()
+
+mo2_install_target(fomod_plus_scanner)