Browse Source

CMake: Only attempt to build pnmtext if HAVE_FREETYPE.

Sam Edwards 12 years ago
parent
commit
1a2be0dbee
3 changed files with 28 additions and 20 deletions
  1. 4 1
      panda/CMakeLists.txt
  2. 20 18
      panda/src/pnmtext/CMakeLists.txt
  3. 4 1
      panda/src/text/CMakeLists.txt

+ 4 - 1
panda/CMakeLists.txt

@@ -69,11 +69,14 @@ set(CORE_MODULE_COMPONENTS
     p3chan p3char p3collide p3cull p3device p3dgraph p3display p3downloader
     p3chan p3char p3collide p3cull p3device p3dgraph p3display p3downloader
     p3event p3express p3gobj p3grutil p3gsgbase p3linmath p3mathutil p3nativenet
     p3event p3express p3gobj p3grutil p3gsgbase p3linmath p3mathutil p3nativenet
     p3net p3movies p3parametrics p3pgraph p3pgraphnodes p3pgui p3pipeline
     p3net p3movies p3parametrics p3pgraph p3pgraphnodes p3pgui p3pipeline
-    p3pnmimage p3pnmtext p3pstatclient p3putil p3recorder p3text p3tform)
+    p3pnmimage p3pstatclient p3putil p3recorder p3text p3tform)
 
 
 if(HAVE_AUDIO)
 if(HAVE_AUDIO)
   list(APPEND CORE_MODULE_COMPONENTS p3audio)
   list(APPEND CORE_MODULE_COMPONENTS p3audio)
 endif()
 endif()
+if(HAVE_FREETYPE)
+  list(APPEND CORE_MODULE_COMPONENTS p3pnmtext)
+endif()
 
 
 add_python_module(core ${CORE_MODULE_COMPONENTS})
 add_python_module(core ${CORE_MODULE_COMPONENTS})
 
 

+ 20 - 18
panda/src/pnmtext/CMakeLists.txt

@@ -1,19 +1,21 @@
-set(P3PNMTEXT_HEADERS
-  config_pnmtext.h
-  freetypeFace.h freetypeFace.I
-  freetypeFont.h freetypeFont.I
-  pnmTextGlyph.h pnmTextGlyph.I
-  pnmTextMaker.h pnmTextMaker.I
-)
-set(P3PNMTEXT_SOURCES
-  config_pnmtext.cxx
-  freetypeFace.cxx
-  freetypeFont.cxx
-  pnmTextGlyph.cxx
-  pnmTextMaker.cxx
-)
+if(HAVE_FREETYPE)
+  set(P3PNMTEXT_HEADERS
+    config_pnmtext.h
+    freetypeFace.h freetypeFace.I
+    freetypeFont.h freetypeFont.I
+    pnmTextGlyph.h pnmTextGlyph.I
+    pnmTextMaker.h pnmTextMaker.I
+  )
+  set(P3PNMTEXT_SOURCES
+    config_pnmtext.cxx
+    freetypeFace.cxx
+    freetypeFont.cxx
+    pnmTextGlyph.cxx
+    pnmTextMaker.cxx
+  )
 
 
-composite_sources(p3pnmtext P3PNMTEXT_SOURCES)
-add_library(p3pnmtext ${P3PNMTEXT_SOURCES} ${P3PNMTEXT_HEADERS})
-target_link_libraries(p3pnmtext p3pnmimage ${_FREETYPE_LIBRARIES})
-target_interrogate(p3pnmtext ALL)
+  composite_sources(p3pnmtext P3PNMTEXT_SOURCES)
+  add_library(p3pnmtext ${P3PNMTEXT_SOURCES} ${P3PNMTEXT_HEADERS})
+  target_link_libraries(p3pnmtext p3pnmimage ${_FREETYPE_LIBRARIES})
+  target_interrogate(p3pnmtext ALL)
+endif()

+ 4 - 1
panda/src/text/CMakeLists.txt

@@ -34,5 +34,8 @@ set(P3TEXT_SOURCES
 
 
 composite_sources(p3text P3TEXT_SOURCES)
 composite_sources(p3text P3TEXT_SOURCES)
 add_library(p3text ${P3TEXT_SOURCES} ${P3TEXT_HEADERS})
 add_library(p3text ${P3TEXT_SOURCES} ${P3TEXT_HEADERS})
-target_link_libraries(p3text p3pnmtext p3parametrics ${_FREETYPE_LIBRARIES})
+target_link_libraries(p3text p3parametrics)
+if(HAVE_FREETYPE)
+  target_link_libraries(p3text p3pnmtext ${_FREETYPE_LIBRARIES})
+endif()
 target_interrogate(p3text ALL)
 target_interrogate(p3text ALL)