4/19/2023 0 Comments Cmake project![]() ![]() The cmake documentation can be consultated as your project becomes more complex. This can be used as a template to get started. For simplicity, only one CMakeLists.txt file and one source file is used. The OPENBABEL2_LIBRARIES variable can be used directly in your target_link_libraries command.īelow is a minimal but working example of a project. Since find_package only sets variables, you still need to call include_directories with OPENBABEL2_INCLUDE_DIR in the argument list. ![]() If openbabel is optional, the first variable can be used in your cmake logic to optionally build the additional code. The find_package command allows you to specify the package is required and cmake will handle this further. Next, calling find_package will execute the module to find openbabel and set 3 variables. This path must be specified by setting the CMAKE_MODULE_PATH variable. This file is usually placed in the cmake/modules directory of your project. For example, the default filename for the openbabel module is FindOpenBabel2.cmake. The filename of modules to find packages must start with Find. ![]() A module to find openbabel is included in the release or can be copied below. CMake provides modules to find a large number of modules to find common dependencies. ![]()
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |