Manta Interactive Ray Tracer Development Mailing List

Text archives Help


[Manta] Make install


Chronological Thread 
  • From: Li-Ta Lo < >
  • To:
  • Subject: [Manta] Make install
  • Date: Thu, 05 Jun 2008 13:37:29 -0600
  • Organization: Los Alamos National Lab

Hi,

Since I am trying to embedding Manta into VTK, it is much more
convenient for me if Manta is "installed" at some place. Here
is a patch to the CMakeLists.txt files that kind of doing this.
There are two problems left, 1. it install each .h files twice,
2. it install more files than it should in the include directory.

Any ideas?

Ollie

Index: CMake/InstallHeaders.cmake
===================================================================
--- CMake/InstallHeaders.cmake	(revision 0)
+++ CMake/InstallHeaders.cmake	(revision 0)
@@ -0,0 +1,14 @@
+# install for .h files
+MACRO(InstallHeaders sources)
+  SET(__files.h)
+  FOREACH(__file ${ARGV})
+    GET_FILENAME_COMPONENT(__fname ${__file} ABSOLUTE) 
+    GET_FILENAME_COMPONENT(__fname.path ${__fname} PATH)  
+    GET_FILENAME_COMPONENT(__fname.name ${__fname} NAME_WE)  
+    IF ( EXISTS "${__fname.path}/${__fname.name}.h" )	
+      STRING(REPLACE "${CMAKE_SOURCE_DIR}/" "" __rel.path ${__fname.path})
+      SET(__files.h "${__fname.path}/${__fname.name}.h")
+      INSTALL(FILES ${__files.h} DESTINATION include/${__rel.path})
+    ENDIF ( EXISTS "${__fname.path}/${__fname.name}.h" )  
+  ENDFOREACH(__file)
+ENDMACRO(InstallHeaders)
Index: scenes/CMakeLists.txt
===================================================================
--- scenes/CMakeLists.txt	(revision 2280)
+++ scenes/CMakeLists.txt	(working copy)
@@ -13,6 +13,7 @@
 IF(SCENE_0)
    ADD_LIBRARY(scene_0 0.cc)
    TARGET_LINK_LIBRARIES(scene_0 ${MANTA_SCENE_LINK})
+   INSTALL(TARGETS scene_0 DESTINATION lib)
 ENDIF(SCENE_0)
 
 # Test different primitives.
@@ -20,6 +21,7 @@
 IF(SCENE_PRIMTEST)
    ADD_LIBRARY(scene_primtest primtest.cc)
    TARGET_LINK_LIBRARIES(scene_primtest ${MANTA_SCENE_LINK})
+   INSTALL(TARGETS scene_primtest DESTINATION lib)
 ENDIF(SCENE_PRIMTEST)
 
 # Test acceleration structure efficiency through random objects
@@ -27,6 +29,7 @@
 IF(SCENE_COMPLEXITYTEST)
    ADD_LIBRARY(scene_complexitytest complexitytest.cc)
    TARGET_LINK_LIBRARIES(scene_complexitytest ${MANTA_SCENE_LINK})
+   INSTALL(TARGETS scene_complexitytest DESTINATION lib)
 ENDIF(SCENE_COMPLEXITYTEST)
 
 # Old RTRT teapot scene
@@ -34,6 +37,7 @@
 IF(SCENE_TEAPOT_ROOM)
    ADD_LIBRARY(scene_teapotRoom teapotRoom.cc)
    TARGET_LINK_LIBRARIES(scene_teapotRoom ${MANTA_SCENE_LINK})
+   INSTALL(TARGETS scene_teapotRoom DESTINATION lib)
 ENDIF(SCENE_TEAPOT_ROOM)
 
 # softshadow via many point sources
@@ -41,6 +45,7 @@
 IF(SCENE_SOFT_SHADOW)
    ADD_LIBRARY(scene_softshadow softshadow.cc)
    TARGET_LINK_LIBRARIES(scene_softshadow ${MANTA_SCENE_LINK})
+   INSTALL(TARGETS scene_softshadow DESTINATION lib)
 ENDIF(SCENE_SOFT_SHADOW)
 
 # instances of fences
@@ -48,6 +53,7 @@
 IF(SCENE_FENCE)
    ADD_LIBRARY(scene_fence fence.cc)
    TARGET_LINK_LIBRARIES(scene_fence ${MANTA_SCENE_LINK})
+   INSTALL(TARGETS scene_fence DESTINATION lib)
 ENDIF(SCENE_FENCE)
 
 # hdri lit scene 
@@ -55,6 +61,7 @@
 IF(SCENE_HDRI)
    ADD_LIBRARY(scene_hdri hdritest.cc)
    TARGET_LINK_LIBRARIES(scene_hdri ${MANTA_SCENE_LINK})
+   INSTALL(TARGETS scene_hdri DESTINATION lib)
 ENDIF(SCENE_HDRI)
 
 IF(FOUND_TEEM AND MANTA_SSE)
@@ -63,6 +70,7 @@
    INCLUDE_DIRECTORIES(${TEEM_INCLUDE_DIRS})
    ADD_LIBRARY(scene_volumeTest volumeTest.cc)
    TARGET_LINK_LIBRARIES(scene_volumeTest ${MANTA_SCENE_LINK})
+   INSTALL(TARGETS scene_volumeTest DESTINATION lib)
 ENDIF(SCENE_VOLUMETEST)
 ENDIF(FOUND_TEEM AND MANTA_SSE)
 
@@ -83,6 +91,7 @@
 IF(SCENE_OCTISOVOL)
    ADD_LIBRARY(scene_octisovol octisovol.cc)
    TARGET_LINK_LIBRARIES(scene_octisovol ${MANTA_SCENE_LINK})
+   INSTALL(TARGETS scene_octisovol DESTINATION lib)
 ENDIF(SCENE_OCTISOVOL)
 
 # grid isosurface
@@ -90,6 +99,7 @@
 IF(SCENE_GRIDISOVOL)
    ADD_LIBRARY(scene_gridisovol gridisovol.cc)
    TARGET_LINK_LIBRARIES(scene_gridisovol ${MANTA_SCENE_LINK})
+   INSTALL(TARGETS scene_gridisovol DESTINATION lib)
 ENDIF(SCENE_GRIDISOVOL)
 
 # triangle scene viewer loads obj, ply, and animations made of those files.
@@ -97,6 +107,7 @@
 IF(SCENE_TRIANGLESCENEVIEWER)
    ADD_LIBRARY(scene_triangleSceneViewer triangleSceneViewer.cc)
    TARGET_LINK_LIBRARIES(scene_triangleSceneViewer ${MANTA_SCENE_LINK})
+   INSTALL(TARGETS scene_triangleSceneViewer DESTINATION lib)
 ENDIF(SCENE_TRIANGLESCENEVIEWER)
 
 # Tylenol (acetaminophen aka paracetamol) molecule with CPK coloring.
@@ -105,6 +116,7 @@
 IF(SCENE_TYLENOL)
    ADD_LIBRARY(scene_tylenol tylenol.cc)
    TARGET_LINK_LIBRARIES(scene_tylenol ${MANTA_SCENE_LINK})
+   INSTALL(TARGETS scene_tylenol DESTINATION lib)
 ENDIF(SCENE_TYLENOL)
 
 # Value primitive and colormap testing scene.
@@ -112,12 +124,14 @@
 IF(SCENE_VALUE_COLORMAP)
    ADD_LIBRARY(scene_value_colormap_test valuecolormaptest.cc)
    TARGET_LINK_LIBRARIES(scene_value_colormap_test ${MANTA_SCENE_LINK})
+   INSTALL(TARGETS scene_value_colormap_test DESTINATION lib)
 ENDIF(SCENE_VALUE_COLORMAP)
 
 # Lazily evaluated LTs for NRRD particle datasets
 IF(BUILD_DYNLT)
    ADD_LIBRARY(scene_dynlt dynlt.cc)
    TARGET_LINK_LIBRARIES(scene_dynlt Manta_DynLT ${MANTA_SCENE_LINK})
+   INSTALL(TARGETS scene_dynlt DESTINATION lib)
 ENDIF(BUILD_DYNLT)
 
 # Recurse into galileo directory
@@ -127,12 +141,14 @@
 IF(SCENE_VORPAL)
    ADD_LIBRARY(scene_vorpal vorpal.cc)
    TARGET_LINK_LIBRARIES(scene_vorpal ${MANTA_SCENE_LINK})
+   INSTALL(TARGETS scene_vorpal DESTINATION lib)
 ENDIF(SCENE_VORPAL)
 
 SET(SCENE_AREA_LIGHT TRUE CACHE BOOL "An area light test scene")
 IF(SCENE_AREA_LIGHT)
    ADD_LIBRARY(scene_area_light area_light.cc)
    TARGET_LINK_LIBRARIES(scene_area_light ${MANTA_SCENE_LINK})
+   INSTALL(TARGETS scene_area_light DESTINATION lib)
 ENDIF(SCENE_AREA_LIGHT)
 
 # macbeth color checker scene
@@ -140,6 +156,7 @@
 IF(SCENE_MACBETH)
    ADD_LIBRARY(scene_macbeth macbeth.cc)
    TARGET_LINK_LIBRARIES(scene_macbeth ${MANTA_SCENE_LINK})
+   INSTALL(TARGETS scene_macbeth DESTINATION lib)
 ENDIF(SCENE_MACBETH)
 
 # BEACH color checker scene
@@ -147,10 +164,12 @@
 IF(SCENE_BEACH)
    ADD_LIBRARY(scene_beach beach.cc)
    TARGET_LINK_LIBRARIES(scene_beach ${MANTA_SCENE_LINK})
+   INSTALL(TARGETS scene_beach DESTINATION lib)
 ENDIF(SCENE_BEACH)
 
 SET(SCENE_EXTERNAL_OBJECT TRUE CACHE BOOL "Externally derived object unit test")
 IF(SCENE_EXTERNAL_OBJECT)
    ADD_LIBRARY(scene_externalObject externalObject.cc)
    TARGET_LINK_LIBRARIES(scene_externalObject ${MANTA_SCENE_LINK})
+   INSTALL(TARGETS scene_externalObject DESTINATION lib)
 ENDIF(SCENE_EXTERNAL_OBJECT)
Index: Image/CMakeLists.txt
===================================================================
--- Image/CMakeLists.txt	(revision 2280)
+++ Image/CMakeLists.txt	(working copy)
@@ -53,7 +53,8 @@
 
 ###############################################################################
 # Create the library
-ADD_LIBRARY (Manta_Image 
+
+SET(Manta_Image_SRCS
              NullImage.cc
              NullImage.h
              PPMFile.cc
@@ -71,14 +72,21 @@
              ${NRRD_IMAGE_SRC}
              ${ImageMagick_SRC}
              ${EXR_SRC}
-             ${CoreGraphics_SRC}
-             )
+             ${CoreGraphics_SRC})
 
+ADD_LIBRARY (Manta_Image 
+             ${Manta_Image_SRCS})
+
 TARGET_LINK_LIBRARIES(Manta_Image
                       Manta_Interface 
                       Manta_Core
                       )
 
+# install library files
+INSTALL(TARGETS Manta_Image DESTINATION lib)
+INCLUDE(${CMAKE_SOURCE_DIR}/CMake/InstallHeaders.cmake)
+InstallHeaders(${Manta_Image_SRCS})
+
 # Link against optional libraries
 IF (ImageMagickPP_FOUND)
   TARGET_LINK_LIBRARIES(Manta_Image ${ImageMagickPP_LIB})
Index: include/CMakeLists.txt
===================================================================
--- include/CMakeLists.txt	(revision 2280)
+++ include/CMakeLists.txt	(working copy)
@@ -155,3 +155,7 @@
   ${CMAKE_CURRENT_SOURCE_DIR}/MachineParameters.h.CmakeTemplate
   ${CMAKE_BINARY_DIR}/include/MachineParameters.h
   )
+
+INSTALL(DIRECTORY ${CMAKE_BINARY_DIR}/include DESTINATION include
+	REGEX ".*[^h]$" EXCLUDE)
+
Index: StandAlone/CMakeLists.txt
===================================================================
--- StandAlone/CMakeLists.txt	(revision 2280)
+++ StandAlone/CMakeLists.txt	(working copy)
@@ -1,6 +1,7 @@
 
 ADD_EXECUTABLE(manta manta.cc)
 TARGET_LINK_LIBRARIES(manta ${MANTA_TARGET_LINK_LIBRARIES})
+INSTALL(TARGETS manta DESTINATION bin)
 
 IF(BUILD_TESTING)
   ADD_NP_TEST(1 DefaultSceneNoDisplayBench_NP1 ${CMAKE_BINARY_DIR}/bin/manta -np 1 -nodisplaybench-dart 200 20)
Index: Core/CMakeLists.txt
===================================================================
--- Core/CMakeLists.txt	(revision 2280)
+++ Core/CMakeLists.txt	(working copy)
@@ -180,7 +180,11 @@
      Util/UpdateGraph.h
      )
 
+INCLUDE(${CMAKE_SOURCE_DIR}/CMake/InstallHeaders.cmake)
+
 ADD_LIBRARY (Manta_Core ${CORE_SOURCES})
+INSTALL(TARGETS Manta_Core DESTINATION lib)
+InstallHeaders(${CORE_SOURCES})
 
 IF(LIBXML2_LIBRARY)
   TARGET_LINK_LIBRARIES(Manta_Core ${LIBXML2_LIBRARY})
@@ -199,4 +203,5 @@
   ADD_LIBRARY (Manta_Core_XUtils XUtils/XHelper.cc)
   TARGET_LINK_LIBRARIES(Manta_Core_XUtils Manta_Core)
   TARGET_LINK_LIBRARIES(Manta_Core_XUtils ${OPENGL_LIBRARIES} ${X11_LIBRARIES})
+  INSTALL(TARGETS Manta_Core_XUtils DESTINATION lib)
 ENDIF(MANTA_ENABLE_X11)
Index: UserInterface/CMakeLists.txt
===================================================================
--- UserInterface/CMakeLists.txt	(revision 2280)
+++ UserInterface/CMakeLists.txt	(working copy)
@@ -29,3 +29,8 @@
   TARGET_LINK_LIBRARIES(Manta_UserInterface
                         Manta_Core_XUtils)
 ENDIF(MANTA_ENABLE_X11)
+
+INSTALL(TARGETS Manta_UserInterface DESTINATION lib)
+
+INCLUDE(${CMAKE_SOURCE_DIR}/CMake/InstallHeaders.cmake)
+InstallHeaders(${Manta_UserInterface_SRCS})
Index: Model/CMakeLists.txt
===================================================================
--- Model/CMakeLists.txt	(revision 2280)
+++ Model/CMakeLists.txt	(working copy)
@@ -13,22 +13,24 @@
 INCLUDE (Intersections/CMakeLists.txt)
 INCLUDE (Textures/CMakeLists.txt)
 
+SET(Manta_Model_SRCS
+    ${Manta_AmbientLights_SRCS}
+    ${Manta_Backgrounds_SRCS}
+    ${Manta_Cameras_SRCS}
+    ${Manta_Groups_SRCS}
+    ${Manta_Lights_SRCS}
+    ${Manta_Materials_SRCS}
+    ${Manta_Primitives_SRCS}
+    ${Manta_Primitives_Volume_SRCS}
+    ${Manta_TexCoordMappers_SRCS}
+    ${Manta_Instances_SRCS}
+    ${Manta_MiscObjects_SRCS}
+    ${Manta_Readers_SRCS}
+    ${Manta_Intersections_SRCS}
+    ${Manta_Textures_SRCS})
+
 ADD_LIBRARY (Manta_Model
-             ${Manta_AmbientLights_SRCS}
-             ${Manta_Backgrounds_SRCS}
-             ${Manta_Cameras_SRCS}
-             ${Manta_Groups_SRCS}
-             ${Manta_Lights_SRCS}
-             ${Manta_Materials_SRCS}
-             ${Manta_Primitives_SRCS}
-             ${Manta_Primitives_Volume_SRCS}
-             ${Manta_TexCoordMappers_SRCS}
-             ${Manta_Instances_SRCS}
-             ${Manta_MiscObjects_SRCS}
-             ${Manta_Readers_SRCS}
-             ${Manta_Intersections_SRCS}
-             ${Manta_Textures_SRCS}
-             )
+             ${Manta_Model_SRCS})
 
 TARGET_LINK_LIBRARIES(Manta_Model
   Manta_Image
@@ -37,3 +39,7 @@
   ${Manta_Model_extra_libs}
   )
 
+INSTALL(TARGETS Manta_Model DESTINATION lib)
+
+INCLUDE(${CMAKE_SOURCE_DIR}/CMake/InstallHeaders.cmake)
+InstallHeaders(${Manta_Model_SRCS})
Index: Interface/CMakeLists.txt
===================================================================
--- Interface/CMakeLists.txt	(revision 2280)
+++ Interface/CMakeLists.txt	(working copy)
@@ -1,7 +1,7 @@
 ## Create the Interface library.
-ADD_LIBRARY(Manta_Interface
-	      CameraPath.cc
-	      CameraPath.h
+SET(Manta_Interface_SRCS
+	CameraPath.cc
+	CameraPath.h
         AccelerationStructure.h
         AmbientLight.cc
         AmbientLight.h
@@ -68,7 +68,12 @@
         Transaction.h
         UserInterface.cc
         UserInterface.h
-        XWindow.h
-        )
+        XWindow.h)
 
+ADD_LIBRARY(Manta_Interface
+	${Manta_Interface_SRCS})
+
 TARGET_LINK_LIBRARIES(Manta_Interface Manta_Core)
+INSTALL(TARGETS Manta_Interface DESTINATION lib)
+INCLUDE(${CMAKE_SOURCE_DIR}/CMake/InstallHeaders.cmake)
+InstallHeaders(${Manta_Interface_SRCS})
Index: Engine/Factory/CMakeLists.txt
===================================================================
--- Engine/Factory/CMakeLists.txt	(revision 2280)
+++ Engine/Factory/CMakeLists.txt	(working copy)
@@ -28,3 +28,7 @@
   Manta_Image
   Manta_Interface
   Manta_Core)
+
+INSTALL(TARGETS Manta_Factory DESTINATION lib)
+INCLUDE(${CMAKE_SOURCE_DIR}/CMake/InstallHeaders.cmake)
+InstallHeaders(${Manta_Factory_SRCS})
Index: Engine/CMakeLists.txt
===================================================================
--- Engine/CMakeLists.txt	(revision 2280)
+++ Engine/CMakeLists.txt	(working copy)
@@ -9,19 +9,20 @@
 INCLUDE (SampleGenerators/CMakeLists.txt)
 INCLUDE (Shadows/CMakeLists.txt)
 
+SET(Manta_Engine_SRCS
+    ${Manta_Control_SRCS}
+    ${Manta_Display_SRCS}
+    ${Manta_IdleModes_SRCS}
+    ${Manta_ImageTraversers_SRCS}
+    ${Manta_LoadBalancers_SRCS}
+    ${Manta_PixelSamplers_SRCS}
+    ${Manta_SampleGenerators_SRCS}
+    ${Manta_Renderers_SRCS}
+    ${Manta_Shadows_SRCS})
+
 ADD_LIBRARY (Manta_Engine
-             ${Manta_Control_SRCS}
-             ${Manta_Display_SRCS}
-             ${Manta_IdleModes_SRCS}
-             ${Manta_ImageTraversers_SRCS}
-             ${Manta_LoadBalancers_SRCS}
-             ${Manta_PixelSamplers_SRCS}
-             ${Manta_SampleGenerators_SRCS}
-             ${Manta_Renderers_SRCS}
-             ${Manta_Shadows_SRCS}
-             )
+             ${Manta_Engine_SRCS})
 
-
 TARGET_LINK_LIBRARIES(Manta_Engine Manta_Model
                                    Manta_Image
                                    Manta_Interface
@@ -35,7 +36,11 @@
 TARGET_LINK_LIBRARIES(Manta_Engine ${OPENGL_LIBRARIES}
                                    ${X11_LIBRARIES}
                                    )
+INSTALL(TARGETS Manta_Engine DESTINATION lib)
 
+INCLUDE(${CMAKE_SOURCE_DIR}/CMake/InstallHeaders.cmake)
+InstallHeaders(${Manta_Engine_SRCS})
+
 IF(PABST_FOUND)
   INCLUDE_DIRECTORIES(${PABST_INCLUDE_DIR})
   TARGET_LINK_LIBRARIES(Manta_Engine ${PABST_LIBRARIES})



Archive powered by MHonArc 2.6.16.

Top of page