Debian Codegraph @

src/editor/CMakeLists.txt

raw
1 # Translation files in src/editor/translations (without .ts)
2 set(TS dustrac-editor_fi dustrac-editor_it dustrac-editor_cs dustrac-editor_fr dustrac-editor_de dustrac-editor_nl dustrac-editor_tr)
3 set(TS_FILES)
4 set(QM_FILES)
5 foreach(TS_FILE ${TS})
6 list(APPEND TS_FILES ${CMAKE_SOURCE_DIR}/src/editor/translations/${TS_FILE}.ts)
7 list(APPEND QM_FILES ${CMAKE_BINARY_DIR}/data/translations/${TS_FILE}.qm)
8 endforeach()
9 set_source_files_properties(${TS_FILES} PROPERTIES OUTPUT_LOCATION ${CMAKE_BINARY_DIR}/data/translations)
10
11 # Set sources
12 set(SRC
13 aboutdlg.cpp
14 application.cpp
15 draganddropstore.cpp
16 editordata.cpp
17 editorview.cpp
18 editormode.hpp
19 floodfill.cpp
20 main.cpp
21 mainwindow.cpp
22 map.cpp
23 mediator.cpp
24 newtrackdialog.cpp
25 object.cpp
26 objectfactory.cpp
27 objectmodelloader.cpp
28 rotatedialog.cpp
29 targetnode.cpp
30 targetnodesizedlg.cpp
31 tileanimator.cpp
32 trackdata.cpp
33 trackio.cpp
34 tracktile.cpp
35 trackpropertiesdialog.cpp
36 undostack.cpp
37 ../common/config.hpp
38 ../common/mapbase.cpp
39 ../common/objectbase.cpp
40 ../common/objects.cpp
41 ../common/route.cpp
42 ../common/targetnodebase.cpp
43 ../common/trackdatabase.cpp
44 ../common/tracktilebase.cpp)
45
46 set(RCS ${CMAKE_SOURCE_DIR}/data/images/editor.qrc ${CMAKE_SOURCE_DIR}/data/icons/icons.qrc)
47
48 include_directories(${CMAKE_CURRENT_SOURCE_DIR}/../common)
49
50 qt_add_resources(RC_SRC ${RCS})
51 qt_add_translation(QM ${TS_FILES})
52 qt_wrap_ui(UI_HDRS ${UIS})
53
54 # We need this to be able to include headers produced by uic in our code
55 include_directories(${CMAKE_BINARY_DIR})
56
57 # Resource compilation for MinGW
58 if(MINGW)
59 add_custom_command(
60 OUTPUT ${CMAKE_CURRENT_BINARY_DIR}/windowsrc.o
61 COMMAND
62 ${CMAKE_RC_COMPILER}
63 -I${CMAKE_SOURCE_DIR} -i${CMAKE_SOURCE_DIR}/data/icons/WindowsEditor.rc
64 -o ${CMAKE_CURRENT_BINARY_DIR}/windowsrc.o)
65 set(SRC ${SRC} ${CMAKE_CURRENT_BINARY_DIR}/windowsrc.o)
66 endif()
67
68 # Copy desktop file
69 if(ReleaseBuild AND UNIX)
70 set(DesktopFileSourcePath)
71 if(USC)
72 set(DesktopFileSourcePath ${CMAKE_SOURCE_DIR}/src/dustrac-editor.desktop.opt.in)
73 else()
74 set(DesktopFileSourcePath ${CMAKE_SOURCE_DIR}/src/dustrac-editor.desktop.in)
75 endif()
76 add_custom_target(desktop-file-editor ALL
77 COMMAND cmake -E copy ${DesktopFileSourcePath}
78 ${CMAKE_BINARY_DIR}/dustrac-editor.desktop
79 DEPENDS ${EDITOR_BINARY_NAME})
80 endif()
81
82 # Add the executable
83 set(EXECUTABLE_OUTPUT_PATH ${CMAKE_BINARY_DIR})
84 add_executable(${EDITOR_BINARY_NAME} WIN32 ${SRC} ${MOC_SRC} ${RC_SRC} ${UI_HDRS} ${QM})
85
86 target_link_libraries(${EDITOR_BINARY_NAME} Qt6::Widgets Qt6::Xml Argengine_static)
87 set_property(TARGET ${EDITOR_BINARY_NAME} PROPERTY CXX_STANDARD 17)