![]() ![]() ![]() The packages/build_packages.py script is a potential alternative to the pre-built archives - it's a utility script to help external developers build freesurfer dependencies on their own. In general, the goal is to distance ourselves from distributing the pre-built package tarballs since they are difficult to maintain across multiple platforms. Most find-modules look something like this, where we're only searching for an include directory and one or two libraries. Unfortunately, most freesurfer dependencies don't ship with cmake configuration files, so we have to create our own find-modules. This syntax and the variables generated by find_package() all follow the same general pattern across packages. In this example, if ITK is found by cmake, then ITK_FOUND is set to true, and ITK_INCLUDE_DIR and ITK_LIBRARIES are set accordingly. Some common, modern projects, like Qt, VTK, ITK, Boost, etc., distribute their own cmake config files, so locating the package's include directory and libraries is a fairly straightforward, automatic process:įind_package(ITK HINTS $ REQUIRED) In CMakeLists.txt, packages are located by using the find_package() function. For example, to use a non-default ITK version:Ĭmake. Alternative paths to package installs can also be specified with the _DIR variables. If a package is not found under FS_PACKAGES_DIR, cmake will continue to look through the default search paths. On Martinos machines, this variable automatically defaults to /usr/pubsw/packages, but external developers must provide this path manually:Ĭmake. These find-modules expect each package to be installed under a common path defined by FS_PACKAGES_DIR. Most of the packages required by freesurfer are located via custom "find-modules" stored in the cmake subdirectory. This main script is split into three parts: locating third-party packages, configuring compilation settings, and configuring freesurfer libs and programs. The top-level CMakeLists.txt file is the main cmake configuration script (which replaces setup_configure, configure.in, and Makefile.am), and all subdirectories are added from here with the add_subdirectory() function. configure.in is a massive file, with years worth of additions, so of course, this isn't a 100% conversion, but it satisfies all the requirements for building and installing a full (default) freesurfer distribution on centos and OSX. ![]() General documentation for using cmake with freesurfer can be found here. This page is mostly for documenting the process of converting the automake framework to cmake. ![]()
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |