BASIS  version 1.2.3 (revision 2104)
BASISDirectories.cmake
Go to the documentation of this file.
00001 ##############################################################################
00002 # @file  BASISDirectories.cmake
00003 # @brief CMake variables of project directories.
00004 #
00005 # @note The file BASISDirectories.cmake is automatically generated by
00006 #       BASIS from the template file Directories.cmake.in which is part of the
00007 #       BASIS installation. See @ref FilesystemHierarchyStandard.
00008 #
00009 # The project must follow the directory structure as defined by the
00010 # <tt>PROJECT_&lt;*&gt;_DIR</tt> variables.
00011 #
00012 # Ideally, when changing the name of one of these directories, only the
00013 # directory structure of the template needs to be updated. The BASIS CMake
00014 # functions should not be required to change as they are supposed to use these
00015 # variables instead of the actual names. Any change of the project directory
00016 # structure has to be made with care, however, and backwards compatibility to
00017 # previous releases of BASIS shall be maintained. Consider the use of the
00018 # @c TEMPLATE_VERSION if required.
00019 #
00020 # If this project is a module and modules shall reside in the same namespace
00021 # as the top-level project (i.e., @c BASIS_USE_MODULE_NAMESPACES is @c OFF),
00022 # the directories are the same for all modules except of the
00023 # <tt>PROJECT_&lt;*&gt;_DIR</tt> variables, which refer to the source tree of
00024 # the current module. Otherwise, the modules add their name to the paths such
00025 # that the files of the modules are separated by subdirectories.
00026 #
00027 # Copyright (c) 2011, 2012 University of Pennsylvania. All rights reserved.<br />
00028 # See https://www.cbica.upenn.edu/sbia/software/license.html or COPYING file.
00029 #
00030 # Contact: SBIA Group <sbia-software at uphs.upenn.edu>
00031 ##############################################################################
00032 
00033 ## @addtogroup BasisDirectories
00034 #  @{
00035 
00036 
00037 # ============================================================================
00038 # source tree
00039 # ============================================================================
00040 
00041 ## @brief Absolute path of directory of project sources in source tree.
00042 set (PROJECT_CODE_DIR "/sbia/home/schuha/projects/basis-1.2.3/src")
00043 ## @brief Absolute path of directory of BASIS project configuration in source tree.
00044 set (PROJECT_CONFIG_DIR "/sbia/home/schuha/projects/basis-1.2.3/config")
00045 ## @brief Absolute path of directory of auxiliary data in source tree.
00046 set (PROJECT_DATA_DIR "/sbia/home/schuha/projects/basis-1.2.3/data")
00047 ## @brief Absolute path of directory of documentation files in source tree.
00048 set (PROJECT_DOC_DIR "/sbia/home/schuha/projects/basis-1.2.3/doc")
00049 ## @brief Absolute path of directory of example in source tree.
00050 set (PROJECT_EXAMPLE_DIR "/sbia/home/schuha/projects/basis-1.2.3/example")
00051 ## @brief Absolute path of diretory of public header files in source tree.
00052 set (PROJECT_INCLUDE_DIR "/sbia/home/schuha/projects/basis-1.2.3/include")
00053 ## @brief Absolute path of directory of project modules.
00054 set (PROJECT_MODULES_DIR "/sbia/home/schuha/projects/basis-1.2.3/modules")
00055 ## @brief Absolute path of directory of testing tree in source tree.
00056 set (PROJECT_TESTING_DIR "/sbia/home/schuha/projects/basis-1.2.3/test")
00057 
00058 ## @brief Absolute path of root directory of source tree of top-level project.
00059 if (NOT PROJECT_IS_MODULE)
00060   set (BASIS_PROJECT_SOURCE_DIR "${PROJECT_SOURCE_DIR}")
00061 endif ()
00062 
00063 # ============================================================================
00064 # testing tree
00065 # ============================================================================
00066 
00067 ## @brief Absolute path of output directory for tests.
00068 basis_set_if_empty (TESTING_OUTPUT_DIR "/sbia/home/schuha/sandbox/build/basis-1.2.3/Testing/Temporary")
00069 ## @brief Absolute path of output directory for built test executables.
00070 basis_set_if_empty (TESTING_RUNTIME_DIR "/sbia/home/schuha/sandbox/build/basis-1.2.3/Testing/bin")
00071 ## @brief Absolute path of output directory for auxiliary executables used by tests.
00072 basis_set_if_empty (TESTING_LIBEXEC_DIR "/sbia/home/schuha/sandbox/build/basis-1.2.3/Testing/lib")
00073 ## @brief Absolute path of output directory for testing libraries.
00074 basis_set_if_empty (TESTING_LIBRARY_DIR "/sbia/home/schuha/sandbox/build/basis-1.2.3/Testing/lib")
00075 ## @brief Absolute path of output directory for Python modules used for testing.
00076 basis_set_if_empty (TESTING_PYTHON_LIBRARY_DIR "/sbia/home/schuha/sandbox/build/basis-1.2.3/Testing/lib/python")
00077 ## @brief Absolute path of output directory for Perl modules used for testing.
00078 basis_set_if_empty (TESTING_PERL_LIBRARY_DIR "/sbia/home/schuha/sandbox/build/basis-1.2.3/Testing/lib/perl5")
00079 
00080 if (PROJECT_IS_MODULE AND BASIS_USE_MODULE_NAMESPACES)
00081   # Note that Python and Perl modules use their own internal package
00082   # hierarchy. The top-level directory which is added to the search path
00083   # for such modules does not have to be changed here.
00084   foreach (D IN ITEMS OUTPUT RUNTIME LIBRARY)
00085     set (TESTING_${D}_DIR "${TESTING_${D}_DIR}/basis")
00086   endforeach ()
00087 endif ()
00088 
00089 # ============================================================================
00090 # build tree
00091 # ============================================================================
00092 
00093 # set directories corresponding to the source tree directories
00094 foreach (P CODE CONFIG DATA DOC EXAMPLE MODULES TESTING)
00095   basis_get_relative_path (D "${PROJECT_SOURCE_DIR}" "${PROJECT_${P}_DIR}")
00096   set (BINARY_${P}_DIR "${PROJECT_BINARY_DIR}/${D}")
00097 endforeach ()
00098 
00099 # Directory for configured public header files is the same for the top-level
00100 # project and its modules. The proper subdirectories are created by the
00101 # function basis_configure_public_headers().
00102 if (NOT PROJECT_IS_MODULE)
00103   basis_get_relative_path (D "${PROJECT_SOURCE_DIR}" "${PROJECT_INCLUDE_DIR}")
00104   set (BINARY_INCLUDE_DIR "${PROJECT_BINARY_DIR}/${D}")
00105 endif ()
00106 
00107 ## @brief Absolute path of output directory for main executables.
00108 basis_set_if_empty (BINARY_RUNTIME_DIR "/sbia/home/schuha/sandbox/build/basis-1.2.3/bin")
00109 ## @brief Absolute path of output directory for auxiliary executables.
00110 basis_set_if_empty (BINARY_LIBEXEC_DIR "/sbia/home/schuha/sandbox/build/basis-1.2.3/lib")
00111 ## @brief Absolute path of output directory for shared libraries and modules.
00112 basis_set_if_empty (BINARY_LIBRARY_DIR "/sbia/home/schuha/sandbox/build/basis-1.2.3/lib")
00113 ## @brief Absolute path of output directory for static and import libraries.
00114 basis_set_if_empty (BINARY_ARCHIVE_DIR "/sbia/home/schuha/sandbox/build/basis-1.2.3/lib")
00115 ## @brief Absolute path of output directory for Python modules.
00116 basis_set_if_empty (BINARY_PYTHON_LIBRARY_DIR "/sbia/home/schuha/sandbox/build/basis-1.2.3/lib/python")
00117 ## @brief Absolute path of output directory for Perl modules.
00118 basis_set_if_empty (BINARY_PERL_LIBRARY_DIR "/sbia/home/schuha/sandbox/build/basis-1.2.3/lib/perl5")
00119 
00120 if (PROJECT_IS_MODULE AND BASIS_USE_MODULE_NAMESPACES)
00121   # Note that Python and Perl modules use their own internal package
00122   # hierarchy. The top-level directory which is added to the search path
00123   # for such modules does not have to be changed here.
00124   foreach (D IN ITEMS RUNTIME LIBEXEC LIBRARY ARCHIVE)
00125     set (BINARY_${D}_DIR "${BINARY_${D}_DIR}/basis")
00126   endforeach ()
00127 endif ()
00128 
00129 # set default CMake variable which are, however, not used by BASIS
00130 set (CMAKE_RUNTIME_OUTPUT_DIRECTORY "${BINARY_RUNTIME_DIR}")
00131 set (CMAKE_LIBRARY_OUTPUT_DIRECTORY "${BINARY_LIBRARY_DIR}")
00132 set (CMAKE_ARCHIVE_OUTPUT_DIRECTORY "${BINARY_ARCHIVE_DIR}")
00133 
00134 ## @brief Absolute path of root directory of build tree of top-level project.
00135 if (NOT PROJECT_IS_MODULE)
00136   set (BASIS_PROJECT_BINARY_DIR "${PROJECT_BINARY_DIR}")
00137 endif ()
00138 
00139 # ============================================================================
00140 # install tree
00141 # ============================================================================
00142 
00143 # Attention: In order for CPack to work correctly, the destination paths have
00144 #            to be given relative to CMAKE_INSTALL_PREFIX. Therefore, this
00145 #            prefix must be excluded from the following paths!
00146 
00147 # ----------------------------------------------------------------------------
00148 # prefix
00149 
00150 # C:/Program Files/Project -> C:/Program Files/SBIA
00151 string (
00152   REGEX REPLACE
00153     "/Project$"
00154     "/SBIA"
00155   CMAKE_INSTALL_PREFIX
00156     "${CMAKE_INSTALL_PREFIX}"
00157 )
00158 
00159 ## @brief Installation prefix.
00160 set (
00161   INSTALL_PREFIX
00162     "${CMAKE_INSTALL_PREFIX}"
00163   CACHE PATH
00164     "Prefix used for installation paths."
00165 )
00166 
00167 set (CMAKE_INSTALL_PREFIX "${INSTALL_PREFIX}" CACHE INTERNAL "" FORCE)
00168 
00169 # ----------------------------------------------------------------------------
00170 # infix
00171 
00172 ## @brief Whether to use installation sinfix.
00173 option (INSTALL_SINFIX "Whether to use the package-specific installation path suffix/infix." ON)
00174 
00175 ## @brief Installation sinfix.
00176 if (UNIX)
00177   set (
00178     BASIS_INSTALL_SINFIX
00179       "sbia/basis"
00180     CACHE STRING
00181       "Suffix/Infix used for installation paths."
00182   )
00183 else ()
00184   set (
00185     BASIS_INSTALL_SINFIX
00186       "basis"
00187     CACHE STRING
00188       "Suffix/Infix used for installation paths."
00189   )
00190 endif ()
00191 mark_as_advanced (BASIS_INSTALL_SINFIX)
00192 
00193 if (INSTALL_SINFIX)
00194   set_property (CACHE BASIS_INSTALL_SINFIX PROPERTY TYPE STRING)
00195 else ()
00196   set_property (CACHE BASIS_INSTALL_SINFIX PROPERTY TYPE INTERNAL)
00197 endif ()
00198 
00199 # ----------------------------------------------------------------------------
00200 # package configuration
00201 
00202 # Note: CMake's find_package() command considers certain directories.
00203 #       Hence, the variable BASIS_INSTALL_SINFIX which may not comply to
00204 #       the naming of standard locations considered by this command cannot
00205 #       be used here, but a name depending on this package's name must be used.
00206 
00207 ## @brief Path of installation directory for CMake package configuration
00208 #         files relative to @c INSTALL_PREFIX.
00209 #
00210 # Install configuration files of modules in subdirectories such that
00211 # CMake does not find them by default. Their might be a case that
00212 # someone is using two projects where the one project is named just
00213 # the same as the module of the other project. The configuration file
00214 # of the module is anyway supposed to be included by the package
00215 # configuration file if this module is requested by the COMPONENTS
00216 # argument to the find_package() command.
00217 if (NOT PROJECT_IS_MODULE)
00218   if (UNIX)
00219     set (INSTALL_CONFIG_DIR "lib/cmake/basis")
00220   else ()
00221     set (INSTALL_CONFIG_DIR "cmake")
00222   endif ()
00223 else ()
00224   set (INSTALL_CONFIG_DIR "${INSTALL_CONFIG_DIR}/basis")
00225 endif ()
00226 
00227 # ----------------------------------------------------------------------------
00228 # executables
00229 
00230 ## @brief Path of installation directory for runtime executables and shared
00231 #         libraries on Windows relative to @c INSTALL_PREFIX.
00232 set (INSTALL_RUNTIME_DIR "bin")
00233 
00234 ## @brief Path of installation directory for auxiliary executables
00235 #         relative to @c INSTALL_PREFIX.
00236 if (WIN32)
00237   set (INSTALL_LIBEXEC_DIR "bin")
00238 else ()
00239   set (INSTALL_LIBEXEC_DIR "lib")
00240 endif ()
00241 
00242 # prepend installation sinfix
00243 if (INSTALL_SINFIX)
00244   foreach (P RUNTIME LIBEXEC)
00245     set (VAR "INSTALL_${P}_DIR")
00246     set (${VAR} "${${VAR}}/${BASIS_INSTALL_SINFIX}")
00247   endforeach ()
00248 endif ()
00249 
00250 # prepend module name
00251 if (PROJECT_IS_MODULE AND BASIS_USE_MODULE_NAMESPACES)
00252   foreach (P RUNTIME LIBEXEC)
00253     set (VAR "INSTALL_${P}_DIR")
00254     set (${VAR} "${${VAR}}/basis")
00255   endforeach ()
00256 endif ()
00257 
00258 # ----------------------------------------------------------------------------
00259 # libraries
00260 
00261 ## @brief Path of installation directory for public header files
00262 #         relative to @c INSTALL_PREFIX.
00263 #
00264 # @note If the @c INCLUDE_PREFIX specifies subdirectories, these will be
00265 #       created underneath this directory during the installation.
00266 set (INSTALL_INCLUDE_DIR "include")
00267 
00268 ## @brief Path of installation directory for shared libraries on Unix-based
00269 #         systems and module libraries relative to @c INSTALL_PREFIX.
00270 set (INSTALL_LIBRARY_DIR "lib")
00271 
00272 ## @brief Path of installation directory for static and import libraries
00273 #         relative to @c INSTALL_PREFIX.
00274 set (INSTALL_ARCHIVE_DIR "lib")
00275 
00276 # prepend installation sinfix
00277 if (INSTALL_SINFIX)
00278   foreach (P LIBRARY ARCHIVE)
00279     set (VAR "INSTALL_${P}_DIR")
00280     set (${VAR} "${${VAR}}/${BASIS_INSTALL_SINFIX}")
00281   endforeach ()
00282 endif ()
00283 
00284 # prepend module name
00285 if (PROJECT_IS_MODULE AND BASIS_USE_MODULE_NAMESPACES)
00286   # Note that the INSTALL_INCLUDE_DIR is the same for top-level project
00287   # and modules. The subdirectory structure within this directory is
00288   # created by the function basis_configure_public_headers().
00289   foreach (P LIBRARY ARCHIVE)
00290     set (VAR "INSTALL_${P}_DIR")
00291     set (${VAR} "${${VAR}}/basis")
00292   endforeach ()
00293 endif ()
00294 
00295 # ----------------------------------------------------------------------------
00296 # script modules
00297 
00298 # Similar to the public header files of C/C++ libraries, the modules written
00299 # in Python or Perl are installed with fixed relative directories which
00300 # correspond to the packages these modules belong to:
00301 #
00302 # Python: sbia.<project>
00303 # Perl:   SBIA::<Project>
00304 #
00305 # As here the project name is already part of the file path and has to
00306 # remain fixed, otherwise the modules would not know how to refer to each
00307 # other in the source code, the variable BASIS_INSTALL_SINFIX as well as
00308 # BASIS_USE_MODULE_NAMESPACES are not considered here. Instead, the
00309 # functions basis_add_script() and basis_add_script_finalize() make sure
00310 # that the modules are installed as part of the right packages.
00311 
00312 ## @brief Path of installation directory for Python modules relative to @c INSTALL_PREFIX.
00313 set (INSTALL_PYTHON_LIBRARY_DIR "lib/python")
00314 
00315 ## @brief Path of installation directory for Perl modules relative to @c INSTALL_PREFIX.
00316 set (INSTALL_PERL_LIBRARY_DIR "lib/perl5")
00317 
00318 # ----------------------------------------------------------------------------
00319 # shared data
00320 
00321 ## @brief Path of installation directory for shared files
00322 #         relative to @c INSTALL_PREFIX.
00323 set (INSTALL_SHARE_DIR "share")
00324 
00325 # prepend installation sinfix
00326 if (INSTALL_SINFIX)
00327   set (INSTALL_SHARE_DIR "${INSTALL_SHARE_DIR}/${BASIS_INSTALL_SINFIX}")
00328 endif ()
00329 
00330 ## @brief Path of installation directory for shared data files
00331 #         relative to @c INSTALL_PREFIX.
00332 set (INSTALL_DATA_DIR "${INSTALL_SHARE_DIR}/data")
00333 
00334 # prepend module name
00335 if (PROJECT_IS_MODULE AND BASIS_USE_MODULE_NAMESPACES)
00336   set (INSTALL_DATA_DIR "${INSTALL_DATA_DIR}/basis")
00337 endif ()
00338 
00339 # ----------------------------------------------------------------------------
00340 # documentation
00341 
00342 ## @brief Path of installation directory for documentation files
00343 #         relative to @c INSTALL_PREFIX.
00344 if (UNIX)
00345   set (INSTALL_DOC_DIR "${INSTALL_SHARE_DIR}/doc")
00346 else ()
00347   set (INSTALL_DOC_DIR "doc")
00348 endif ()
00349 
00350 ## @brief Path of installation directory for example files
00351 #         relative to @c INSTALL_PREFIX.
00352 if (UNIX)
00353   set (INSTALL_EXAMPLE_DIR "${INSTALL_SHARE_DIR}/example")
00354 else ()
00355   set (INSTALL_EXAMPLE_DIR "example")
00356 endif ()
00357 
00358 ## @brief Path of installation directory for man pages
00359 #         relative to @c INSTALL_PREFIX.
00360 if (UNIX)
00361   set (INSTALL_MAN_DIR "${INSTALL_SHARE_DIR}/man")
00362 else ()
00363   set (INSTALL_MAN_DIR "man")
00364 endif ()
00365 
00366 # prepend installation sinfix
00367 if (WIN32 AND INSTALL_SINFIX)
00368   foreach (P DOC EXAMPLE MAN)
00369     set (VAR "INSTALL_${P}_DIR")
00370     set (${VAR} "${${VAR}}/${BASIS_INSTALL_SINFIX}")
00371   endforeach ()
00372 endif ()
00373 
00374 # prepend module name
00375 if (PROJECT_IS_MODULE AND BASIS_USE_MODULE_NAMESPACES)
00376   foreach (P DOC EXAMPLE MAN)
00377     set (VAR "INSTALL_${P}_DIR")
00378     set (${VAR} "${${VAR}}/basis")
00379   endforeach ()
00380 endif ()
00381 
00382 
00383 ## @}
00384 # end of Doxygen group