Commit | Line | Data |
---|---|---|
80f575fc DM |
1 | # |
2 | # Write a pkg-config pc file for given "name" with "decription" | |
3 | # Arguments: | |
4 | # name: a library name (without "lib" prefix and "so" suffixes | |
5 | # desc: a desription string | |
6 | # | |
7 | macro (create_pkgconfig_file name desc) | |
8 | set(_pkgfname "${CMAKE_CURRENT_BINARY_DIR}/${name}.pc") | |
9 | message(STATUS "${name}: writing pkgconfig file ${_pkgfname}") | |
10 | ||
11 | file(WRITE "${_pkgfname}" "# file generated by vid.stab cmake build | |
12 | prefix=${CMAKE_INSTALL_PREFIX} | |
13 | libdir=\${prefix}/lib${LIB_SUFFIX} | |
14 | includedir=\${prefix}/include | |
15 | ||
16 | Name: ${name} | |
17 | Description: ${desc} | |
18 | Version: ${VIDSTAB_VERSION} | |
19 | Libs: -L\${libdir} -l${name} | |
20 | Cflags: -I\${includedir} | |
21 | ||
22 | ") | |
23 | ||
24 | install(FILES ${_pkgfname} DESTINATION lib${LIB_SUFFIX}/pkgconfig) | |
25 | endmacro() |