1
0
Fork 0
mirror of https://github.com/OpenMW/openmw.git synced 2026-02-01 20:18:28 +00:00
openmw/apps/wizard/CMakeLists.txt
AnyOldName3 16efa6e5b5 Support long paths on Windows
Apparently we'd never bothered opting in, despite nearly everything in all out apps being entirely compatible and designed with long paths in mind.

GetModuleFileNameW is a bit awkward as it's just about the only Win32 function that returns the minimum of the buffer size and the string size - nearly everything else returns the full size even if it won't fit, so you can pass it a null pointer and a size of zero, and it'll tell you how much space you need to allocate.

I pretty much just copied the mostly-working long-path-friendly call site in the crash catcher to windowspath.cpp, but I also noticed that if the function failed and returned zero, the original implementation would loop forever, so I fixed that.

There was some code that could be ditched from the catch monitor as \\?\ is a prefix you can use to opt into long paths for a single API call instead of using the manifest to set it everywhere.
2026-01-07 15:12:22 +00:00

102 lines
2.4 KiB
CMake

set(WIZARD
componentselectionpage.cpp
conclusionpage.cpp
existinginstallationpage.cpp
importpage.cpp
inisettings.cpp
installationtargetpage.cpp
intropage.cpp
languageselectionpage.cpp
main.cpp
mainwizard.cpp
methodselectionpage.cpp
utils/componentlistwidget.cpp
)
if(WIN32)
list(APPEND WIZARD ${CMAKE_SOURCE_DIR}/files/windows/openmw-wizard.rc)
endif()
set(WIZARD_HEADER
componentselectionpage.hpp
conclusionpage.hpp
existinginstallationpage.hpp
importpage.hpp
inisettings.hpp
installationtargetpage.hpp
intropage.hpp
languageselectionpage.hpp
mainwizard.hpp
methodselectionpage.hpp
utils/componentlistwidget.hpp
)
if (OPENMW_USE_UNSHIELD)
set (WIZARD ${WIZARD} installationpage.cpp unshield/unshieldworker.cpp)
set (WIZARD_HEADER ${WIZARD_HEADER} installationpage.hpp unshield/unshieldworker.hpp)
add_definitions(-DOPENMW_USE_UNSHIELD)
endif (OPENMW_USE_UNSHIELD)
source_group(wizard FILES ${WIZARD} ${WIZARD_HEADER})
set(QT_USE_QTGUI 1)
set (WIZARD_RES ${CMAKE_SOURCE_DIR}/files/wizard/wizard.qrc)
# Set some platform specific settings
if(WIN32)
set(WIZARD_RES ${WIZARD_RES} ${CMAKE_SOURCE_DIR}/files/windows/QWindowsVistaDark/dark.qrc)
set(GUI_TYPE WIN32)
set(QT_USE_QTMAIN TRUE)
endif(WIN32)
QT_ADD_RESOURCES(RCC_SRCS ${WIZARD_RES})
if (OPENMW_USE_UNSHIELD)
include_directories(${LIBUNSHIELD_INCLUDE_DIRS})
endif()
openmw_add_executable(openmw-wizard
${GUI_TYPE}
${WIZARD}
${WIZARD_HEADER}
${RCC_SRCS}
)
add_dependencies(openmw-wizard qm-files)
target_link_libraries(openmw-wizard
components_qt
)
target_link_libraries(openmw-wizard Qt::Widgets Qt::Core Qt::Svg)
if (OPENMW_USE_UNSHIELD)
target_link_libraries(openmw-wizard ${LIBUNSHIELD_LIBRARIES})
endif()
if (WIN32)
target_sources(openmw-wizard PRIVATE ${CMAKE_SOURCE_DIR}/files/windows/other-apps.manifest)
endif()
if(DPKG_PROGRAM)
INSTALL(TARGETS openmw-wizard RUNTIME DESTINATION games COMPONENT openmw-wizard)
endif()
if (BUILD_WITH_CODE_COVERAGE)
target_compile_options(openmw-wizard PRIVATE --coverage)
target_link_libraries(openmw-wizard gcov)
endif()
if (WIN32)
INSTALL(TARGETS openmw-wizard RUNTIME DESTINATION ".")
endif(WIN32)
if(USE_QT)
set_property(TARGET openmw-wizard PROPERTY AUTOMOC ON)
set_property(TARGET openmw-wizard PROPERTY AUTOUIC ON)
set_property(TARGET openmw-wizard PROPERTY AUTOUIC_SEARCH_PATHS ui)
endif(USE_QT)