#------------------------------------------------------------------------------ # settings for vtk SET(VTK_DIR "/usr/local/" CACHE PATH "The location of VTKConfig.cmake") FIND_PACKAGE(VTK REQUIRED) INCLUDE(${VTK_USE_FILE}) INCLUDE_DIRECTORIES(SYSTEM ${VTK_INCLUDE_DIRS} ) LINK_DIRECTORIES( ${VTK_LIBRARY_DIRS} ) SET (VTK_LIBRARIES ${VTK_LIBRARIES} vtkCommon QVTK vtksys vtkRendering vtkGraphics vtkImaging vtkViews vtkInfovis vtkWidgets vtkHybrid vtkIO vtkFiltering vtkftgl vtkfreetype vtkverdict vtklibxml2 vtkalglib vtkzlib vtkexoIIc vtkNetCDF vtkDICOMParser vtkmetaio vtksqlite vtkpng vtkjpeg vtktiff vtkexpat vtkVolumeRendering) #------------------------------------------------------------------------------ # boost related settings INCLUDE_DIRECTORIES(SYSTEM ${Boost_INCLUDE_DIRS} ) LINK_DIRECTORIES( ${Boost_LIBRARY_DIRS} ) #------------------------------------------------------------------------------ # internal includes INCLUDE_DIRECTORIES( ${PROJECT_SOURCE_DIR}/simCellDesigner ) INCLUDE_DIRECTORIES( ${PROJECT_SOURCE_DIR}/simCompartment ) INCLUDE_DIRECTORIES( ${PROJECT_SOURCE_DIR}/simShare ) INCLUDE_DIRECTORIES( ${PROJECT_BINARY_DIR}/simShare ) #------------------------------------------------------------------------------ # sources SET(SimCellDesigner_SOURCES CellDesignerWidget.cpp CellWidget.cpp CompartmentWidget.cpp LabeledSourceWidget.cpp SourceWidget.cpp VtkCellView.cpp main.cpp ) #------------------------------------------------------------------------------ # headers that need moc'ing SET(SimCellDesigner_HEADERS CellDesignerWidget.h CellWidget.h CompartmentWidget.h LabeledSourceWidget.h SourceWidget.h VtkCellView.h) SET(SimCellDesigner_RESOURCES simCellDesigner.qrc) QT4_WRAP_CPP(SimCellDesigner_HEADERS_MOC ${SimCellDesigner_HEADERS}) QT4_ADD_RESOURCES(SimCellDesigner_RESOURCES_RC ${SimCellDesigner_RESOURCES}) #------------------------------------------------------------------------------ # icon for mac IF(APPLE) SET(MACOSX_BUNDLE_ICON_FILE icon_mac.icns) SET_SOURCE_FILES_PROPERTIES(${CMAKE_CURRENT_SOURCE_DIR}/install/apple/icon_mac.icns PROPERTIES MACOSX_PACKAGE_LOCATION Resources) SET(SimCellDesigner_SOURCES ${SimCellDesigner_SOURCES} ${CMAKE_CURRENT_SOURCE_DIR}/install/apple/icon_mac.icns) ENDIF(APPLE) #------------------------------------------------------------------------------ # icon for windows IF(WIN32) SET(SimCellDesigner_SOURCES ${SimCellDesigner_SOURCES} SimCellDesigner.rc) ENDIF(WIN32) #------------------------------------------------------------------------------ #put everything together for building of the executable ADD_EXECUTABLE(SimCellDesigner MACOSX_BUNDLE ${SimCellDesigner_SOURCES} ${SimCellDesigner_HEADERS_MOC} ${SimCellDesigner_RESOURCES_RC}) TARGET_LINK_LIBRARIES(SimCellDesigner ${QT_LIBRARIES}) TARGET_LINK_LIBRARIES(SimCellDesigner ${Boost_LIBRARIES}) TARGET_LINK_LIBRARIES(SimCellDesigner ${VTK_LIBRARIES}) IF(BUILD_SHARED) TARGET_LINK_LIBRARIES(SimCellDesigner Compartment) ADD_DEPENDENCIES(SimCellDesigner Compartment) ADD_DEPENDENCIES(SimCellDesigner SimShare) ELSE(BUILD_SHARED) TARGET_LINK_LIBRARIES(SimCellDesigner Compartment-static) ADD_DEPENDENCIES(SimCellDesigner Compartment-static) ADD_DEPENDENCIES(SimCellDesigner SimShare-static) ENDIF(BUILD_SHARED) #------------------------------------------------------------------------------- #------------------------------------------------------------------------------- #------------------------------------------------------------------------------- # installation IF(UNIX AND NOT APPLE) SET(qtconf_dest_dir bin) SET(plugin_dest_dir bin) SET(APPS "\${CMAKE_INSTALL_PREFIX}/bin/SimCellDesigner") ENDIF(UNIX AND NOT APPLE) IF(WIN32) SET(qtconf_dest_dir bin) SET(plugin_dest_dir bin) SET(APPS "\${CMAKE_INSTALL_PREFIX}/bin/SimCellDesigner.exe") ENDIF(WIN32) IF(APPLE) SET(qtconf_dest_dir SimCellDesigner.app/Contents/Resources) SET(plugin_dest_dir SimCellDesigner.app/Contents/MacOS) SET(APPS "\${CMAKE_INSTALL_PREFIX}/SimCellDesigner.app") ENDIF(APPLE) IF(UNIX) INSTALL(TARGETS SimCellDesigner BUNDLE DESTINATION . COMPONENT Runtime RUNTIME DESTINATION bin COMPONENT Runtime ) ELSE(UNIX) INSTALL(TARGETS SimCellDesigner BUNDLE DESTINATION . COMPONENT Runtime RUNTIME DESTINATION bin COMPONENT Runtime ) ENDIF(UNIX) IF(UNIX AND NOT APPLE) INSTALL(PROGRAMS SimCellDesigner.sh DESTINATION . COMPONENT Runtime) ENDIF(UNIX AND NOT APPLE) #------------------------------------------------------------------------------- #------------------------------------------------------------------------------- #------------------------------------------------------------------------------- #------------------------------------------------------------------------------- # Install script for docbook documentation # project specific settings SET (DOC_SOURCE ${PROJECT_SOURCE_DIR}/simCellDesigner/documentation) SET (DOC_TARGET ${CMAKE_CURRENT_BINARY_DIR}/documentation ) SET (DOCBOOK_FILE manual.xml) SET (PDF_FILE manual.pdf) SET (XHTML_FILE manual.xhtml) # OS specific settings SET(STYLESHEETS_DIR "/usr/share/xml/docbook/stylesheet/nwalsh/" CACHE FILEPATH "Location of docbook stylesheet") SET (XLST_COMMAND xsltproc) SET (FOP_COMMAND fop) SET (FO_STYLE ${DOC_SOURCE}/fo_style.xsl) #SET (XSL_FILE_FO ${STYLESHEETS_DIR}/fo/docbook.xsl) SET (XSL_FILE_XHTML ${STYLESHEETS_DIR}/xhtml/docbook.xsl) # installation code IF(BUILD_DOC) # currently only we only support building the documentation on unix # copy the documentation ADD_CUSTOM_COMMAND( TARGET SimCellDesigner POST_BUILD COMMAND ${CMAKE_COMMAND} -E make_directory ${DOC_TARGET} COMMAND ${CMAKE_COMMAND} -E copy_directory ${DOC_SOURCE} ${DOC_TARGET} ) # create a pdf file from the docbook #ADD_CUSTOM_COMMAND( # TARGET SimCellDesigner # POST_BUILD # COMMAND ${CMAKE_COMMAND} -E chdir ${DOC_TARGET} ${XLST_COMMAND} -o intermediate-fo-file.fo --path ${STYLESHEETS_DIR}/fo ${FO_STYLE} ${DOCBOOK_FILE} # COMMAND ${CMAKE_COMMAND} -E chdir ${DOC_TARGET} ${FOP_COMMAND} -pdf ${PDF_FILE} -fo intermediate-fo-file.fo # COMMAND ${CMAKE_COMMAND} -E chdir ${DOC_TARGET} ${CMAKE_COMMAND} -E remove intermediate-fo-file.fo #) # create an xhtml file from the docbook ADD_CUSTOM_COMMAND( TARGET SimCellDesigner POST_BUILD COMMAND ${CMAKE_COMMAND} -E chdir ${DOC_TARGET} ${XLST_COMMAND} -o ${XHTML_FILE} ${XSL_FILE_XHTML} ${DOCBOOK_FILE} ) ENDIF(BUILD_DOC) #------------------------------------------------------------------------------- #------------------------------------------------------------------------------- #------------------------------------------------------------------------------- #------------------------------------------------------------------------------- #------------------------------------------------------------------------------- # Install needed Qt plugins by copying directories from the qt installation # One can cull what gets copied by using 'REGEX "..." EXCLUDE' # NOTE: we don't really need them except for the bundeling process to succeed # investigate why and fix. INSTALL(DIRECTORY "${QT_PLUGINS_DIR}/imageformats" DESTINATION ${plugin_dest_dir}/plugins FILE_PERMISSIONS OWNER_EXECUTE OWNER_WRITE OWNER_READ COMPONENT Runtime) #------------------------------------------------------------------------------- # install the Manual INSTALL(DIRECTORY ${CMAKE_CURRENT_BINARY_DIR}/documentation/ DESTINATION Documentation/User/SimCellDesigner/ PATTERN "*.h" PATTERN "*.svn" EXCLUDE PATTERN "*.xsl" EXCLUDE PATTERN "highlight" EXCLUDE PATTERN "*.pdf" EXCLUDE PATTERN "*.svg" EXCLUDE PATTERN "*.xml" EXCLUDE PATTERN "COPYING" EXCLUDE) #------------------------------------------------------------------------------- # install a qt.conf file # this inserts some cmake code into the install script to write the file IF (APPLE OR NOT UNIX) INSTALL(CODE " file(WRITE \"\${CMAKE_INSTALL_PREFIX}/${qtconf_dest_dir}/qt.conf\" \"\") " COMPONENT Runtime) ENDIF (APPLE OR NOT UNIX) #------------------------------------------------------------------------------- # Use BundleUtilities to get all other dependencies for the application to work. # It takes a bundle or executable along with possible plugins and inspects it # for dependencies. If they are not system dependencies, they are copied. # directories to look for dependencies SET(DIRS_celldesigner ${QT_LIBRARY_DIRS} ${VTK_LIBRARY_DIRS} ${Boost_LIBRARY_DIRS} ${CMAKE_CURRENT_BINARY_DIR}/../simCompartment) message("Library dirs for simCellDesigner installation :") FOREACH(libdir ${DIRS}) message(STATUS " " ${libdir}) ENDFOREACH(libdir) # Now the work of copying dependencies into the bundle/package # The quotes are escaped and variables to use at install time have their $ escaped INSTALL(CODE " file(GLOB_RECURSE QTPLUGINS \"\${CMAKE_INSTALL_PREFIX}/${plugin_dest_dir}/plugins/*${CMAKE_SHARED_LIBRARY_SUFFIX}\") include(BundleUtilities) fixup_bundle(\"${APPS}\" \"\${QTPLUGINS}\" \"${DIRS_celldesigner}\") " COMPONENT Runtime)