FRAT/Library: Difference between revisions

From KitwarePublic
Jump to navigationJump to search
No edit summary
Line 31: Line 31:
= FRAT Library =
= FRAT Library =


In addition to command line executables, FRAT provides a C++ library that can be used in external projects. Since FRAT is currently only available as source code, you must first follow the instructions in the [[FRAT/Install_Guide | Installation Guide]] to build libFrat. Once built, the process for using FRAT in your own CMake project are:
* In your CMakeLists.txt file, find the FRAT project
find_package(FRAT REQUIRED)
if(FRAT_FOUND)
  include(${FRAT_USE_FILE})
else(FRAT_FOUND)
  message(FATAL_ERROR "FRAT not found. Please set FRAT_DIR.")
endif(FRAT_FOUND)
* When building an executable or library that uses FRAT, make sure to link against the libraries in ${FRAT_LIBRARIES}
add_library(bar bar.cxx)
target_link_libraries(bar ${FRAT_LIBRARIES})
add_executable(foo foo.cxx)
target_link_libraries(foo bar ${FRAT_LIBRARIES})
* There is currently no installation system for FRAT, so you will most likely need to manually specify FRAT_DIR when configuring your project with CMake
|-
|-
|}
|}

Revision as of 22:25, 11 August 2011

__NOTITLE__


(F)luid (R)egistration and (A)tlas (T)oolkit


Home




For Users




For Developers




Contact Us

FRAT Library

In addition to command line executables, FRAT provides a C++ library that can be used in external projects. Since FRAT is currently only available as source code, you must first follow the instructions in the Installation Guide to build libFrat. Once built, the process for using FRAT in your own CMake project are:

  • In your CMakeLists.txt file, find the FRAT project
find_package(FRAT REQUIRED)
if(FRAT_FOUND)
  include(${FRAT_USE_FILE})
else(FRAT_FOUND)
  message(FATAL_ERROR "FRAT not found. Please set FRAT_DIR.")
endif(FRAT_FOUND)
  • When building an executable or library that uses FRAT, make sure to link against the libraries in ${FRAT_LIBRARIES}
add_library(bar bar.cxx)
target_link_libraries(bar ${FRAT_LIBRARIES})
add_executable(foo foo.cxx)
target_link_libraries(foo bar ${FRAT_LIBRARIES})
  • There is currently no installation system for FRAT, so you will most likely need to manually specify FRAT_DIR when configuring your project with CMake