Skip to content

Commit 0bfd15d

Browse files
committed
pkg-config: use PROJECT_NAME instead of CMAKE_PROJECT_NAME
[`PROJECT_NAME`][1] refers to the most recent `project()` call, while [`CMAKE_PROJECT_NAME`][2] refers to the top-most `project()` call. In the cases where cpuinfo is installed as a standalone project, this is perfectly fine and works as intended where the installed pkg-config file contains libcpuinfo as the name. However, if cpuinfo is used as a subproject, such as when using FetchContent, the name of the calling project would be used instead, leading to something like libOuterProject rather than libcpuinfo. [1]: https://cmake.org/cmake/help/latest/variable/PROJECT_NAME.html#variable:PROJECT_NAME [2]: https://cmake.org/cmake/help/latest/variable/CMAKE_PROJECT_NAME.html#variable:CMAKE_PROJECT_NAME Signed-off-by: Christopher Degawa <[email protected]>
1 parent aaac07e commit 0bfd15d

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

libcpuinfo.pc.in

+1-1
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@ exec_prefix=@CMAKE_INSTALL_PREFIX@
33
libdir=@libdir_for_pc_file@
44
includedir=@includedir_for_pc_file@
55

6-
Name: lib@CMAKE_PROJECT_NAME@
6+
Name: lib@PROJECT_NAME@
77
Description: Library to detect essential performance optimization information about host CPU.
88
Version:
99
URL: @PROJECT_HOMEPAGE_URL@

0 commit comments

Comments
 (0)