SHARE
TWEET

libstage/CMakeLists.txt for Stage 4.0.0

a guest Dec 2nd, 2011 1,771 Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. MESSAGE( STATUS "Configuring libstage" )
  2.  
  3. # for config.h
  4. include_directories(${PROJECT_BINARY_DIR})
  5.  
  6. set( stageSrcs    
  7.         block.cc
  8.         blockgroup.cc
  9.         camera.cc
  10.         color.cc
  11.         file_manager.cc
  12.         file_manager.hh
  13.         gl.cc
  14.         logentry.cc
  15.         model.cc
  16.         model_actuator.cc
  17.         model_blinkenlight.cc
  18.         model_blobfinder.cc
  19.         model_callbacks.cc
  20.         model_camera.cc
  21.         model_draw.cc
  22.         model_fiducial.cc
  23.         model_getset.cc
  24.         model_gripper.cc
  25.         model_lightindicator.cc
  26.         model_load.cc
  27.         model_position.cc
  28.         model_ranger.cc
  29.         option.cc
  30.         powerpack.cc
  31.         region.cc
  32.         stage.cc
  33.         stage.hh
  34.         texture_manager.cc
  35.         typetable.cc           
  36.         world.cc                       
  37.         worldfile.cc           
  38.   canvas.cc
  39.   options_dlg.cc
  40.   options_dlg.hh
  41.   vis_strip.cc                 
  42.   worldgui.cc
  43.   ancestor.cc
  44. )
  45.  
  46. set_source_files_properties( ${stageSrcs} PROPERTIES COMPILE_FLAGS "${FLTK_CFLAGS}" )
  47.  
  48. add_library(stage SHARED ${stageSrcs})
  49.  
  50. # if fltk-config didn't bring along the OpenGL dependencies (eg. on
  51. # Debian/Ubuntu), add them explicity
  52. IF (NOT(${FLTK_LDFLAGS} MATCHES "-lGL"))
  53.   target_link_libraries( stage ${OPENGL_LIBRARIES})
  54. ENDIF (NOT(${FLTK_LDFLAGS} MATCHES "-lGL"))
  55.  
  56.  
  57. # causes the shared library to have a version number
  58. set_target_properties( stage PROPERTIES
  59.                        VERSION ${VERSION}
  60.            LINK_FLAGS "${FLTK_LDFLAGS}"  
  61. )
  62.  
  63. target_link_libraries( stage ${LTDL_LIB} )
  64. target_link_libraries(stage fltk fltk_gl fltk_images)
  65.  
  66. set( stagebinarySrcs main.cc )
  67. set_source_files_properties( ${stagebinarySrcs} PROPERTIES COMPILE_FLAGS "${FLTK_CFLAGS}" )
  68.  
  69. # TODO: build an app bundle on OS X
  70. #set(MACOSX_BUNDLE_INFO_STRING "${PROJECT_NAME}")
  71. #set(MACOSX_BUNDLE_GUI_IDENTIFIER "org.playerstage.stage")
  72. #set(MACOSX_BUNDLE_LONG_VERSION_STRING "${PROJECT_NAME} Version ${VERSION}")
  73. #set(MACOSX_BUNDLE_BUNDLE_NAME ${PROJECT_NAME})
  74. #set(MACOSX_BUNDLE_SHORT_VERSION_STRING ${VERSION})
  75. #set(MACOSX_BUNDLE_BUNDLE_VERSION ${VERSION})
  76. #set(MACOSX_BUNDLE_COPYRIGHT "Copyright 2010. All Rights Reserved.")
  77. # add_executable( stagebinary MACOSX_BUNDLE ${stagebinarySrcs} )
  78.  
  79. add_executable( stagebinary ${stagebinarySrcs} )
  80.  
  81.  
  82. set_target_properties( stagebinary PROPERTIES OUTPUT_NAME stage )
  83.  
  84. # Apple seems to have trouble when libstage and stagebinary are linked against FLTK
  85. # Newer Linux distributions won't allow stagebinary to inherit libstage's links to fltk, so we need
  86. # to explicitly link on Linux
  87.  
  88. target_link_libraries( stagebinary stage )
  89. target_link_libraries( stagebinary fltk fltk_gl fltk_images)
  90. set_target_properties( stagebinary PROPERTIES LINK_FLAGS "${FLTK_LDFLAGS}" )
  91.  
  92. IF(PROJECT_OS_LINUX)
  93.   target_link_libraries( stagebinary stage pthread )
  94. ENDIF(PROJECT_OS_LINUX)
  95.  
  96. INSTALL(TARGETS stagebinary stage
  97.         RUNTIME DESTINATION bin
  98.         LIBRARY DESTINATION ${PROJECT_LIB_DIR}
  99. )
  100.  
  101. INSTALL(FILES stage.hh
  102.         DESTINATION include/${PROJECT_NAME}-${APIVERSION})
  103.  
  104.  
RAW Paste Data
Top