2022-08-28 23:28:36 +02:00
|
|
|
set(editor_SRCS
|
|
|
|
StdInc.cpp
|
|
|
|
main.cpp
|
|
|
|
launcherdirs.cpp
|
|
|
|
jsonutils.cpp
|
|
|
|
mainwindow.cpp
|
|
|
|
CGameInfo.cpp
|
2022-08-30 00:44:02 +02:00
|
|
|
BitmapHandler.cpp
|
|
|
|
maphandler.cpp
|
|
|
|
Animation.cpp
|
2022-08-30 04:38:24 +02:00
|
|
|
graphics.cpp
|
2022-08-30 15:08:33 +02:00
|
|
|
spoiler.cpp
|
|
|
|
windownewmap.cpp
|
2022-08-30 23:24:12 +02:00
|
|
|
generatorprogress.cpp
|
2022-08-31 20:05:57 +02:00
|
|
|
mapview.cpp
|
2022-09-01 03:51:29 +02:00
|
|
|
radiopushbutton.cpp
|
2022-09-03 06:12:07 +02:00
|
|
|
objectbrowser.cpp
|
2022-09-04 02:12:33 +02:00
|
|
|
inspector.cpp
|
|
|
|
mapsettings.cpp
|
2022-09-04 18:16:36 +02:00
|
|
|
playersettings.cpp
|
2022-09-04 20:01:49 +02:00
|
|
|
playerparams.cpp
|
2022-09-05 02:19:21 +02:00
|
|
|
scenelayer.cpp
|
|
|
|
mapcontroller.cpp
|
2022-09-06 21:16:30 +02:00
|
|
|
validator.cpp
|
2022-08-28 23:28:36 +02:00
|
|
|
)
|
|
|
|
|
|
|
|
set(editor_HEADERS
|
|
|
|
StdInc.h
|
|
|
|
launcherdirs.h
|
|
|
|
jsonutils.h
|
|
|
|
mainwindow.h
|
|
|
|
CGameInfo.h
|
2022-08-30 00:44:02 +02:00
|
|
|
BitmapHandler.h
|
|
|
|
maphandler.h
|
|
|
|
Animation.h
|
2022-08-30 04:38:24 +02:00
|
|
|
graphics.h
|
2022-08-30 15:08:33 +02:00
|
|
|
spoiler.h
|
|
|
|
windownewmap.h
|
2022-08-30 23:24:12 +02:00
|
|
|
generatorprogress.h
|
2022-08-31 20:05:57 +02:00
|
|
|
mapview.h
|
2022-09-01 03:51:29 +02:00
|
|
|
radiopushbutton.h
|
2022-09-03 06:12:07 +02:00
|
|
|
objectbrowser.h
|
2022-09-04 02:12:33 +02:00
|
|
|
inspector.h
|
|
|
|
mapsettings.h
|
2022-09-04 18:16:36 +02:00
|
|
|
playersettings.h
|
2022-09-04 20:01:49 +02:00
|
|
|
playerparams.h
|
2022-09-05 02:19:21 +02:00
|
|
|
scenelayer.h
|
|
|
|
mapcontroller.h
|
2022-09-06 21:16:30 +02:00
|
|
|
validator.h
|
2022-08-28 23:28:36 +02:00
|
|
|
)
|
|
|
|
|
|
|
|
set(editor_FORMS
|
|
|
|
mainwindow.ui
|
2022-08-30 15:08:33 +02:00
|
|
|
windownewmap.ui
|
2022-08-30 23:24:12 +02:00
|
|
|
generatorprogress.ui
|
2022-09-04 02:12:33 +02:00
|
|
|
mapsettings.ui
|
2022-09-04 18:16:36 +02:00
|
|
|
playersettings.ui
|
2022-09-04 20:01:49 +02:00
|
|
|
playerparams.ui
|
2022-09-06 21:16:30 +02:00
|
|
|
validator.ui
|
2022-08-28 23:28:36 +02:00
|
|
|
)
|
|
|
|
|
|
|
|
assign_source_group(${editor_SRCS} ${editor_HEADERS} VCMI_launcher.rc)
|
|
|
|
|
|
|
|
# Tell CMake to run moc when necessary:
|
|
|
|
set(CMAKE_AUTOMOC ON)
|
|
|
|
|
|
|
|
if(POLICY CMP0071)
|
|
|
|
cmake_policy(SET CMP0071 NEW)
|
|
|
|
endif()
|
|
|
|
|
|
|
|
# As moc files are generated in the binary dir, tell CMake
|
|
|
|
# to always look for includes there:
|
|
|
|
set(CMAKE_INCLUDE_CURRENT_DIR ON)
|
|
|
|
|
|
|
|
if(TARGET Qt6::Core)
|
|
|
|
qt_wrap_ui(editor_UI_HEADERS ${editor_FORMS})
|
|
|
|
else()
|
|
|
|
qt5_wrap_ui(editor_UI_HEADERS ${editor_FORMS})
|
|
|
|
endif()
|
|
|
|
|
|
|
|
if(WIN32)
|
|
|
|
set(editor_ICON VCMI_launcher.rc)
|
|
|
|
endif()
|
|
|
|
|
|
|
|
add_executable(vcmieditor WIN32 ${editor_SRCS} ${editor_HEADERS} ${editor_UI_HEADERS} ${editor_ICON})
|
|
|
|
|
|
|
|
if(WIN32)
|
|
|
|
set_target_properties(vcmieditor
|
|
|
|
PROPERTIES
|
|
|
|
OUTPUT_NAME "VCMI_mapeditor"
|
|
|
|
PROJECT_LABEL "VCMI_mapeditor"
|
|
|
|
)
|
|
|
|
|
|
|
|
# FIXME: Can't to get CMP0020 working with Vcpkg and CMake 3.8.2
|
|
|
|
# So far I tried:
|
|
|
|
# - cmake_minimum_required set to 2.8.11 globally and in this file
|
|
|
|
# - cmake_policy in all possible places
|
|
|
|
# - used NO_POLICY_SCOPE to make sure no other parts reset policies
|
|
|
|
# Still nothing worked, warning kept appearing and WinMain didn't link automatically
|
|
|
|
target_link_libraries(vcmieditor Qt${QT_VERSION_MAJOR}::WinMain)
|
|
|
|
endif()
|
|
|
|
|
|
|
|
if(APPLE)
|
|
|
|
# This makes Xcode project prettier by moving vcmilauncher_autogen directory into vcmiclient subfolder
|
|
|
|
set_property(GLOBAL PROPERTY AUTOGEN_TARGETS_FOLDER vcmieditor)
|
|
|
|
endif()
|
|
|
|
|
|
|
|
target_link_libraries(vcmieditor vcmi Qt${QT_VERSION_MAJOR}::Widgets Qt${QT_VERSION_MAJOR}::Network)
|
|
|
|
target_include_directories(vcmieditor
|
|
|
|
PUBLIC ${CMAKE_CURRENT_SOURCE_DIR}
|
|
|
|
)
|
|
|
|
vcmi_set_output_dir(vcmieditor "")
|
|
|
|
enable_pch(vcmieditor)
|
|
|
|
|
|
|
|
# Copy to build directory for easier debugging
|
|
|
|
add_custom_command(TARGET vcmieditor POST_BUILD
|
|
|
|
COMMAND ${CMAKE_COMMAND} -E remove_directory ${CMAKE_BINARY_DIR}/bin/${CMAKE_CFG_INTDIR}/mapeditor/icons
|
|
|
|
COMMAND ${CMAKE_COMMAND} -E copy_directory ${CMAKE_SOURCE_DIR}/mapeditor/icons ${CMAKE_BINARY_DIR}/bin/${CMAKE_CFG_INTDIR}/mapeditor/icons
|
|
|
|
)
|
|
|
|
|
|
|
|
install(TARGETS vcmieditor DESTINATION ${BIN_DIR})
|
|
|
|
# copy whole directory
|
|
|
|
install(DIRECTORY icons DESTINATION ${DATA_DIR}/mapeditor)
|
|
|
|
# Install icons and desktop file on Linux
|
|
|
|
if(NOT WIN32 AND NOT APPLE)
|
|
|
|
install(FILES "vcmilauncher.desktop" DESTINATION share/applications)
|
|
|
|
endif()
|