Skip to content

Add example source code for client-side detection of CiftiLib #15

@ghisvail

Description

@ghisvail

Perhaps something that the description in README or USAGE is currently lacking is a code example for discovering and using the library from a client project.

I have used the following snippet in my integration tests:

find_package(PkgConfig)
pkg_check_modules(PC_CIFTI REQUIRED CiftiLib)
add_library(PkgConfig::Cifti INTERFACE IMPORTED)
set_target_properties(PkgConfig::Cifti PROPERTIES
	INTERFACE_INCLUDE_DIRECTORIES "${PC_CIFTI_INCLUDE_DIRS}"
	INTERFACE_LINK_LIBRARIES "${PC_CIFTI_LIBRARIES}"
	INTERFACE_COMPILE_OPTIONS "${PC_CIFTI_CFLAGS_OTHER}")
[...]
add_executable(myexecutable myexecutable.cxx)
target_link_libraries(myexecutable PkgConfig::Cifti)

Feel free to copy or adapt this code if you wish.

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions