Manta Interactive Ray Tracer Development Mailing List

Text archives Help


[MANTA] r1434 - in trunk: CMake Image


Chronological Thread 
  • From: abe@sci.utah.edu
  • To: manta@sci.utah.edu
  • Subject: [MANTA] r1434 - in trunk: CMake Image
  • Date: Thu, 28 Jun 2007 16:14:03 -0600 (MDT)

Author: abe
Date: Thu Jun 28 16:14:03 2007
New Revision: 1434

Modified:
   trunk/CMake/FindTeem.cmake
   trunk/Image/CMakeLists.txt
Log:

Fixed Teem dependency script. libteem.{a,so} is not present in Teem
1.9, instead each library is built into a separate library. Projects
can then link to specific tools (like nrrd only). This script uses the
TEEMUse.cmake script included in source distributions of Teem
1.9. Specify the path to the teem binaries (unu etc.) if they are not
in the system path.

Works on linux with either shared or static Teem build. On Apple the
linker complains about symbols being defined multiple times in libair.

M    CMake/FindTeem.cmake
M    Image/CMakeLists.txt


Modified: trunk/CMake/FindTeem.cmake
==============================================================================
--- trunk/CMake/FindTeem.cmake  (original)
+++ trunk/CMake/FindTeem.cmake  Thu Jun 28 16:14:03 2007
@@ -2,15 +2,62 @@
 ##################################################################
 # Look for Teem http://teem.sourceforge.net/
 
-# Look for library here before you look in Thirdparty path
-SET(TEEM_INSTALL_PATH "" CACHE PATH "Default search path for Teem install")
+# 
+# The script should work with TEEM-1.9 which includes a CMake build
+# along with scripts to locate teem libraries. The scripts appear to
+# included only in the source build. 
+#
+# TEEM 1.9 also uses separate libraries for all of the different teem
+# modules; there is no monolithic libteem.{so,a}
+# 
+# The following relevant variables are introduced by this script:
+#
+# TEEM_LIBRARY_DIRS -- Teem library directory.
+# TEEM_LIBRARIES    -- Names of compiled libraries.
+# TEEM_INCLUDE_DIRS -- Include directory.
+#
+# Note that this script does not include the TEEMUse.cmake script which 
+# appears to modify the global compiler and linker command line options.
+# These options are specifically tuned for many compilers in Manta.
+# 
+
+# First locate the unu command in the path.
+FIND_PATH(FOUND_TEEM_BIN unu
+  DOC "Location of teem binaries (like unu)"
+  )
+
+# Check to see if unu/teem is in the path.
+IF (FOUND_TEEM_BIN)
+
+  # Search for TEEMConfig using a relative path
+  FIND_FILE(FOUND_TEEMCONFIG_CMAKE
+    TEEMConfig.cmake
+    ${FOUND_TEEM_BIN}/../lib/TEEM-1.9
+    )
+  
+  # Include the teem configuration.
+  IF (FOUND_TEEMCONFIG_CMAKE)
+
+    # Include a generated configure script
+    INCLUDE(${FOUND_TEEMCONFIG_CMAKE})
+
+    # Enable found flag.
+    SET(FOUND_TEEM TRUE)
+
+    # Add the include directory to the build
+    INCLUDE_DIRECTORIES(${TEEM_INCLUDE_DIRS})
+    LINK_DIRECTORIES   (${TEEM_LIBRARY_DIRS})    
+
+  ELSE (FOUND_TEEMCONFIG_CMAKE)
+    # Warn about version.
+    MESSAGE("TEEMConfig.cmake not found. Are you using Teem 1.9 source 
distribution?")
+  ENDIF (FOUND_TEEMCONFIG_CMAKE)
+
+  MARK_AS_ADVANCED(FOUND_TEEMCONFIG_CMAKE)
+  MARK_AS_ADVANCED(FOUND_TEEM_BIN)
+
+ENDIF(FOUND_TEEM_BIN)
+
+
 
-# Also look in ${TEEM_INSTALL_PATH}/bin, because the teem CMake build
-# puts the libraries in there.
-FIND_LIBRARY( FOUND_TEEM_LIB NAMES teem
-                                 PATHS ${TEEM_INSTALL_PATH}/lib 
${TEEM_INSTALL_PATH}/bin ${THIRD_PARTY_LIBRARY_PATH} /usr/local/lib /usr/lib
-                                 DOC "Teem library (This is a path.)" )
-FIND_PATH   ( FOUND_TEEM_INCLUDE teem/nrrd.h ${TEEM_INSTALL_PATH}/include 
${THIRD_PARTY_INCLUDE_PATH} /usr/local/include /usr/include
-                                 DOC "Teem Include (This is a path.)" )
 
-MARK_AS_ADVANCED(FOUND_TEEM_LIB FOUND_TEEM_INCLUDE)

Modified: trunk/Image/CMakeLists.txt
==============================================================================
--- trunk/Image/CMakeLists.txt  (original)
+++ trunk/Image/CMakeLists.txt  Thu Jun 28 16:14:03 2007
@@ -1,29 +1,19 @@
 
+
 
###############################################################################
 # Check to see if nrrd dependent files should be included.
-IF (FOUND_TEEM_INCLUDE) 
+IF (FOUND_TEEM) 
 
   # Add the Nrrd read/write files to the build
   SET (NRRD_IMAGE_SRC NRRDFile.h NRRDFile.cc)  
+  SET (NRRD_IMAGE_LIB nrrd ${nrrd_LIB_DEPENDS})
 
-  # Add the include directory to the build
-  INCLUDE_DIRECTORIES(${FOUND_TEEM_INCLUDE})
-
-ELSE (FOUND_TEEM_INCLUDE)
+ELSE (FOUND_TEEM)
   # Add stubs for these functions
   SET (NRRD_IMAGE_SRC NRRDFile.h NRRDFile-stub.cc)  
-ENDIF (FOUND_TEEM_INCLUDE)
-
-IF (FOUND_TEEM_LIB)
-  # Add the library dependency
-  SET (NRRD_IMAGE_LIB ${FOUND_TEEM_LIB} png)
-
-  IF(APPLE)
-    SET(NRRD_IMAGE_LIB ${NRRD_IMAGE_LIB} bz2 z)  
-  ENDIF(APPLE)
-
-ENDIF(FOUND_TEEM_LIB)
+ENDIF (FOUND_TEEM)
 
+###############################################################################
 # Locate ImageMagick++
 INCLUDE (${CMAKE_SOURCE_DIR}/CMake/FindImageMagick++.cmake)
 
@@ -38,6 +28,8 @@
   SET (ImageMagick_SRC ImageMagickFile.h ImageMagickFile-stub.cc)
 ENDIF(ImageMagickPP_FOUND)
 
+###############################################################################
+# Create the library
 ADD_LIBRARY (Manta_Image 
              NullImage.cc
              NullImage.h
@@ -59,11 +51,12 @@
                       Manta_Interface 
                       Manta_Core
                       SCIRun_Core 
-                      ${NRRD_IMAGE_LIB})
+  ${NRRD_IMAGE_LIB}
+  )
 
 IF (ImageMagickPP_FOUND)
   # Add the ImageMagick libraries
   TARGET_LINK_LIBRARIES(Manta_Image ${ImageMagickPP_LIB})
 ENDIF(ImageMagickPP_FOUND)
 
-                    
\ No newline at end of file
+                    




  • [MANTA] r1434 - in trunk: CMake Image, abe, 06/28/2007

Archive powered by MHonArc 2.6.16.

Top of page