From d655ab81fe0af32021ac251e7ed909c852e00433 Mon Sep 17 00:00:00 2001 From: Diomendius <42310725+Diomendius@users.noreply.github.com> Date: Mon, 8 Jul 2024 16:45:17 +1200 Subject: [PATCH] Add Tools CMake build target All the individual executables are marked EXCLUDE_FROM_ALL, but the added Tools custom target is marked ALL. The only visible effect of this is that ConvertColorCursors does not get built by default, since all the other tools are dependencies for the Resources or Tools targets, which are both built by default. Otherwise, the benefit is simply to keep the dependency tree clean. Only three targets are built by default: Aerofoil, its resources and the conversion tools. Everything else is built to satisfy dependencies. --- CMakeLists.txt | 40 +++++++++++++++++++++++++++------------- 1 file changed, 27 insertions(+), 13 deletions(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index 18839da..77837b8 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -316,7 +316,7 @@ if(CMAKE_HOST_UNIX) endif() -add_executable(flattenmov flattenmov/flattenmov.cpp AerofoilPortable/GpAllocator_C.cpp) +add_executable(flattenmov EXCLUDE_FROM_ALL flattenmov/flattenmov.cpp AerofoilPortable/GpAllocator_C.cpp) target_include_directories(flattenmov PRIVATE Common GpCommon @@ -325,7 +325,7 @@ target_include_directories(flattenmov PRIVATE ) target_link_libraries(flattenmov PortabilityLayer) -add_executable(bin2gp bin2gp/bin2gp.cpp AerofoilPortable/GpAllocator_C.cpp) +add_executable(bin2gp EXCLUDE_FROM_ALL bin2gp/bin2gp.cpp AerofoilPortable/GpAllocator_C.cpp) target_include_directories(bin2gp PRIVATE Common GpCommon @@ -334,7 +334,7 @@ target_include_directories(bin2gp PRIVATE ) target_link_libraries(bin2gp PortabilityLayer) -add_executable(hqx2bin hqx2bin/hqx2bin.cpp AerofoilPortable/GpAllocator_C.cpp) +add_executable(hqx2bin EXCLUDE_FROM_ALL hqx2bin/hqx2bin.cpp AerofoilPortable/GpAllocator_C.cpp) target_include_directories(hqx2bin PRIVATE Common GpCommon @@ -343,7 +343,7 @@ target_include_directories(hqx2bin PRIVATE ) target_link_libraries(hqx2bin PortabilityLayer) -add_executable(hqx2gp hqx2gp/hqx2gp.cpp AerofoilPortable/GpAllocator_C.cpp) +add_executable(hqx2gp EXCLUDE_FROM_ALL hqx2gp/hqx2gp.cpp AerofoilPortable/GpAllocator_C.cpp) target_include_directories(hqx2gp PRIVATE Common GpCommon @@ -353,7 +353,7 @@ target_include_directories(hqx2gp PRIVATE ) target_link_libraries(hqx2gp PortabilityLayer) -add_executable(gpr2gpa +add_executable(gpr2gpa EXCLUDE_FROM_ALL gpr2gpa/gpr2gpa.cpp gpr2gpa/macedec.cpp AerofoilPortable/GpAllocator_C.cpp @@ -371,11 +371,11 @@ target_include_directories(gpr2gpa PRIVATE ) target_link_libraries(gpr2gpa PortabilityLayer MacRomanConversion zlib) -add_executable(MakeTimestamp MakeTimestamp/MakeTimestamp.cpp) +add_executable(MakeTimestamp EXCLUDE_FROM_ALL MakeTimestamp/MakeTimestamp.cpp) target_include_directories(MakeTimestamp PRIVATE PortabilityLayer UnixCompat) target_link_libraries(MakeTimestamp PortabilityLayer) -add_executable(FTagData FTagData/FTagData.cpp) +add_executable(FTagData EXCLUDE_FROM_ALL FTagData/FTagData.cpp) target_include_directories(FTagData PRIVATE Common GpCommon @@ -385,7 +385,7 @@ target_include_directories(FTagData PRIVATE ) target_link_libraries(FTagData PortabilityLayer) -add_executable(MergeGPF MergeGPF/MergeGPF.cpp AerofoilPortable/GpAllocator_C.cpp) +add_executable(MergeGPF EXCLUDE_FROM_ALL MergeGPF/MergeGPF.cpp AerofoilPortable/GpAllocator_C.cpp) target_include_directories(MergeGPF PRIVATE Common GpCommon @@ -395,7 +395,7 @@ target_include_directories(MergeGPF PRIVATE ) target_link_libraries(MergeGPF PortabilityLayer) -add_executable(MiniRez MiniRez/MiniRez.cpp) +add_executable(MiniRez EXCLUDE_FROM_ALL MiniRez/MiniRez.cpp) target_include_directories(MiniRez PRIVATE Common GpCommon @@ -404,7 +404,7 @@ target_include_directories(MiniRez PRIVATE ) target_link_libraries(MiniRez PortabilityLayer) -add_executable(HouseTool HouseTool/HouseTool.cpp) +add_executable(HouseTool EXCLUDE_FROM_ALL HouseTool/HouseTool.cpp) target_include_directories(HouseTool PRIVATE Common GpCommon @@ -414,7 +414,7 @@ target_include_directories(HouseTool PRIVATE ) target_link_libraries(HouseTool PortabilityLayer MacRomanConversion) -add_executable(unpacktool +add_executable(unpacktool EXCLUDE_FROM_ALL unpacktool/ArchiveDescription.cpp unpacktool/BWT.cpp unpacktool/CompactProLZHDecompressor.cpp @@ -464,7 +464,7 @@ if(FREETYPE_FOUND) target_link_libraries(GpFontHandler_FreeType2 PRIVATE Freetype::Freetype) - add_executable(GenerateFonts GenerateFonts/GenerateFonts.cpp AerofoilPortable/GpAllocator_C.cpp) + add_executable(GenerateFonts EXCLUDE_FROM_ALL GenerateFonts/GenerateFonts.cpp AerofoilPortable/GpAllocator_C.cpp) target_include_directories(GenerateFonts PRIVATE Common GpCommon @@ -475,7 +475,7 @@ if(FREETYPE_FOUND) target_link_libraries(GenerateFonts PortabilityLayer GpFontHandler_FreeType2) endif() -add_executable(ConvertColorCursors +add_executable(ConvertColorCursors EXCLUDE_FROM_ALL ConvertColorCursors/ConvertColorCursors.cpp AerofoilPortable/GpAllocator_C.cpp stb/stb_image_write.c @@ -706,6 +706,19 @@ add_custom_target(Resources ALL ${HOUSE_FILES} ) +set(TOOL_EXES + flattenmov + bin2gp + hqx2bin + hqx2gp + MakeTimestamp + FTagData + gpr2gpa + unpacktool + MergeGPF + ) +add_custom_target(Tools ALL DEPENDS ${TOOL_EXES}) + list(TRANSFORM DATA_FILES PREPEND "${CMAKE_CURRENT_BINARY_DIR}/") list(TRANSFORM HOUSE_FILES PREPEND "${CMAKE_CURRENT_BINARY_DIR}/") @@ -713,3 +726,4 @@ list(TRANSFORM HOUSE_FILES PREPEND "${CMAKE_CURRENT_BINARY_DIR}/") install(TARGETS "${EXECNAME}" COMPONENT Executable) install(FILES ${DATA_FILES} DESTINATION lib/aerofoil/Packaged COMPONENT Resources) install(FILES ${HOUSE_FILES} DESTINATION lib/aerofoil/Packaged/Houses COMPONENT Resources) +install(TARGETS ${TOOL_EXES} DESTINATION lib/aerofoil/tools COMPONENT Tools)