2
0
mirror of https://github.com/AxioDL/metaforce.git synced 2025-07-07 18:05:52 +00:00

CMakeLists: Organize source files

Organizes the source files to have a consistent formatting and layout.
This commit is contained in:
Lioncash 2019-08-25 19:56:11 -04:00
parent a357648a99
commit 1558d3d355

View File

@ -11,7 +11,8 @@ find_package(Qt5Xml)
if(APPLE) if(APPLE)
set(PLAT_SRCS MacOSSystemVersion.hpp MacOSSystemVersion.mm) set(PLAT_SRCS MacOSSystemVersion.hpp MacOSSystemVersion.mm)
set_source_files_properties(MacOSSystemVersion.mm set_source_files_properties(MacOSSystemVersion.mm
PROPERTIES COMPILE_FLAGS -fobjc-arc) PROPERTIES COMPILE_FLAGS -fobjc-arc
)
find_library(FOUNDATION_LIBRARY Foundation) find_library(FOUNDATION_LIBRARY Foundation)
set(PLAT_LIBS ${FOUNDATION_LIBRARY}) set(PLAT_LIBS ${FOUNDATION_LIBRARY})
elseif("${CMAKE_SYSTEM_NAME}" STREQUAL "Linux") elseif("${CMAKE_SYSTEM_NAME}" STREQUAL "Linux")
@ -23,7 +24,8 @@ if(WIN32)
elseif(APPLE) elseif(APPLE)
list(APPEND PLAT_SRCS platforms/mac/mainicon.icns) list(APPEND PLAT_SRCS platforms/mac/mainicon.icns)
set_source_files_properties(platforms/mac/mainicon.icns PROPERTIES set_source_files_properties(platforms/mac/mainicon.icns PROPERTIES
MACOSX_PACKAGE_LOCATION Resources) MACOSX_PACKAGE_LOCATION Resources
)
endif() endif()
add_subdirectory(platforms/freedesktop) add_subdirectory(platforms/freedesktop)
@ -32,25 +34,47 @@ list(APPEND PLAT_SRCS mainicon_qt.cpp)
file(GLOB QUAZIP_SRCS quazip/quazip/*.c quazip/quazip/*.cpp quazip/quazip/*.h) file(GLOB QUAZIP_SRCS quazip/quazip/*.c quazip/quazip/*.cpp quazip/quazip/*.h)
list(REMOVE_ITEM QUAZIP_SRCS list(REMOVE_ITEM QUAZIP_SRCS
${CMAKE_CURRENT_SOURCE_DIR}/quazip/quazip/quagzipfile.cpp ${CMAKE_CURRENT_SOURCE_DIR}/quazip/quazip/quagzipfile.cpp
${CMAKE_CURRENT_SOURCE_DIR}/quazip/quazip/quagzipfile.h) ${CMAKE_CURRENT_SOURCE_DIR}/quazip/quazip/quagzipfile.h
)
if (NOT MSVC) if (NOT MSVC)
set_source_files_properties(${QUAZIP_SRCS} PROPERTIES COMPILE_OPTIONS -Wno-deprecated-declarations) set_source_files_properties(${QUAZIP_SRCS} PROPERTIES COMPILE_OPTIONS -Wno-deprecated-declarations)
endif() endif()
add_executable(hecl-gui WIN32 MACOSX_BUNDLE add_executable(hecl-gui WIN32 MACOSX_BUNDLE
ArgumentEditor.ui ArgumentEditor.cpp ArgumentEditor.hpp ArgumentEditor.cpp
MainWindow.ui MainWindow.hpp MainWindow.cpp ArgumentEditor.hpp
LaunchMenu.hpp LaunchMenu.cpp ArgumentEditor.ui
EscapeSequenceParser.hpp EscapeSequenceParser.cpp Common.cpp
FileDirDialog.hpp ErrorLabel.hpp Common.hpp
SysReqTableView.hpp SysReqTableView.cpp DownloadManager.cpp
VectorISATableView.hpp VectorISATableView.cpp DownloadManager.hpp
VectorISATableModel.hpp VectorISATableModelIntel.hpp ErrorLabel.hpp
FindBlender.hpp FindBlender.cpp EscapeSequenceParser.cpp
DownloadManager.hpp DownloadManager.cpp EscapeSequenceParser.hpp
ExtractZip.hpp ExtractZip.cpp ${QUAZIP_SRCS} ExtractZip.cpp
Common.hpp Common.cpp ${PLAT_SRCS} main.cpp) ExtractZip.hpp
FileDirDialog.hpp
FindBlender.cpp
FindBlender.hpp
LaunchMenu.cpp
LaunchMenu.hpp
MainWindow.cpp
MainWindow.hpp
MainWindow.ui
SysReqTableView.cpp
SysReqTableView.hpp
VectorISATableModel.hpp
VectorISATableModelIntel.hpp
VectorISATableView.cpp
VectorISATableView.hpp
main.cpp
${PLAT_SRCS}
${QUAZIP_SRCS}
)
if(COMMAND add_sanitizers) if(COMMAND add_sanitizers)
add_sanitizers(hecl-gui) add_sanitizers(hecl-gui)
endif() endif()
@ -60,13 +84,23 @@ if (NOT MSVC)
endif() endif()
set_target_properties(hecl-gui PROPERTIES set_target_properties(hecl-gui PROPERTIES
MACOSX_BUNDLE_INFO_PLIST "${CMAKE_CURRENT_SOURCE_DIR}/platforms/mac/Info.plist") MACOSX_BUNDLE_INFO_PLIST "${CMAKE_CURRENT_SOURCE_DIR}/platforms/mac/Info.plist"
)
target_include_directories(hecl-gui PRIVATE quazip/quazip) target_include_directories(hecl-gui PRIVATE quazip/quazip)
target_compile_definitions(hecl-gui PRIVATE QUAZIP_STATIC=1) target_compile_definitions(hecl-gui PRIVATE QUAZIP_STATIC=1)
target_link_libraries(hecl-gui ${PLAT_LIBS} target_link_libraries(hecl-gui
${Qt5Widgets_LIBRARIES} ${PLAT_LIBS}
${Qt5Network_LIBRARIES}
${Qt5Xml_LIBRARIES} ${Qt5Network_LIBRARIES}
hecl-light logvisor zeus athena-core xxhash z) ${Qt5Widgets_LIBRARIES}
${Qt5Xml_LIBRARIES}
athena-core
hecl-light
logvisor
xxhash
z
zeus
)