mirror of
https://gitea.wildfiregames.com/0ad/0ad
synced 2026-08-15 14:43:32 -07:00
Add CMake Configuration for ActorEditor
Name the project AtlasMisc as the atlas Object is shared. Not working as of 04.06.2026: - Linking to wxWidgets find_package target - Terrain.obj : `error LNK2019: Verweis auf nicht aufgel├Âstes externes Symbol ""int const wxEVT_NULL" (?wxEVT_NULL@@3HB)" in Funktion ""void __cdecl dynamic initializer for 'private: static struct wxEventTableEntry const * const TerrainSidebar::sm_eventTableEntries''(void)" (??__E?sm_eventTableEntries@TerrainSidebar@@0QBUwxEventTableEntry@@B@@YAXXZ)".` Working: - Using find_package extra variables to find most of the windows ext. libs - excluding SDL2 and Boost, which use the custom find_prebuild_library function
This commit is contained in:
parent
853472586f
commit
a58845d1c2
37 changed files with 567 additions and 1 deletions
|
|
@ -146,6 +146,11 @@ if(CMAKE_SYSTEM_NAME STREQUAL "Windows")
|
||||||
include(SetupWindowsLibs)
|
include(SetupWindowsLibs)
|
||||||
endif()
|
endif()
|
||||||
|
|
||||||
|
# Add subprojects
|
||||||
|
if(NOT without-atlas)
|
||||||
|
add_subdirectory(${CMAKE_SOURCE_DIR}/source/tools/atlas/)
|
||||||
|
endif()
|
||||||
|
|
||||||
# Add doxygen target
|
# Add doxygen target
|
||||||
if(build-docs)
|
if(build-docs)
|
||||||
add_subdirectory(${CMAKE_SOURCE_DIR}/docs/doxygen)
|
add_subdirectory(${CMAKE_SOURCE_DIR}/docs/doxygen)
|
||||||
|
|
|
||||||
|
|
@ -1,3 +1,47 @@
|
||||||
cmake_minimum_required(VERSION 3.25.1...4.0.0)
|
cmake_minimum_required(VERSION 3.25.1...4.0.0)
|
||||||
|
|
||||||
# 0AD Specific Functions
|
# 0AD Specific Functions
|
||||||
|
|
||||||
|
# Add Precompiled Headers. If no target is given, this macro will fail with a FATAL_ERROR.
|
||||||
|
# rationale: we need one PCH per static lib, since one global header would increase dependencies. To that end, we can either include them as
|
||||||
|
# "projectdir/precompiled.h", or add "source/PCH/projectdir" to the include path and put the PCH there. The latter is better because many
|
||||||
|
# projects contain several dirs and it's unclear where there the PCH should be stored. This way is also a bit easier to use in that
|
||||||
|
# source files always include "precompiled.h".
|
||||||
|
# Notes:
|
||||||
|
# * Visual Assist manages to use the project include path and can correctly open these files from the IDE.
|
||||||
|
# * precompiled.cpp (needed to "Create" the PCH) also goes in the abovementioned dir.
|
||||||
|
# * using CMakes precompiled Header is not possible, as it does not allow for a custom name like used here.
|
||||||
|
function(add_pch)
|
||||||
|
set(single_args TARGET PCH_DIR)
|
||||||
|
cmake_parse_arguments(args "" "${single_args}" "" ${ARGN})
|
||||||
|
if(NOT args_TARGET)
|
||||||
|
message(FATAL_ERROR "add_pch: Missing target!!")
|
||||||
|
endif()
|
||||||
|
|
||||||
|
include(PrecompiledHeader)
|
||||||
|
if(NOT args_PCH_DIR)
|
||||||
|
get_target_property(source_root ${args_TARGET} SOURCE_DIR)
|
||||||
|
set(args_PCH_DIR ${source_root}/pch/${args_TARGET})
|
||||||
|
endif()
|
||||||
|
# Put the project-specific PCH directory at the start of the include path, so '#include "precompiled.h"' will look in there first
|
||||||
|
target_include_directories(${args_TARGET}
|
||||||
|
BEFORE PRIVATE
|
||||||
|
${args_PCH_DIR}/
|
||||||
|
)
|
||||||
|
if (CMAKE_GENERATOR MATCHES "Visual Studio")
|
||||||
|
set(pch_header "precompiled.h")
|
||||||
|
elseif(CMAKE_GENERATOR MATCHES "Xcode")
|
||||||
|
set(pch_header "../${args_PCH_DIR}/precompiled.h")
|
||||||
|
else()
|
||||||
|
set(pch_header "${args_PCH_DIR}/precompiled.h")
|
||||||
|
endif()
|
||||||
|
|
||||||
|
precompile_header(${args_TARGET} ${pch_header} ${args_PCH_DIR}/precompiled.cpp)
|
||||||
|
|
||||||
|
target_sources(${args_TARGET}
|
||||||
|
PRIVATE
|
||||||
|
${args_PCH_DIR}/precompiled.cpp
|
||||||
|
${args_PCH_DIR}/precompiled.h
|
||||||
|
)
|
||||||
|
target_compile_definitions(${args_TARGET} PRIVATE CONFIG_ENABLE_PCH=1)
|
||||||
|
endfunction(add_pch)
|
||||||
|
|
|
||||||
54
cmake/FindPrebuildLibrary.cmake
Normal file
54
cmake/FindPrebuildLibrary.cmake
Normal file
|
|
@ -0,0 +1,54 @@
|
||||||
|
function(find_prebuild_library _name)
|
||||||
|
include(FindPackageHandleStandardArgs)
|
||||||
|
set(multi_args COMPONENTS PATHS)
|
||||||
|
set(single_args INC_PATH VERSION)
|
||||||
|
cmake_parse_arguments(args "${multi_args}" "${single_args}" "" ${ARGN})
|
||||||
|
|
||||||
|
string(TOLOWER ${_name} libname)
|
||||||
|
string(TOUPPER ${_name} target_name)
|
||||||
|
# ++++++++ Handle COMPONENTS +++++++++++++++++++++
|
||||||
|
if(args_COMPONENTS)
|
||||||
|
|
||||||
|
endif()
|
||||||
|
|
||||||
|
# ++++++++ Find relevant elements ++++++++++++++++
|
||||||
|
find_library(Lib${_name} NAMES ${libname} ${libname}${args_VERSION})
|
||||||
|
if(NOT args_INC_PATH)
|
||||||
|
find_path(Lib${_name}_inc NAMES ${libname}.h PATHS ${0AD_EXT_LIBDIR}/${_name}/include/)
|
||||||
|
# recursive add all paths beneth included...
|
||||||
|
else()
|
||||||
|
set(Lib${_name}_inc ${args_INC_PATH})
|
||||||
|
endif()
|
||||||
|
if(NOT Lib${_name}_inc)
|
||||||
|
set(Lib${_name}_inc ${0AD_EXT_LIBDIR}/${_name}/include/)
|
||||||
|
endif()
|
||||||
|
|
||||||
|
find_package_handle_standard_args(Lib${_name} REQUIRED_VARS Lib${_name})
|
||||||
|
message(STATUS "${Lib${_name}} - ${Lib${_name}_inc} - ${Lib${_name}_FOUND} - ${target_name}::${target_name}")
|
||||||
|
|
||||||
|
if (Lib${_name}_FOUND)
|
||||||
|
mark_as_advanced(
|
||||||
|
Lib${_name}
|
||||||
|
Lib${_name}_inc
|
||||||
|
)
|
||||||
|
endif()
|
||||||
|
if(Lib${_name} MATCHES "LibBoost")
|
||||||
|
add_library(${target_name}::headers INTERFACE IMPORTED)
|
||||||
|
set_target_properties(${target_name}::headers PROPERTIES
|
||||||
|
IMPORTED_LOCATION ${Lib${_name}_inc}
|
||||||
|
INTERFACE_INCLUDE_DIRECTORIES ${Lib${_name}_inc}
|
||||||
|
)
|
||||||
|
elseif(Lib${_name} MATCHES "SDL2")
|
||||||
|
add_library(${target_name}::${target_name} UNKNOWN IMPORTED)
|
||||||
|
set_target_properties(${target_name}::${target_name} PROPERTIES
|
||||||
|
IMPORTED_LOCATION ${Lib${_name}}
|
||||||
|
INTERFACE_INCLUDE_DIRECTORIES ${Lib${_name}_inc}/SDL
|
||||||
|
)
|
||||||
|
elseif (Lib${_name} AND NOT TARGET ${target_name}::${target_name})
|
||||||
|
add_library(${target_name}::${target_name} UNKNOWN IMPORTED)
|
||||||
|
set_target_properties(${target_name}::${target_name} PROPERTIES
|
||||||
|
IMPORTED_LOCATION ${Lib${_name}}
|
||||||
|
INTERFACE_INCLUDE_DIRECTORIES ${Lib${_name}_inc}
|
||||||
|
)
|
||||||
|
endif()
|
||||||
|
endfunction()
|
||||||
35
cmake/PrecompiledHeader.cmake
Normal file
35
cmake/PrecompiledHeader.cmake
Normal file
|
|
@ -0,0 +1,35 @@
|
||||||
|
# Adds a custom precompiled header. This header must be included in the code if not added with FORCE_INCLUDE
|
||||||
|
function(precompile_header _target _header _source)
|
||||||
|
set(single_args FORCE_INCLUDE)
|
||||||
|
cmake_parse_arguments(args "" "${single_args}" "" ${ARGN})
|
||||||
|
|
||||||
|
if(CMAKE_CXX_COMPILER_ID STREQUAL "MSVC" OR CMAKE_C_COMPILER_ID STREQUAL "MSVC")
|
||||||
|
# Solution based opon https://www.dominikgrabiec.com/posts/2022/10/18/precompiled_header_snippet.html
|
||||||
|
target_compile_options(${_target}
|
||||||
|
PRIVATE
|
||||||
|
"/Yu${_header}"
|
||||||
|
)
|
||||||
|
set_source_files_properties(${_source}
|
||||||
|
PROPERTIES
|
||||||
|
COMPILE_OPTIONS "/Yc${_header}"
|
||||||
|
)
|
||||||
|
if(${args_FORCE_INCLUDE})
|
||||||
|
set_source_files_properties(${_source}
|
||||||
|
PROPERTIES
|
||||||
|
COMPILE_OPTIONS /FI${_header}
|
||||||
|
)
|
||||||
|
endif()
|
||||||
|
elseif(CMAKE_CXX_COMPILER_ID MATCHES "Clang|GNU|AppleClang" OR CMAKE_C_COMPILER_ID MATCHES "Clang|GNU|AppleClang")
|
||||||
|
# Solution is based on internal cmake code
|
||||||
|
set_source_files_properties(${_source}
|
||||||
|
PROPERTIES
|
||||||
|
COMPILE_OPTIONS -Winvalid-pch -x ${_header}.gch
|
||||||
|
)
|
||||||
|
if(${args_FORCE_INCLUDE})
|
||||||
|
set_source_files_properties(${_source}
|
||||||
|
PROPERTIES
|
||||||
|
COMPILE_OPTIONS include ${_header}.gch
|
||||||
|
)
|
||||||
|
endif()
|
||||||
|
endif()
|
||||||
|
endfunction()
|
||||||
5
source/tools/atlas/AtlasFrontends/CMakeLists.txt
Normal file
5
source/tools/atlas/AtlasFrontends/CMakeLists.txt
Normal file
|
|
@ -0,0 +1,5 @@
|
||||||
|
target_sources(ActorEditor
|
||||||
|
PRIVATE
|
||||||
|
$<$<PLATFORM_ID:Windows>: ActorEditor.rc> # Caution, the blank before the File is needed
|
||||||
|
ActorEditor.cpp
|
||||||
|
)
|
||||||
15
source/tools/atlas/AtlasObject/CMakeLists.txt
Normal file
15
source/tools/atlas/AtlasObject/CMakeLists.txt
Normal file
|
|
@ -0,0 +1,15 @@
|
||||||
|
target_sources(AtlasObject
|
||||||
|
PRIVATE
|
||||||
|
AtlasObject.h
|
||||||
|
AtlasObjectImpl.cpp
|
||||||
|
AtlasObjectImpl.h
|
||||||
|
AtlasObjectJS.cpp
|
||||||
|
AtlasObjectText.cpp
|
||||||
|
AtlasObjectText.h
|
||||||
|
AtlasObjectXML.cpp
|
||||||
|
JSONSpiritInclude.h
|
||||||
|
)
|
||||||
|
|
||||||
|
if(NOT without-tests)
|
||||||
|
add_subdirectory(tests/)
|
||||||
|
endif()
|
||||||
13
source/tools/atlas/AtlasObject/tests/CMakeLists.txt
Normal file
13
source/tools/atlas/AtlasObject/tests/CMakeLists.txt
Normal file
|
|
@ -0,0 +1,13 @@
|
||||||
|
cxxtest_add_test(test_atlas_object_xml testAtlasObjectXML.cpp ${CMAKE_CURRENT_LIST_DIR}/test_AtlasObjectXML.h)
|
||||||
|
|
||||||
|
target_include_directories(test_atlas_object_xml
|
||||||
|
PRIVATE
|
||||||
|
${CMAKE_SOURCE_DIR}/source
|
||||||
|
${CXXTEST_INCLUDE_DIRS}
|
||||||
|
)
|
||||||
|
|
||||||
|
target_link_libraries(test_atlas_object_xml
|
||||||
|
PRIVATE
|
||||||
|
${BUILD_FLAGS_TARGET}
|
||||||
|
AtlasObject
|
||||||
|
)
|
||||||
13
source/tools/atlas/AtlasUI/ActorEditor/CMakeLists.txt
Normal file
13
source/tools/atlas/AtlasUI/ActorEditor/CMakeLists.txt
Normal file
|
|
@ -0,0 +1,13 @@
|
||||||
|
target_sources(AtlasUI
|
||||||
|
PRIVATE
|
||||||
|
ActorEditor.cpp
|
||||||
|
ActorEditor.h
|
||||||
|
ActorEditorListCtrl.cpp
|
||||||
|
ActorEditorListCtrl.h
|
||||||
|
AnimListEditor.cpp
|
||||||
|
AnimListEditor.h
|
||||||
|
PropListEditor.cpp
|
||||||
|
PropListEditor.h
|
||||||
|
TexListEditor.cpp
|
||||||
|
TexListEditor.h
|
||||||
|
)
|
||||||
5
source/tools/atlas/AtlasUI/CMakeLists.txt
Normal file
5
source/tools/atlas/AtlasUI/CMakeLists.txt
Normal file
|
|
@ -0,0 +1,5 @@
|
||||||
|
add_subdirectory(ActorEditor/)
|
||||||
|
add_subdirectory(CustomControls/)
|
||||||
|
add_subdirectory(General/)
|
||||||
|
add_subdirectory(Misc/)
|
||||||
|
add_subdirectory(ScenarioEditor/)
|
||||||
|
|
@ -0,0 +1,5 @@
|
||||||
|
target_sources(AtlasUI
|
||||||
|
PRIVATE
|
||||||
|
ToolButton.cpp
|
||||||
|
ToolButton.h
|
||||||
|
)
|
||||||
12
source/tools/atlas/AtlasUI/CustomControls/CMakeLists.txt
Normal file
12
source/tools/atlas/AtlasUI/CustomControls/CMakeLists.txt
Normal file
|
|
@ -0,0 +1,12 @@
|
||||||
|
add_subdirectory(Buttons/)
|
||||||
|
add_subdirectory(Canvas/)
|
||||||
|
add_subdirectory(ColorDialog/)
|
||||||
|
add_subdirectory(DraggableListCtrl/)
|
||||||
|
add_subdirectory(EditableListCtrl/)
|
||||||
|
add_subdirectory(FileHistory/)
|
||||||
|
add_subdirectory(HighResTimer/)
|
||||||
|
add_subdirectory(MapDialog/)
|
||||||
|
add_subdirectory(MapResizeDialog/)
|
||||||
|
add_subdirectory(SnapSplitterWindow/)
|
||||||
|
add_subdirectory(VirtualDirTreeCtrl/)
|
||||||
|
add_subdirectory(Windows/)
|
||||||
|
|
@ -0,0 +1,5 @@
|
||||||
|
target_sources(AtlasUI
|
||||||
|
PRIVATE
|
||||||
|
Canvas.cpp
|
||||||
|
Canvas.h
|
||||||
|
)
|
||||||
|
|
@ -0,0 +1,5 @@
|
||||||
|
target_sources(AtlasUI
|
||||||
|
PRIVATE
|
||||||
|
ColorDialog.cpp
|
||||||
|
ColorDialog.h
|
||||||
|
)
|
||||||
|
|
@ -0,0 +1,7 @@
|
||||||
|
target_sources(AtlasUI
|
||||||
|
PRIVATE
|
||||||
|
DraggableListCtrl.cpp
|
||||||
|
DraggableListCtrl.h
|
||||||
|
DraggableListCtrlCommands.cpp
|
||||||
|
DraggableListCtrlCommands.h
|
||||||
|
)
|
||||||
|
|
@ -0,0 +1,17 @@
|
||||||
|
target_sources(AtlasUI
|
||||||
|
PRIVATE
|
||||||
|
EditableListCtrl.cpp
|
||||||
|
EditableListCtrl.h
|
||||||
|
EditableListCtrlCommands.cpp
|
||||||
|
EditableListCtrlCommands.h
|
||||||
|
FieldEditCtrl.cpp
|
||||||
|
FieldEditCtrl.h
|
||||||
|
ListCtrlValidator.cpp
|
||||||
|
ListCtrlValidator.h
|
||||||
|
QuickComboBox.cpp
|
||||||
|
QuickComboBox.h
|
||||||
|
QuickFileCtrl.cpp
|
||||||
|
QuickFileCtrl.h
|
||||||
|
QuickTextCtrl.cpp
|
||||||
|
QuickTextCtrl.h
|
||||||
|
)
|
||||||
|
|
@ -0,0 +1,5 @@
|
||||||
|
target_sources(AtlasUI
|
||||||
|
PRIVATE
|
||||||
|
FileHistory.cpp
|
||||||
|
FileHistory.h
|
||||||
|
)
|
||||||
|
|
@ -0,0 +1,5 @@
|
||||||
|
target_sources(AtlasUI
|
||||||
|
PRIVATE
|
||||||
|
HighResTimer.cpp
|
||||||
|
HighResTimer.h
|
||||||
|
)
|
||||||
|
|
@ -0,0 +1,5 @@
|
||||||
|
target_sources(AtlasUI
|
||||||
|
PRIVATE
|
||||||
|
MapDialog.cpp
|
||||||
|
MapDialog.h
|
||||||
|
)
|
||||||
|
|
@ -0,0 +1,7 @@
|
||||||
|
target_sources(AtlasUI
|
||||||
|
PRIVATE
|
||||||
|
MapResizeDialog.cpp
|
||||||
|
MapResizeDialog.h
|
||||||
|
PseudoMiniMapPanel.cpp
|
||||||
|
PseudoMiniMapPanel.h
|
||||||
|
)
|
||||||
|
|
@ -0,0 +1,5 @@
|
||||||
|
target_sources(AtlasUI
|
||||||
|
PRIVATE
|
||||||
|
SnapSplitterWindow.cpp
|
||||||
|
SnapSplitterWindow.h
|
||||||
|
)
|
||||||
|
|
@ -0,0 +1,5 @@
|
||||||
|
target_sources(AtlasUI
|
||||||
|
PRIVATE
|
||||||
|
virtualdirtreectrl.cpp
|
||||||
|
virtualdirtreectrl.h
|
||||||
|
)
|
||||||
|
|
@ -0,0 +1,7 @@
|
||||||
|
target_sources(AtlasUI
|
||||||
|
PRIVATE
|
||||||
|
AtlasDialog.cpp
|
||||||
|
AtlasDialog.h
|
||||||
|
AtlasWindow.cpp
|
||||||
|
AtlasWindow.h
|
||||||
|
)
|
||||||
16
source/tools/atlas/AtlasUI/General/CMakeLists.txt
Normal file
16
source/tools/atlas/AtlasUI/General/CMakeLists.txt
Normal file
|
|
@ -0,0 +1,16 @@
|
||||||
|
target_sources(AtlasUI
|
||||||
|
PRIVATE
|
||||||
|
AtlasClipboard.cpp
|
||||||
|
AtlasClipboard.h
|
||||||
|
AtlasEventLoop.cpp
|
||||||
|
AtlasEventLoop.h
|
||||||
|
AtlasWindowCommand.cpp
|
||||||
|
AtlasWindowCommand.h
|
||||||
|
AtlasWindowCommandProc.cpp
|
||||||
|
AtlasWindowCommandProc.h
|
||||||
|
Datafile.cpp
|
||||||
|
Datafile.h
|
||||||
|
IAtlasSerialiser.h
|
||||||
|
Observable.cpp
|
||||||
|
Observable.h
|
||||||
|
)
|
||||||
13
source/tools/atlas/AtlasUI/Misc/CMakeLists.txt
Normal file
13
source/tools/atlas/AtlasUI/Misc/CMakeLists.txt
Normal file
|
|
@ -0,0 +1,13 @@
|
||||||
|
target_sources(AtlasUI
|
||||||
|
PRIVATE
|
||||||
|
DLLInterface.cpp
|
||||||
|
DLLInterface.h
|
||||||
|
KeyMap.cpp
|
||||||
|
KeyMap.h
|
||||||
|
actored.h
|
||||||
|
precompiled.cpp
|
||||||
|
precompiled.h
|
||||||
|
$<$<PLATFORM_ID:Windows>: atlas.rc> # Caution, the blank before the File is needed
|
||||||
|
)
|
||||||
|
|
||||||
|
add_subdirectory(Graphics/)
|
||||||
12
source/tools/atlas/AtlasUI/Misc/Graphics/CMakeLists.txt
Normal file
12
source/tools/atlas/AtlasUI/Misc/Graphics/CMakeLists.txt
Normal file
|
|
@ -0,0 +1,12 @@
|
||||||
|
if(CMAKE_SYSTEM_NAME MATCHES "Linux")
|
||||||
|
include(GNUInstallDirs)
|
||||||
|
install(
|
||||||
|
FILES
|
||||||
|
${CMAKE_CURRENT_SOURCE_DIR}/ActorEditor.ico
|
||||||
|
${CMAKE_CURRENT_SOURCE_DIR}/ArchiveViewer.ico
|
||||||
|
${CMAKE_CURRENT_SOURCE_DIR}/FileConverter.ico
|
||||||
|
${CMAKE_CURRENT_SOURCE_DIR}/ScenarioEditor.ico
|
||||||
|
DESTINATION
|
||||||
|
${CMAKE_INSTALL_DATADIR}/0ad/tools/ActorEditor/icons
|
||||||
|
)
|
||||||
|
endif()
|
||||||
10
source/tools/atlas/AtlasUI/ScenarioEditor/CMakeLists.txt
Normal file
10
source/tools/atlas/AtlasUI/ScenarioEditor/CMakeLists.txt
Normal file
|
|
@ -0,0 +1,10 @@
|
||||||
|
target_sources(AtlasUI
|
||||||
|
PRIVATE
|
||||||
|
ScenarioEditor.cpp
|
||||||
|
ScenarioEditor.h
|
||||||
|
SectionLayout.cpp
|
||||||
|
SectionLayout.h
|
||||||
|
)
|
||||||
|
|
||||||
|
add_subdirectory(Sections/)
|
||||||
|
add_subdirectory(Tools/)
|
||||||
|
|
@ -0,0 +1,7 @@
|
||||||
|
add_subdirectory(Cinema/)
|
||||||
|
add_subdirectory(Common/)
|
||||||
|
add_subdirectory(Environment/)
|
||||||
|
add_subdirectory(Map/)
|
||||||
|
add_subdirectory(Object/)
|
||||||
|
add_subdirectory(Player/)
|
||||||
|
add_subdirectory(Terrain/)
|
||||||
|
|
@ -0,0 +1,5 @@
|
||||||
|
target_sources(AtlasUI
|
||||||
|
PRIVATE
|
||||||
|
Cinema.cpp
|
||||||
|
Cinema.h
|
||||||
|
)
|
||||||
|
|
@ -0,0 +1,5 @@
|
||||||
|
target_sources(AtlasUI
|
||||||
|
PRIVATE
|
||||||
|
Sidebar.cpp
|
||||||
|
Sidebar.h
|
||||||
|
)
|
||||||
|
|
@ -0,0 +1,7 @@
|
||||||
|
target_sources(AtlasUI
|
||||||
|
PRIVATE
|
||||||
|
Environment.cpp
|
||||||
|
Environment.h
|
||||||
|
LightControl.cpp
|
||||||
|
LightControl.h
|
||||||
|
)
|
||||||
|
|
@ -0,0 +1,5 @@
|
||||||
|
target_sources(AtlasUI
|
||||||
|
PRIVATE
|
||||||
|
Map.cpp
|
||||||
|
Map.h
|
||||||
|
)
|
||||||
|
|
@ -0,0 +1,7 @@
|
||||||
|
target_sources(AtlasUI
|
||||||
|
PRIVATE
|
||||||
|
Object.cpp
|
||||||
|
Object.h
|
||||||
|
VariationControl.cpp
|
||||||
|
VariationControl.h
|
||||||
|
)
|
||||||
|
|
@ -0,0 +1,5 @@
|
||||||
|
target_sources(AtlasUI
|
||||||
|
PRIVATE
|
||||||
|
Player.cpp
|
||||||
|
Player.h
|
||||||
|
)
|
||||||
|
|
@ -0,0 +1,5 @@
|
||||||
|
target_sources(AtlasUI
|
||||||
|
PRIVATE
|
||||||
|
Terrain.cpp
|
||||||
|
Terrain.h
|
||||||
|
)
|
||||||
|
|
@ -0,0 +1,17 @@
|
||||||
|
target_sources(AtlasUI
|
||||||
|
PRIVATE
|
||||||
|
ActorViewerTool.cpp
|
||||||
|
AlterElevation.cpp
|
||||||
|
FillTerrain.cpp
|
||||||
|
FlattenElevation.cpp
|
||||||
|
PaintTerrain.cpp
|
||||||
|
PickWaterHeight.cpp
|
||||||
|
PikeElevation.cpp
|
||||||
|
PlaceObject.cpp
|
||||||
|
ReplaceTerrain.cpp
|
||||||
|
SmoothElevation.cpp
|
||||||
|
TransformObject.cpp
|
||||||
|
TransformPath.cpp
|
||||||
|
)
|
||||||
|
|
||||||
|
add_subdirectory(Common/)
|
||||||
|
|
@ -0,0 +1,11 @@
|
||||||
|
target_sources(AtlasUI
|
||||||
|
PRIVATE
|
||||||
|
Brushes.cpp
|
||||||
|
Brushes.h
|
||||||
|
MiscState.cpp
|
||||||
|
MiscState.h
|
||||||
|
ObjectSettings.cpp
|
||||||
|
ObjectSettings.h
|
||||||
|
Tools.cpp
|
||||||
|
Tools.h
|
||||||
|
)
|
||||||
162
source/tools/atlas/CMakeLists.txt
Normal file
162
source/tools/atlas/CMakeLists.txt
Normal file
|
|
@ -0,0 +1,162 @@
|
||||||
|
cmake_minimum_required(VERSION 3.25.1...4.0.0)
|
||||||
|
|
||||||
|
project(AtlasMisc LANGUAGES CXX)
|
||||||
|
|
||||||
|
include(0ad-Functions)
|
||||||
|
|
||||||
|
# +++++++++++++++++++++ Project Macros ++++++++++++++++++++
|
||||||
|
macro(set_atlas_build_flags _target)
|
||||||
|
target_link_options(${_target}
|
||||||
|
PRIVATE
|
||||||
|
$<$<PLATFORM_ID:Linux,FreeBSD>:-fPIC>
|
||||||
|
$<$<PLATFORM_ID:Linux>:-rdynamic>
|
||||||
|
)
|
||||||
|
target_compile_options(${_target}
|
||||||
|
PRIVATE
|
||||||
|
$<$<PLATFORM_ID:Linux,FreeBSD>:-fPIC>
|
||||||
|
$<$<PLATFORM_ID:Linux,Darwin>:-Wno-unused-local-typedefs>
|
||||||
|
)
|
||||||
|
target_link_libraries(${_target}
|
||||||
|
PRIVATE
|
||||||
|
$<$<PLATFORM_ID:Windows>:winmm delayimp>
|
||||||
|
)
|
||||||
|
endmacro()
|
||||||
|
|
||||||
|
# +++++++++++++++++++++ Required Packages ++++++++++++++++++
|
||||||
|
find_package(wxWidgets 3.0.4 REQUIRED COMPONENTS gl xml)
|
||||||
|
find_package(Iconv 1.0 REQUIRED)
|
||||||
|
find_package(ZLIB 1.2 REQUIRED)
|
||||||
|
find_package(LibXml2 2.9 REQUIRED)
|
||||||
|
find_package(CxxTest 4.4 REQUIRED)
|
||||||
|
if(UNIX)
|
||||||
|
find_package(Boost 1.69.0 REQUIRED CONFIG)
|
||||||
|
find_package(SDL2 2.0.2 REQUIRED)
|
||||||
|
elseif(CMAKE_SYSTEM_NAME STREQUAL "Windows")
|
||||||
|
include(FindPrebuildLibrary)
|
||||||
|
find_prebuild_library(Sdl2)
|
||||||
|
find_prebuild_library(Boost INC_PATH ${0AD_EXT_LIBDIR}/boost/include/)
|
||||||
|
endif()
|
||||||
|
|
||||||
|
# +++++++++++++++++++++ Project Targets ++++++++++++++++++++
|
||||||
|
add_library(AtlasObject STATIC)
|
||||||
|
add_library(AtlasUI SHARED)
|
||||||
|
add_executable(ActorEditor)
|
||||||
|
|
||||||
|
# Set Macos Bundle and Windows Window Application
|
||||||
|
set_target_properties(ActorEditor
|
||||||
|
PROPERTIES
|
||||||
|
WIN32_EXECUTABLE $<$<PLATFORM_ID:Windows>:TRUE>
|
||||||
|
MACOSX_BUNDLE $<$<PLATFORM_ID:Darwin>:TRUE>
|
||||||
|
)
|
||||||
|
|
||||||
|
add_subdirectory(AtlasFrontends/)
|
||||||
|
add_subdirectory(AtlasObject/)
|
||||||
|
add_subdirectory(AtlasUI/)
|
||||||
|
|
||||||
|
# +++++++++++++++++++++ Set Output Paths +++++++++++++++++++
|
||||||
|
set_target_properties(AtlasObject
|
||||||
|
PROPERTIES
|
||||||
|
ARCHIVE_OUTPUT_DIRECTORY ${CMAKE_SOURCE_DIR}/binaries/system
|
||||||
|
)
|
||||||
|
set_target_properties(AtlasUI
|
||||||
|
PROPERTIES
|
||||||
|
LIBRARY_OUTPUT_DIRECTORY ${CMAKE_SOURCE_DIR}/binaries/system
|
||||||
|
)
|
||||||
|
set_target_properties(ActorEditor
|
||||||
|
PROPERTIES
|
||||||
|
RUNTIME_OUTPUT_DIRECTORY ${CMAKE_SOURCE_DIR}/binaries/system
|
||||||
|
)
|
||||||
|
|
||||||
|
# +++++++++++++++++++++ AtlasObject ++++++++++++++++++++++++
|
||||||
|
set_atlas_build_flags(AtlasObject)
|
||||||
|
target_include_directories(AtlasObject PRIVATE ${CMAKE_SOURCE_DIR}/source)
|
||||||
|
target_link_libraries(AtlasObject
|
||||||
|
PRIVATE
|
||||||
|
${BUILD_FLAGS_TARGET}
|
||||||
|
$<$<PLATFORM_ID:Linux>:Boost::headers>
|
||||||
|
$<$<PLATFORM_ID:Windows>:BOOST::headers>
|
||||||
|
Iconv::Iconv
|
||||||
|
LibXml2::LibXml2
|
||||||
|
SDL2::SDL2
|
||||||
|
)
|
||||||
|
|
||||||
|
# +++++++++++++++++++++ AtlasUI ++++++++++++++++++++++++++++
|
||||||
|
if(NOT without-pch)
|
||||||
|
add_pch(TARGET AtlasUI PCH_DIR ${PROJECT_SOURCE_DIR}/AtlasUI/Misc)
|
||||||
|
else()
|
||||||
|
target_compile_definitions(AtlasUI PRIVATE CONFIG_ENABLE_PCH=0)
|
||||||
|
set_target_properties(AtlasUI PROPERTIES
|
||||||
|
DISABLE_PRECOMPILE_HEADERS TRUE
|
||||||
|
)
|
||||||
|
target_include_directories(AtlasUI
|
||||||
|
BEFORE PRIVATE
|
||||||
|
${PROJECT_SOURCE_DIR}/AtlasUI/Misc
|
||||||
|
)
|
||||||
|
endif()
|
||||||
|
|
||||||
|
set_atlas_build_flags(AtlasUI)
|
||||||
|
|
||||||
|
target_include_directories(AtlasUI PRIVATE ${CMAKE_SOURCE_DIR}/source/)
|
||||||
|
target_link_libraries(AtlasUI
|
||||||
|
PRIVATE
|
||||||
|
${BUILD_FLAGS_TARGET}
|
||||||
|
LibXml2::LibXml2
|
||||||
|
Iconv::Iconv
|
||||||
|
$<$<PLATFORM_ID:Linux>:Boost::headers>
|
||||||
|
$<$<PLATFORM_ID:Windows>:BOOST::headers>
|
||||||
|
SDL2::SDL2
|
||||||
|
ZLIB::ZLIB
|
||||||
|
AtlasObject
|
||||||
|
wxWidgets::wxWidgets
|
||||||
|
)
|
||||||
|
target_compile_definitions(AtlasUI
|
||||||
|
PRIVATE
|
||||||
|
$<$<VERSION_GREATER_EQUAL:${wxWidgets_VERSION},3.3.0>:wxNO_REQUIRE_LITERAL_MSGIDS>
|
||||||
|
)
|
||||||
|
|
||||||
|
# +++++++++++++++++++++ ActorEditor ++++++++++++++++++++++++
|
||||||
|
target_include_directories(ActorEditor
|
||||||
|
PRIVATE
|
||||||
|
${PROJECT_SOURCE_DIR}/
|
||||||
|
)
|
||||||
|
target_link_libraries(ActorEditor
|
||||||
|
PRIVATE
|
||||||
|
${BUILD_FLAGS_TARGET}
|
||||||
|
$<$<NOT:$<PLATFORM_ID:Windows>>:AtlasObject>
|
||||||
|
AtlasUI
|
||||||
|
)
|
||||||
|
target_link_options(ActorEditor
|
||||||
|
PRIVATE
|
||||||
|
$<$<AND:$<PLATFORM_ID:Windows>,$<STREQUAL:${ARCH},amd64>>:/manifestdependency:type='win32' name='Microsoft.Windows.Common-Controls' version='6.0.0.0' processorArchitecture='amd64' publicKeyToken='6595b64144ccf1df'>
|
||||||
|
$<$<AND:$<PLATFORM_ID:Windows>,$<STREQUAL:${ARCH},x86>>:/manifestdependency:type='win32' name='Microsoft.Windows.Common-Controls' version='6.0.0.0' processorArchitecture='X86' publicKeyToken='6595b64144ccf1df'>
|
||||||
|
$<$<PLATFORM_ID:Darwin>:-arch ${MACOS_ARCH}>
|
||||||
|
)
|
||||||
|
target_compile_options(ActorEditor
|
||||||
|
PRIVATE
|
||||||
|
$<$<PLATFORM_ID:Darwin>:-arch ${MACOS_ARCH}>
|
||||||
|
)
|
||||||
|
|
||||||
|
if(CMAKE_SYSTEM_NAME STREQUAL "Darwin")
|
||||||
|
set_target_properties(ActorEditor PROPERTIES
|
||||||
|
XCODE_ATTRIBUTE_ARCHS ${MACOS_ARCH}
|
||||||
|
XCODE_ATTRIBUTE_MACOSX_DEPLOYMENT_TARGET $<$<BOOL:${macosx-version-min}>:${macosx-version-min}>
|
||||||
|
)
|
||||||
|
endif()
|
||||||
|
|
||||||
|
# get_target_property(win32 ActorEditor WIN32_EXECUTABLE)
|
||||||
|
# get_target_property(macos ActorEditor MACOSX_BUNDLE)
|
||||||
|
# file(GENERATE OUTPUT debugexpr.txt CONTENT "${win32} ${macos}" TARGET ActorEditor)
|
||||||
|
# include(CMakePrintHelpers)
|
||||||
|
# cmake_print_properties(TARGETS AtlasUI
|
||||||
|
# PROPERTIES
|
||||||
|
# # INCLUDE_DIRECTORIES
|
||||||
|
# # LINK_LIBRARIES
|
||||||
|
# # COMPILE_OPTIONS
|
||||||
|
# # COMPILE_DEFINITIONS
|
||||||
|
# # WIN32_EXECUTABLE
|
||||||
|
# # MACOSX_BUNDLE
|
||||||
|
# # IMPORTED_LOCATION
|
||||||
|
# # INTERFACE_INCLUDE_DIRECTORIES
|
||||||
|
# # CXX_EXTENSIONS
|
||||||
|
# # CXX_STANDARD_REQUIRED
|
||||||
|
# )
|
||||||
Loading…
Reference in a new issue