Skip to content

Commit

Permalink
README.md: Removed versioning constraint from pkg-config example...
Browse files Browse the repository at this point in the history
CMakeLists.txt: Cosmetic changes...
  • Loading branch information
kiplingw committed Jul 13, 2021
1 parent 2f10af3 commit 41f97cf
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 11 deletions.
20 changes: 11 additions & 9 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -827,7 +827,7 @@ IF(CPUINFO_SUPPORTED_PLATFORM AND CPUINFO_BUILD_TOOLS)
ENDIF()

# ---[ pkg-config manifest. This is mostly from JsonCpp...
if(CPUINFO_BUILD_PKG_CONFIG)
IF(CPUINFO_BUILD_PKG_CONFIG)

FUNCTION(JOIN_PATHS joined_path first_path_segment)
SET(temp_path "${first_path_segment}")
Expand All @@ -843,14 +843,16 @@ if(CPUINFO_BUILD_PKG_CONFIG)
SET(${joined_path} "${temp_path}" PARENT_SCOPE)
ENDFUNCTION()

JOIN_PATHS(libdir_for_pc_file "\${exec_prefix}" "${CMAKE_INSTALL_LIBDIR}")
JOIN_PATHS(includedir_for_pc_file "\${prefix}" "${CMAKE_INSTALL_INCLUDEDIR}")
JOIN_PATHS(libdir_for_pc_file "\${exec_prefix}" "${CMAKE_INSTALL_LIBDIR}")
JOIN_PATHS(includedir_for_pc_file "\${prefix}" "${CMAKE_INSTALL_INCLUDEDIR}")

configure_file(
"libcpuinfo.pc.in"
"libcpuinfo.pc"
@ONLY)
install(FILES "${CMAKE_CURRENT_BINARY_DIR}/libcpuinfo.pc"
CONFIGURE_FILE(
"libcpuinfo.pc.in"
"libcpuinfo.pc"
@ONLY)

INSTALL(FILES "${CMAKE_CURRENT_BINARY_DIR}/libcpuinfo.pc"
DESTINATION "${CMAKE_INSTALL_LIBDIR}/pkgconfig")
endif()

ENDIF()

4 changes: 2 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -127,8 +127,8 @@ To [use](https://autotools.io/pkgconfig/pkg_check_modules.html) with the GNU Aut
```makefile
# CPU INFOrmation library...
PKG_CHECK_MODULES(
[libcpuinfo], [libcpuinfo >= 0.1], [],
[AC_MSG_ERROR([libcpuinfo >= 0.1 missing...])])
[libcpuinfo], [libcpuinfo], [],
[AC_MSG_ERROR([libcpuinfo missing...])])
YOURPROJECT_CXXFLAGS="$YOURPROJECT_CXXFLAGS $libcpuinfo_CFLAGS"
YOURPROJECT_LIBS="$YOURPROJECT_LIBS $libcpuinfo_LIBS"
```
Expand Down

0 comments on commit 41f97cf

Please sign in to comment.