Browse Source

CMake: Fix build when HAVE_EGG=OFF

Sam Edwards 7 years ago
parent
commit
788efb9f6d

+ 13 - 9
pandatool/src/bam/CMakeLists.txt

@@ -2,14 +2,18 @@ add_executable(bam-info bamInfo.cxx bamInfo.h)
 target_link_libraries(bam-info p3progbase panda)
 install(TARGETS bam-info EXPORT Tools COMPONENT Tools DESTINATION bin)
 
-add_executable(egg2bam eggToBam.cxx eggToBam.h)
-target_link_libraries(egg2bam p3eggbase p3progbase panda)
-install(TARGETS egg2bam EXPORT Tools COMPONENT Tools DESTINATION bin)
+if(HAVE_EGG)
 
-add_executable(bam2egg bamToEgg.cxx bamToEgg.h)
-target_link_libraries(bam2egg p3converter p3eggbase p3progbase panda)
-install(TARGETS bam2egg EXPORT Tools COMPONENT Tools DESTINATION bin)
+  add_executable(egg2bam eggToBam.cxx eggToBam.h)
+  target_link_libraries(egg2bam p3eggbase p3progbase panda)
+  install(TARGETS egg2bam EXPORT Tools COMPONENT Tools DESTINATION bin)
 
-add_executable(pts2bam ptsToBam.cxx ptsToBam.h)
-target_link_libraries(pts2bam p3progbase pandaegg panda)
-install(TARGETS pts2bam EXPORT Tools COMPONENT Tools DESTINATION bin)
+  add_executable(bam2egg bamToEgg.cxx bamToEgg.h)
+  target_link_libraries(bam2egg p3converter p3eggbase p3progbase panda)
+  install(TARGETS bam2egg EXPORT Tools COMPONENT Tools DESTINATION bin)
+
+  add_executable(pts2bam ptsToBam.cxx ptsToBam.h)
+  target_link_libraries(pts2bam p3progbase pandaegg panda)
+  install(TARGETS pts2bam EXPORT Tools COMPONENT Tools DESTINATION bin)
+
+endif()

+ 4 - 0
pandatool/src/converter/CMakeLists.txt

@@ -1,3 +1,7 @@
+if(NOT HAVE_EGG)
+  return()
+endif()
+
 set(P3CONVERTER_HEADERS
   somethingToEggConverter.h somethingToEggConverter.I
   eggToSomethingConverter.h eggToSomethingConverter.I

+ 4 - 0
pandatool/src/dxfegg/CMakeLists.txt

@@ -1,3 +1,7 @@
+if(NOT HAVE_EGG)
+  return()
+endif()
+
 set(P3DXFEGG_HEADERS
   dxfToEggConverter.h
   dxfToEggLayer.h

+ 10 - 6
pandatool/src/dxfprogs/CMakeLists.txt

@@ -2,10 +2,14 @@ add_executable(dxf-points dxfPoints.cxx dxfPoints.h)
 target_link_libraries(dxf-points p3progbase p3dxf)
 install(TARGETS dxf-points EXPORT Tools COMPONENT Tools DESTINATION bin)
 
-add_executable(egg2dxf eggToDXF.cxx eggToDXF.h eggToDXFLayer.cxx eggToDXFLayer.h)
-target_link_libraries(egg2dxf p3dxfegg p3eggbase p3progbase)
-install(TARGETS egg2dxf EXPORT Tools COMPONENT Tools DESTINATION bin)
+if(HAVE_EGG)
 
-add_executable(dxf2egg dxfToEgg.cxx dxfToEgg.h)
-target_link_libraries(dxf2egg p3dxfegg p3eggbase p3progbase)
-install(TARGETS dxf2egg EXPORT Tools COMPONENT Tools DESTINATION bin)
+  add_executable(egg2dxf eggToDXF.cxx eggToDXF.h eggToDXFLayer.cxx eggToDXFLayer.h)
+  target_link_libraries(egg2dxf p3dxfegg p3eggbase p3progbase)
+  install(TARGETS egg2dxf EXPORT Tools COMPONENT Tools DESTINATION bin)
+
+  add_executable(dxf2egg dxfToEgg.cxx dxfToEgg.h)
+  target_link_libraries(dxf2egg p3dxfegg p3eggbase p3progbase)
+  install(TARGETS dxf2egg EXPORT Tools COMPONENT Tools DESTINATION bin)
+
+endif()

+ 4 - 0
pandatool/src/egg-mkfont/CMakeLists.txt

@@ -1,3 +1,7 @@
+if(NOT HAVE_EGG)
+  return()
+endif()
+
 set(P3EGG_MKFONT_HEADERS
   eggMakeFont.h
   rangeDescription.h rangeDescription.I

+ 4 - 0
pandatool/src/egg-optchar/CMakeLists.txt

@@ -1,3 +1,7 @@
+if(NOT HAVE_EGG)
+  return()
+endif()
+
 set(P3EGG_OPTCHAR_HEADERS
   config_egg_optchar.h
   eggOptchar.h

+ 4 - 0
pandatool/src/egg-palettize/CMakeLists.txt

@@ -1,3 +1,7 @@
+if(NOT HAVE_EGG)
+  return()
+endif()
+
 add_executable(egg-palettize eggPalettize.cxx eggPalettize.h)
 target_link_libraries(egg-palettize p3palettizer p3eggbase p3progbase)
 install(TARGETS egg-palettize EXPORT Tools COMPONENT Tools DESTINATION bin)

+ 4 - 0
pandatool/src/egg-qtess/CMakeLists.txt

@@ -1,3 +1,7 @@
+if(NOT HAVE_EGG)
+  return()
+endif()
+
 set(P3EGG_QTESS_HEADERS
   config_egg_qtess.h
   eggQtess.h

+ 4 - 0
pandatool/src/eggbase/CMakeLists.txt

@@ -1,3 +1,7 @@
+if(NOT HAVE_EGG)
+  return()
+endif()
+
 set(P3EGGBASE_HEADERS
   eggBase.h eggConverter.h eggFilter.h
   eggMakeSomething.h

+ 4 - 0
pandatool/src/eggcharbase/CMakeLists.txt

@@ -1,3 +1,7 @@
+if(NOT HAVE_EGG)
+  return()
+endif()
+
 set(P3EGGCHARBASE_HEADERS
   config_eggcharbase.h
   eggBackPointer.h

+ 4 - 0
pandatool/src/eggprogs/CMakeLists.txt

@@ -1,3 +1,7 @@
+if(NOT HAVE_EGG)
+  return()
+endif()
+
 add_executable(egg-crop eggCrop.cxx eggCrop.h)
 target_link_libraries(egg-crop p3eggbase)
 install(TARGETS egg-crop EXPORT Tools COMPONENT Tools DESTINATION bin)

+ 4 - 0
pandatool/src/fltegg/CMakeLists.txt

@@ -1,3 +1,7 @@
+if(NOT HAVE_EGG)
+  return()
+endif()
+
 set(P3FLTEGG_HEADERS
   fltToEggConverter.h fltToEggConverter.I
   fltToEggLevelState.h fltToEggLevelState.I

+ 10 - 6
pandatool/src/fltprogs/CMakeLists.txt

@@ -10,10 +10,14 @@ add_executable(fltcopy fltCopy.cxx fltCopy.h)
 target_link_libraries(fltcopy p3progbase p3cvscopy p3flt)
 install(TARGETS fltcopy EXPORT Tools COMPONENT Tools DESTINATION bin)
 
-add_executable(egg2flt eggToFlt.cxx eggToFlt.h)
-target_link_libraries(egg2flt p3fltegg p3eggbase p3progbase)
-install(TARGETS egg2flt EXPORT Tools COMPONENT Tools DESTINATION bin)
+if(HAVE_EGG)
 
-add_executable(flt2egg fltToEgg.cxx fltToEgg.h)
-target_link_libraries(flt2egg p3fltegg p3eggbase p3progbase)
-install(TARGETS flt2egg EXPORT Tools COMPONENT Tools DESTINATION bin)
+  add_executable(egg2flt eggToFlt.cxx eggToFlt.h)
+  target_link_libraries(egg2flt p3fltegg p3eggbase p3progbase)
+  install(TARGETS egg2flt EXPORT Tools COMPONENT Tools DESTINATION bin)
+
+  add_executable(flt2egg fltToEgg.cxx fltToEgg.h)
+  target_link_libraries(flt2egg p3fltegg p3eggbase p3progbase)
+  install(TARGETS flt2egg EXPORT Tools COMPONENT Tools DESTINATION bin)
+
+endif()

+ 4 - 0
pandatool/src/lwoegg/CMakeLists.txt

@@ -1,3 +1,7 @@
+if(NOT HAVE_EGG)
+  return()
+endif()
+
 set(P3LWOEGG_HEADERS
   cLwoClip.h cLwoClip.I
   cLwoLayer.h cLwoLayer.I

+ 7 - 3
pandatool/src/lwoprogs/CMakeLists.txt

@@ -2,6 +2,10 @@ add_executable(lwo-scan lwoScan.cxx lwoScan.h)
 target_link_libraries(lwo-scan p3progbase p3lwo)
 install(TARGETS lwo-scan EXPORT Tools COMPONENT Tools DESTINATION bin)
 
-add_executable(lwo2egg lwoToEgg.cxx lwoToEgg.h)
-target_link_libraries(lwo2egg p3lwoegg p3eggbase p3progbase)
-install(TARGETS lwo2egg EXPORT Tools COMPONENT Tools DESTINATION bin)
+if(HAVE_EGG)
+
+  add_executable(lwo2egg lwoToEgg.cxx lwoToEgg.h)
+  target_link_libraries(lwo2egg p3lwoegg p3eggbase p3progbase)
+  install(TARGETS lwo2egg EXPORT Tools COMPONENT Tools DESTINATION bin)
+
+endif()

+ 4 - 0
pandatool/src/objegg/CMakeLists.txt

@@ -1,3 +1,7 @@
+if(NOT HAVE_EGG)
+  return()
+endif()
+
 set(P3OBJEGG_HEADERS
   config_objegg.h
   eggToObjConverter.h

+ 4 - 0
pandatool/src/objprogs/CMakeLists.txt

@@ -1,3 +1,7 @@
+if(NOT HAVE_EGG)
+  return()
+endif()
+
 add_executable(egg2obj eggToObj.cxx eggToObj.h)
 target_link_libraries(egg2obj p3objegg p3eggbase)
 install(TARGETS egg2obj EXPORT Tools COMPONENT Tools DESTINATION bin)

+ 4 - 0
pandatool/src/palettizer/CMakeLists.txt

@@ -1,3 +1,7 @@
+if(NOT HAVE_EGG)
+  return()
+endif()
+
 set(P3PALETTIZER_HEADERS
   config_palettizer.h
   destTextureImage.h

+ 4 - 0
pandatool/src/ptloader/CMakeLists.txt

@@ -1,3 +1,7 @@
+if(NOT HAVE_EGG)
+  return()
+endif()
+
 set(P3PTLOADER_HEADERS
   config_ptloader.h
   loaderFileTypePandatool.h

+ 4 - 0
pandatool/src/vrmlegg/CMakeLists.txt

@@ -1,3 +1,7 @@
+if(NOT HAVE_EGG)
+  return()
+endif()
+
 set(P3VRMLEGG_HEADERS
   indexedFaceSet.h
   vrmlAppearance.h

+ 7 - 3
pandatool/src/vrmlprogs/CMakeLists.txt

@@ -2,6 +2,10 @@ add_executable(vrml-trans vrmlTrans.cxx vrmlTrans.h)
 target_link_libraries(vrml-trans p3progbase p3vrml)
 install(TARGETS vrml-trans EXPORT Tools COMPONENT Tools DESTINATION bin)
 
-add_executable(vrml2egg vrmlToEgg.cxx vrmlToEgg.h)
-target_link_libraries(vrml2egg p3vrmlegg p3eggbase p3progbase)
-install(TARGETS vrml2egg EXPORT Tools COMPONENT Tools DESTINATION bin)
+if(HAVE_EGG)
+
+  add_executable(vrml2egg vrmlToEgg.cxx vrmlToEgg.h)
+  target_link_libraries(vrml2egg p3vrmlegg p3eggbase p3progbase)
+  install(TARGETS vrml2egg EXPORT Tools COMPONENT Tools DESTINATION bin)
+
+endif()

+ 4 - 0
pandatool/src/xfileegg/CMakeLists.txt

@@ -1,3 +1,7 @@
+if(NOT HAVE_EGG)
+  return()
+endif()
+
 set(P3XFILEEGG_HEADERS
   xFileAnimationSet.h xFileAnimationSet.I
   xFileFace.h xFileMaker.h

+ 11 - 7
pandatool/src/xfileprogs/CMakeLists.txt

@@ -1,11 +1,15 @@
-add_executable(egg2x eggToX.cxx eggToX.h)
-target_link_libraries(egg2x p3xfileegg p3eggbase p3progbase)
-install(TARGETS egg2x EXPORT Tools COMPONENT Tools DESTINATION bin)
-
 add_executable(x-trans xFileTrans.cxx xFileTrans.h)
 target_link_libraries(x-trans p3progbase p3xfile)
 install(TARGETS x-trans EXPORT Tools COMPONENT Tools DESTINATION bin)
 
-add_executable(x2egg xFileToEgg.cxx xFileToEgg.h)
-target_link_libraries(x2egg p3xfileegg p3eggbase p3progbase)
-install(TARGETS x2egg EXPORT Tools COMPONENT Tools DESTINATION bin)
+if(HAVE_EGG)
+
+  add_executable(egg2x eggToX.cxx eggToX.h)
+  target_link_libraries(egg2x p3xfileegg p3eggbase p3progbase)
+  install(TARGETS egg2x EXPORT Tools COMPONENT Tools DESTINATION bin)
+
+  add_executable(x2egg xFileToEgg.cxx xFileToEgg.h)
+  target_link_libraries(x2egg p3xfileegg p3eggbase p3progbase)
+  install(TARGETS x2egg EXPORT Tools COMPONENT Tools DESTINATION bin)
+
+endif()