| 1 | CMAKE_MINIMUM_REQUIRED(VERSION 2.4) |
|---|
| 2 | PROJECT(COMPUCELL3D) |
|---|
| 3 | |
|---|
| 4 | # Should we build shared libraries |
|---|
| 5 | OPTION(BUILD_SHARED_LIBS "Build shared libraries" ON) |
|---|
| 6 | |
|---|
| 7 | # Specify a version for all libs to use |
|---|
| 8 | SET(COMPUCELL3D_MAJOR_VERSION 3) |
|---|
| 9 | SET(COMPUCELL3D_MINOR_VERSION 1) |
|---|
| 10 | SET(COMPUCELL3D_BUILD_VERSION 17) |
|---|
| 11 | SET(COMPUCELL3D_VERSION |
|---|
| 12 | "${COMPUCELL3D_MAJOR_VERSION}.${COMPUCELL3D_MINOR_VERSION}.${COMPUCELL3D_BUILD_VERSION}") |
|---|
| 13 | |
|---|
| 14 | SET(COMPUCELL3D_LIBRARY_PROPERTIES ${COMPUCELL3D_LIBRARY_PROPERTIES} |
|---|
| 15 | VERSION "${COMPUCELL3D_VERSION}" |
|---|
| 16 | SOVERSION "${COMPUCELL3D_MAJOR_VERSION}.${COMPUCELL3D_MINOR_VERSION}" |
|---|
| 17 | ) |
|---|
| 18 | |
|---|
| 19 | # Always include the top level source for compiles |
|---|
| 20 | SET_DIRECTORY_PROPERTIES(PROPERTIES |
|---|
| 21 | INCLUDE_DIRECTORIES ${COMPUCELL3D_SOURCE_DIR}) |
|---|
| 22 | |
|---|
| 23 | # Where to install files relative to prefix |
|---|
| 24 | SET(COMPUCELL3D_INSTALL_LIB_DIR "/lib") |
|---|
| 25 | SET(COMPUCELL3D_INSTALL_PLUGIN_DIR "/lib/CompuCell3DPlugins") |
|---|
| 26 | SET(COMPUCELL3D_INSTALL_STEPPABLE_DIR "/lib/CompuCell3DSteppables") |
|---|
| 27 | SET(COMPUCELL3D_INSTALL_INCLUDE_DIR "/include/CompuCell3D") |
|---|
| 28 | |
|---|
| 29 | # Find libz for use in the CompuCell/IO utils |
|---|
| 30 | INCLUDE(FindZLIB) |
|---|
| 31 | |
|---|
| 32 | # Should we build wrappings |
|---|
| 33 | OPTION(BUILD_PYINTERFACE "Build Python language wrappings" ON) |
|---|
| 34 | |
|---|
| 35 | # Xerces-c dependency |
|---|
| 36 | FIND_PATH(XERCESC_INCLUDE_DIR xercesc/util/XercesDefs.hpp |
|---|
| 37 | /usr/include |
|---|
| 38 | /usr/local/include |
|---|
| 39 | /opt/local/include |
|---|
| 40 | ${COMPUCELL3D_SOURCE_DIR}/xercesc/include |
|---|
| 41 | ) |
|---|
| 42 | |
|---|
| 43 | FIND_LIBRARY(XERCESC_LIBRARY xerces-c |
|---|
| 44 | /usr/lib |
|---|
| 45 | /usr/local/lib |
|---|
| 46 | /opt/local/lib |
|---|
| 47 | ${COMPUCELL3D_SOURCE_DIR}/xercesc/lib |
|---|
| 48 | ) |
|---|
| 49 | |
|---|
| 50 | |
|---|
| 51 | |
|---|
| 52 | # add if statement for the case when we use "internal" xercesc |
|---|
| 53 | # if xercesc path does not match /usr/lib and does not match /usr/local/lib then ... |
|---|
| 54 | # set LD_LIBRARY PATHS accordingly in run scripts |
|---|
| 55 | |
|---|
| 56 | |
|---|
| 57 | |
|---|
| 58 | |
|---|
| 59 | # Where the plugins go by default |
|---|
| 60 | #FIND_PATH(COMPUCELL3D_PLUGIN_PATH |
|---|
| 61 | # ${CMAKE_INSTALL_PREFIX}/lib/CompuCell3DPlugins |
|---|
| 62 | # DOC "Installation directory for the compucell plugins") |
|---|
| 63 | #IF(NOT COMPUCELL3D_PLUGIN_PATH) |
|---|
| 64 | SET(COMPUCELL3D_PLUGIN_PATH |
|---|
| 65 | /lib/CompuCell3DPlugins) |
|---|
| 66 | #ENDIF(NOT COMPUCELL3D_PLUGIN_PATH) |
|---|
| 67 | |
|---|
| 68 | |
|---|
| 69 | SET(COMPUCELL3D_STEPPABLE_PATH |
|---|
| 70 | /lib/CompuCell3DSteppables) |
|---|
| 71 | |
|---|
| 72 | |
|---|
| 73 | |
|---|
| 74 | # Recurse into subprojects |
|---|
| 75 | ADD_SUBDIRECTORY(BasicUtils) |
|---|
| 76 | ADD_SUBDIRECTORY(PublicUtilities) |
|---|
| 77 | ADD_SUBDIRECTORY(Utils) |
|---|
| 78 | ADD_SUBDIRECTORY(XercesUtils) |
|---|
| 79 | ADD_SUBDIRECTORY(XMLCereal) |
|---|
| 80 | ADD_SUBDIRECTORY(CompuCell3D) |
|---|
| 81 | |
|---|
| 82 | #Adding Player |
|---|
| 83 | ADD_SUBDIRECTORY(CompuCellPlayer) |
|---|
| 84 | |
|---|
| 85 | IF(BUILD_PYINTERFACE) |
|---|
| 86 | ADD_SUBDIRECTORY(pyinterface) |
|---|
| 87 | ENDIF(BUILD_PYINTERFACE) |
|---|
| 88 | |
|---|
| 89 | |
|---|
| 90 | |
|---|
| 91 | |
|---|
| 92 | add_subdirectory(post_install_tasks) |
|---|
| 93 | |
|---|
| 94 | |
|---|
| 95 | |
|---|
| 96 | #writing run scripts |
|---|
| 97 | # SET(COMPUCELL_INSTALL_DIR @CMAKE_INSTALL_PREFIX@) |
|---|
| 98 | # configure_file(${PROJECT_SOURCE_DIR}/run_CompuCellNew.sh.in ${CMAKE_INSTALL_PREFIX}/run_CompuCellNew.sh @ONLY) |
|---|
| 99 | # configure_file(${PROJECT_SOURCE_DIR}/run_CompuCellNew_silent.sh.in ${CMAKE_INSTALL_PREFIX}/run_CompuCellNew_silent.sh @ONLY) |
|---|
| 100 | # configure_file(${PROJECT_SOURCE_DIR}/run_Console.sh.in ${CMAKE_INSTALL_PREFIX}/run_Console.sh @ONLY) |
|---|
| 101 | # |
|---|
| 102 | # #copying example files |
|---|
| 103 | # file(GLOB example_files "@CMAKE_SOURCE_DIR@/examples/*") |
|---|
| 104 | # file(INSTALL DESTINATION "@CMAKE_INSTALL_PREFIX@" TYPE FILE FILES ${example_files}) |
|---|
| 105 | # |
|---|
| 106 | # #copying example_python_tutorial |
|---|
| 107 | # file(GLOB example_files_python_tutorial "@CMAKE_SOURCE_DIR@/examples_PythonTutorial/*") |
|---|
| 108 | # file(INSTALL DESTINATION "@CMAKE_INSTALL_PREFIX@/examples_PythonTutorial" TYPE FILE FILES ${example_files_python_tutorial}) |
|---|
| 109 | # |
|---|
| 110 | # #copying documentation |
|---|
| 111 | # file(GLOB docs_files "@CMAKE_SOURCE_DIR@/docs/*") |
|---|
| 112 | # file(INSTALL DESTINATION "@CMAKE_INSTALL_PREFIX@/docs" TYPE FILE FILES ${docs_files}) |
|---|
| 113 | # |
|---|
| 114 | # #copying xercesc |
|---|
| 115 | # add_custom_target(xercesc_copy ${CMAKE_COMMAND} ARGS -E copy_directory ${CMAKE_SOURCE_DIR}/xercesc ${CMAKE_INSTALL_PREFIX}/xercesc) |
|---|
| 116 | # add_custom_command(TARGET CompuCell3D POST_BUILD COMMAND ${CMAKE_COMMAND} ARGS -E copy_directory ${CMAKE_SOURCE_DIR}/xercesc ${CMAKE_INSTALL_PREFIX}/xercesc) |
|---|
| 117 | # copy_directory(${CMAKE_SOURCE_DIR}/xercesc ${CMAKE_INSTALL_PREFIX}/xercesc) |
|---|
| 118 | |
|---|
| 119 | |
|---|
| 120 | |
|---|
| 121 | |
|---|
| 122 | |
|---|