From 4ca495d8284d923b9972ccc6630a2cbd113d0a5d Mon Sep 17 00:00:00 2001 From: rdb Date: Mon, 12 Aug 2024 16:39:20 +0200 Subject: [PATCH] CMake: Add separate BUILD_TOOLS option to build binaries This is separate from BUILD_PANDATOOL, which builds the pandatool tree --- CMakeLists.txt | 1 + direct/src/dcparse/CMakeLists.txt | 4 ++++ panda/src/downloadertools/CMakeLists.txt | 4 +--- panda/src/testbed/CMakeLists.txt | 4 +--- pandatool/src/bam/CMakeLists.txt | 4 ++++ pandatool/src/daeprogs/CMakeLists.txt | 4 ++++ pandatool/src/dxfprogs/CMakeLists.txt | 4 ++++ pandatool/src/egg-mkfont/CMakeLists.txt | 4 ++++ pandatool/src/egg-optchar/CMakeLists.txt | 4 ++++ pandatool/src/egg-palettize/CMakeLists.txt | 4 ++++ pandatool/src/egg-qtess/CMakeLists.txt | 4 ++++ pandatool/src/eggprogs/CMakeLists.txt | 4 ++++ pandatool/src/fltprogs/CMakeLists.txt | 4 ++++ pandatool/src/gtk-stats/CMakeLists.txt | 4 ++++ pandatool/src/imageprogs/CMakeLists.txt | 4 ++++ pandatool/src/lwoprogs/CMakeLists.txt | 4 ++++ pandatool/src/mac-stats/CMakeLists.txt | 4 ++++ pandatool/src/miscprogs/CMakeLists.txt | 4 ++++ pandatool/src/objprogs/CMakeLists.txt | 4 ++++ pandatool/src/pfmprogs/CMakeLists.txt | 4 ++++ pandatool/src/pstatserver/CMakeLists.txt | 4 ++++ pandatool/src/text-stats/CMakeLists.txt | 4 ++++ pandatool/src/vrmlprogs/CMakeLists.txt | 4 ++++ pandatool/src/win-stats/CMakeLists.txt | 4 ++++ pandatool/src/xfileprogs/CMakeLists.txt | 4 ++++ 25 files changed, 91 insertions(+), 6 deletions(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index 1d1ced66a4..fba23f92d6 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -109,6 +109,7 @@ option(BUILD_DIRECT "Build the direct source tree." ON) option(BUILD_PANDATOOL "Build the pandatool source tree." ON) option(BUILD_CONTRIB "Build the contrib source tree." ON) option(BUILD_MODELS "Build/install the built-in models." ON) +option(BUILD_TOOLS "Build binary tools." ON) # Include Panda3D packages if(BUILD_DTOOL) diff --git a/direct/src/dcparse/CMakeLists.txt b/direct/src/dcparse/CMakeLists.txt index e5cdee5b18..b48d772c17 100644 --- a/direct/src/dcparse/CMakeLists.txt +++ b/direct/src/dcparse/CMakeLists.txt @@ -1,3 +1,7 @@ +if(NOT BUILD_TOOLS) + return() +endif() + add_executable(p3dcparse dcparse.cxx) target_link_libraries(p3dcparse p3direct) install(TARGETS p3dcparse EXPORT Direct COMPONENT Direct DESTINATION ${CMAKE_INSTALL_BINDIR}) diff --git a/panda/src/downloadertools/CMakeLists.txt b/panda/src/downloadertools/CMakeLists.txt index 47abcb727f..cfe6e97900 100644 --- a/panda/src/downloadertools/CMakeLists.txt +++ b/panda/src/downloadertools/CMakeLists.txt @@ -1,6 +1,4 @@ -if(NOT BUILD_PANDATOOL) - # It's safe to say, if the user doesn't want pandatool, they don't want these - # tools either. +if(NOT BUILD_TOOLS) return() endif() diff --git a/panda/src/testbed/CMakeLists.txt b/panda/src/testbed/CMakeLists.txt index 3c497f42ac..12bd488136 100644 --- a/panda/src/testbed/CMakeLists.txt +++ b/panda/src/testbed/CMakeLists.txt @@ -1,6 +1,4 @@ -if(NOT BUILD_PANDATOOL) - # It's safe to say, if the user doesn't want pandatool, they don't want pview - # either. +if(NOT BUILD_TOOLS) return() endif() diff --git a/pandatool/src/bam/CMakeLists.txt b/pandatool/src/bam/CMakeLists.txt index 79389b92ff..32f5a6f55b 100644 --- a/pandatool/src/bam/CMakeLists.txt +++ b/pandatool/src/bam/CMakeLists.txt @@ -1,3 +1,7 @@ +if(NOT BUILD_TOOLS) + return() +endif() + add_executable(bam-info bamInfo.cxx bamInfo.h) target_link_libraries(bam-info p3progbase panda) install(TARGETS bam-info EXPORT Tools COMPONENT Tools DESTINATION ${CMAKE_INSTALL_BINDIR}) diff --git a/pandatool/src/daeprogs/CMakeLists.txt b/pandatool/src/daeprogs/CMakeLists.txt index 75db4c4b16..42cd2f48fe 100644 --- a/pandatool/src/daeprogs/CMakeLists.txt +++ b/pandatool/src/daeprogs/CMakeLists.txt @@ -1,3 +1,7 @@ +if(NOT BUILD_TOOLS) + return() +endif() + if(HAVE_EGG AND HAVE_FCOLLADA) add_executable(dae2egg daeToEgg.cxx daeToEgg.h) diff --git a/pandatool/src/dxfprogs/CMakeLists.txt b/pandatool/src/dxfprogs/CMakeLists.txt index 3cd39a0baa..0a2033d15c 100644 --- a/pandatool/src/dxfprogs/CMakeLists.txt +++ b/pandatool/src/dxfprogs/CMakeLists.txt @@ -1,3 +1,7 @@ +if(NOT BUILD_TOOLS) + return() +endif() + add_executable(dxf-points dxfPoints.cxx dxfPoints.h) target_link_libraries(dxf-points p3progbase p3dxf) install(TARGETS dxf-points EXPORT Tools COMPONENT Tools DESTINATION ${CMAKE_INSTALL_BINDIR}) diff --git a/pandatool/src/egg-mkfont/CMakeLists.txt b/pandatool/src/egg-mkfont/CMakeLists.txt index 8b548e2e91..60f0331e0d 100644 --- a/pandatool/src/egg-mkfont/CMakeLists.txt +++ b/pandatool/src/egg-mkfont/CMakeLists.txt @@ -1,3 +1,7 @@ +if(NOT BUILD_TOOLS) + return() +endif() + if(NOT HAVE_EGG OR NOT HAVE_FREETYPE) return() endif() diff --git a/pandatool/src/egg-optchar/CMakeLists.txt b/pandatool/src/egg-optchar/CMakeLists.txt index b30a070224..379fc30178 100644 --- a/pandatool/src/egg-optchar/CMakeLists.txt +++ b/pandatool/src/egg-optchar/CMakeLists.txt @@ -1,3 +1,7 @@ +if(NOT BUILD_TOOLS) + return() +endif() + if(NOT HAVE_EGG) return() endif() diff --git a/pandatool/src/egg-palettize/CMakeLists.txt b/pandatool/src/egg-palettize/CMakeLists.txt index 18576f25d6..9af1445726 100644 --- a/pandatool/src/egg-palettize/CMakeLists.txt +++ b/pandatool/src/egg-palettize/CMakeLists.txt @@ -1,3 +1,7 @@ +if(NOT BUILD_TOOLS) + return() +endif() + if(NOT HAVE_EGG) return() endif() diff --git a/pandatool/src/egg-qtess/CMakeLists.txt b/pandatool/src/egg-qtess/CMakeLists.txt index c8f4244c8a..83e6ff1ff6 100644 --- a/pandatool/src/egg-qtess/CMakeLists.txt +++ b/pandatool/src/egg-qtess/CMakeLists.txt @@ -1,3 +1,7 @@ +if(NOT BUILD_TOOLS) + return() +endif() + if(NOT HAVE_EGG) return() endif() diff --git a/pandatool/src/eggprogs/CMakeLists.txt b/pandatool/src/eggprogs/CMakeLists.txt index a14d33ab80..e845c57d0b 100644 --- a/pandatool/src/eggprogs/CMakeLists.txt +++ b/pandatool/src/eggprogs/CMakeLists.txt @@ -1,3 +1,7 @@ +if(NOT BUILD_TOOLS) + return() +endif() + if(NOT HAVE_EGG) return() endif() diff --git a/pandatool/src/fltprogs/CMakeLists.txt b/pandatool/src/fltprogs/CMakeLists.txt index 29a04166b7..0ceebcf634 100644 --- a/pandatool/src/fltprogs/CMakeLists.txt +++ b/pandatool/src/fltprogs/CMakeLists.txt @@ -1,3 +1,7 @@ +if(NOT BUILD_TOOLS) + return() +endif() + add_executable(flt-info fltInfo.cxx fltInfo.h) target_link_libraries(flt-info p3progbase p3flt) install(TARGETS flt-info EXPORT Tools COMPONENT Tools DESTINATION ${CMAKE_INSTALL_BINDIR}) diff --git a/pandatool/src/gtk-stats/CMakeLists.txt b/pandatool/src/gtk-stats/CMakeLists.txt index 2305c59404..dca2f91422 100644 --- a/pandatool/src/gtk-stats/CMakeLists.txt +++ b/pandatool/src/gtk-stats/CMakeLists.txt @@ -1,3 +1,7 @@ +if(NOT BUILD_TOOLS) + return() +endif() + if(NOT HAVE_GTK3 OR NOT HAVE_NET) return() endif() diff --git a/pandatool/src/imageprogs/CMakeLists.txt b/pandatool/src/imageprogs/CMakeLists.txt index f39b4b90fb..e91d4c6965 100644 --- a/pandatool/src/imageprogs/CMakeLists.txt +++ b/pandatool/src/imageprogs/CMakeLists.txt @@ -1,3 +1,7 @@ +if(NOT BUILD_TOOLS) + return() +endif() + add_executable(image-fix-hidden-color imageFixHiddenColor.cxx imageFixHiddenColor.h) target_link_libraries(image-fix-hidden-color p3imagebase) install(TARGETS image-fix-hidden-color EXPORT Tools COMPONENT Tools DESTINATION ${CMAKE_INSTALL_BINDIR}) diff --git a/pandatool/src/lwoprogs/CMakeLists.txt b/pandatool/src/lwoprogs/CMakeLists.txt index 0a3c1de2e5..39210c50d0 100644 --- a/pandatool/src/lwoprogs/CMakeLists.txt +++ b/pandatool/src/lwoprogs/CMakeLists.txt @@ -1,3 +1,7 @@ +if(NOT BUILD_TOOLS) + return() +endif() + add_executable(lwo-scan lwoScan.cxx lwoScan.h) target_link_libraries(lwo-scan p3progbase p3lwo) install(TARGETS lwo-scan EXPORT Tools COMPONENT Tools DESTINATION ${CMAKE_INSTALL_BINDIR}) diff --git a/pandatool/src/mac-stats/CMakeLists.txt b/pandatool/src/mac-stats/CMakeLists.txt index bb56cd0771..23c54ef9bc 100644 --- a/pandatool/src/mac-stats/CMakeLists.txt +++ b/pandatool/src/mac-stats/CMakeLists.txt @@ -1,3 +1,7 @@ +if(NOT BUILD_TOOLS) + return() +endif() + if(NOT APPLE OR NOT HAVE_NET) return() endif() diff --git a/pandatool/src/miscprogs/CMakeLists.txt b/pandatool/src/miscprogs/CMakeLists.txt index 169cecc774..64ce488ed7 100644 --- a/pandatool/src/miscprogs/CMakeLists.txt +++ b/pandatool/src/miscprogs/CMakeLists.txt @@ -1,3 +1,7 @@ +if(NOT BUILD_TOOLS) + return() +endif() + add_executable(bin2c binToC.cxx binToC.h) target_link_libraries(bin2c p3progbase) install(TARGETS bin2c EXPORT Tools COMPONENT Tools DESTINATION ${CMAKE_INSTALL_BINDIR}) diff --git a/pandatool/src/objprogs/CMakeLists.txt b/pandatool/src/objprogs/CMakeLists.txt index adc398fab4..084f140e1a 100644 --- a/pandatool/src/objprogs/CMakeLists.txt +++ b/pandatool/src/objprogs/CMakeLists.txt @@ -1,3 +1,7 @@ +if(NOT BUILD_TOOLS) + return() +endif() + if(NOT HAVE_EGG) return() endif() diff --git a/pandatool/src/pfmprogs/CMakeLists.txt b/pandatool/src/pfmprogs/CMakeLists.txt index 13cb6af787..4176ad2cc1 100644 --- a/pandatool/src/pfmprogs/CMakeLists.txt +++ b/pandatool/src/pfmprogs/CMakeLists.txt @@ -1,3 +1,7 @@ +if(NOT BUILD_TOOLS) + return() +endif() + add_executable(pfm-bba config_pfmprogs.cxx config_pfmprogs.h pfmBba.cxx pfmBba.h) diff --git a/pandatool/src/pstatserver/CMakeLists.txt b/pandatool/src/pstatserver/CMakeLists.txt index 020b57785a..8587806ef8 100644 --- a/pandatool/src/pstatserver/CMakeLists.txt +++ b/pandatool/src/pstatserver/CMakeLists.txt @@ -1,3 +1,7 @@ +if(NOT BUILD_TOOLS) + return() +endif() + if(NOT HAVE_NET) return() endif() diff --git a/pandatool/src/text-stats/CMakeLists.txt b/pandatool/src/text-stats/CMakeLists.txt index 155b9013f3..a2c976d2f0 100644 --- a/pandatool/src/text-stats/CMakeLists.txt +++ b/pandatool/src/text-stats/CMakeLists.txt @@ -1,3 +1,7 @@ +if(NOT BUILD_TOOLS) + return() +endif() + if(NOT HAVE_NET) return() endif() diff --git a/pandatool/src/vrmlprogs/CMakeLists.txt b/pandatool/src/vrmlprogs/CMakeLists.txt index 82a5e78bd3..9f92833cd1 100644 --- a/pandatool/src/vrmlprogs/CMakeLists.txt +++ b/pandatool/src/vrmlprogs/CMakeLists.txt @@ -1,3 +1,7 @@ +if(NOT BUILD_TOOLS) + return() +endif() + add_executable(vrml-trans vrmlTrans.cxx vrmlTrans.h) target_link_libraries(vrml-trans p3progbase p3vrml) install(TARGETS vrml-trans EXPORT Tools COMPONENT Tools DESTINATION ${CMAKE_INSTALL_BINDIR}) diff --git a/pandatool/src/win-stats/CMakeLists.txt b/pandatool/src/win-stats/CMakeLists.txt index 4e5d607948..8c5a0a0f5c 100644 --- a/pandatool/src/win-stats/CMakeLists.txt +++ b/pandatool/src/win-stats/CMakeLists.txt @@ -1,3 +1,7 @@ +if(NOT BUILD_TOOLS) + return() +endif() + if(NOT WIN32 OR NOT HAVE_NET) return() endif() diff --git a/pandatool/src/xfileprogs/CMakeLists.txt b/pandatool/src/xfileprogs/CMakeLists.txt index 29562db00d..9d3acc8959 100644 --- a/pandatool/src/xfileprogs/CMakeLists.txt +++ b/pandatool/src/xfileprogs/CMakeLists.txt @@ -1,3 +1,7 @@ +if(NOT BUILD_TOOLS) + return() +endif() + add_executable(x-trans xFileTrans.cxx xFileTrans.h) target_link_libraries(x-trans p3progbase p3xfile) install(TARGETS x-trans EXPORT Tools COMPONENT Tools DESTINATION ${CMAKE_INSTALL_BINDIR})