diff --git a/CMakeLists.txt b/CMakeLists.txt index 92f7b906..fc5b72f7 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -5,20 +5,13 @@ set(MO2_CMAKE_DEPRECATED_UIBASE_INCLUDE ON) project(organizer) -set(CMAKE_VS_INCLUDE_INSTALL_TO_DEFAULT_BUILD 1) +find_package(mo2-cmake CONFIG REQUIRED) -# if MO2_INSTALL_IS_BIN is set, this means that we should install directly into the -# installation prefix, without the bin/ subfolder, typically for a standalone build -# to update an existing install -if (MO2_INSTALL_IS_BIN) - set(_bin ".") -else() - set(_bin bin) -endif() +set(CMAKE_VS_INCLUDE_INSTALL_TO_DEFAULT_BUILD 1) add_subdirectory(src) add_subdirectory(themes) set_property(DIRECTORY ${CMAKE_CURRENT_SOURCE_DIR} PROPERTY VS_STARTUP_PROJECT organizer) -install(FILES ${CMAKE_CURRENT_SOURCE_DIR}/dump_running_process.bat DESTINATION ${_bin}) +install(FILES ${CMAKE_CURRENT_SOURCE_DIR}/dump_running_process.bat DESTINATION ${MO2_INSTALL_BIN}) diff --git a/src/CMakeLists.txt b/src/CMakeLists.txt index 53ba50cf..6a6deb0b 100644 --- a/src/CMakeLists.txt +++ b/src/CMakeLists.txt @@ -30,11 +30,11 @@ mo2_configure_target(organizer WARNINGS 4 TRANSLATIONS OFF) # we add translations "manually" to handle MO2_INSTALL_IS_BIN mo2_add_translations(organizer INSTALL_RELEASE - INSTALL_DIRECTORY "${_bin}/translations" + INSTALL_DIRECTORY "${MO2_INSTALL_BIN}/translations" SOURCES ${CMAKE_CURRENT_SOURCE_DIR}) mo2_set_project_to_run_from_install( - organizer EXECUTABLE ${CMAKE_INSTALL_PREFIX}/${_bin}/ModOrganizer.exe) + organizer EXECUTABLE ${CMAKE_INSTALL_PREFIX}/${MO2_INSTALL_BIN}/ModOrganizer.exe) target_link_libraries(organizer PRIVATE Shlwapi Bcrypt @@ -44,30 +44,30 @@ target_link_libraries(organizer PRIVATE Qt6::WebEngineWidgets Qt6::WebSockets Version Dbghelp) install(FILES "${CMAKE_CURRENT_SOURCE_DIR}/dlls.manifest.qt6" - DESTINATION ${_bin}/dlls + DESTINATION ${MO2_INSTALL_BIN}/dlls CONFIGURATIONS Release RelWithDebInfo RENAME dlls.manifest) install(FILES "${CMAKE_CURRENT_SOURCE_DIR}/dlls.manifest.debug.qt6" - DESTINATION ${_bin}/dlls + DESTINATION ${MO2_INSTALL_BIN}/dlls CONFIGURATIONS Debug RENAME dlls.manifest) if (NOT MO2_SKIP_TUTORIALS_INSTALL) install( DIRECTORY "${CMAKE_CURRENT_SOURCE_DIR}/tutorials" - DESTINATION ${_bin}) + DESTINATION ${MO2_INSTALL_BIN}) endif() install(FILES "${CMAKE_CURRENT_SOURCE_DIR}/resources/markdown.html" - DESTINATION ${_bin}/resources) + DESTINATION ${MO2_INSTALL_BIN}/resources) # install ModOrganizer.exe itself -install(FILES $ DESTINATION ${_bin}) +install(FILES $ DESTINATION ${MO2_INSTALL_BIN}) # install dependencies DLLs -install(FILES $ DESTINATION ${_bin}/dlls) -install(FILES $ DESTINATION ${_bin}/dlls) -install(FILES $ DESTINATION ${_bin}/dlls) +install(FILES $ DESTINATION ${MO2_INSTALL_BIN}/dlls) +install(FILES $ DESTINATION ${MO2_INSTALL_BIN}/dlls) +install(FILES $ DESTINATION ${MO2_INSTALL_BIN}/dlls) # this may copy over the ones from uibase/usvfs # - when building with mob, this should not matter as the files should be identical @@ -83,7 +83,7 @@ install(FILES $ $ $ -DESTINATION ${_bin}) +DESTINATION ${MO2_INSTALL_BIN}) # do not install PDB if CMAKE_INSTALL_PREFIX is "bin" if (NOT MO2_INSTALL_IS_BIN) @@ -91,7 +91,7 @@ if (NOT MO2_INSTALL_IS_BIN) endif() mo2_deploy_qt( - DIRECTORY ${_bin} + DIRECTORY ${MO2_INSTALL_BIN} BINARIES ModOrganizer.exe $) # set source groups for VS