Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

CMake changes: Long double/double size detection, Android x86 and armv7 support, install pkg-config pc file #304

Merged
Merged
Prev Previous commit
Next Next commit
Generate pkg-config.pc file in CMake
  • Loading branch information
ViliusSutkus89 committed Jun 21, 2024
commit 3335ebc9d8cd8f9921226ff4b03727449f399502
13 changes: 13 additions & 0 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -552,3 +552,16 @@ target_include_directories("${PROJECT_NAME}" PUBLIC ${OPENLIBM_INCLUDE_DIRS})
file(GLOB PUBLIC_HEADERS "*.h" "include/*.h" "${OPENLIBM_ARCH_FOLDER}/*.h" "src/*.h")
set_target_properties("${PROJECT_NAME}" PROPERTIES PUBLIC_HEADER "${PUBLIC_HEADERS}")
install (TARGETS "${PROJECT_NAME}")

# Can't use configure_file because openlibm.pc.in uses $var instead of CMake configure @var's
# Would rather string replace variables here instead of editing .pc.in, because editing .pc.in
# might build break autotools build.
file(READ "${PROJECT_SRC}/openlibm.pc.in" PC_FILE)
string(REPLACE "\${version}" ${CMAKE_PROJECT_VERSION} PC_FILE ${PC_FILE})
string(PREPEND PC_FILE "prefix=${CMAKE_INSTALL_PREFIX}
includedir=\${prefix}/${CMAKE_INSTALL_INCLUDEDIR}
libdir=\${prefix}/${CMAKE_INSTALL_LIBDIR}\n
")
file(WRITE "${CMAKE_BINARY_DIR}/${PROJECT_NAME}.pc" ${PC_FILE})
install(FILES "${CMAKE_BINARY_DIR}/${PROJECT_NAME}.pc"
DESTINATION "${CMAKE_INSTALL_LIBDIR}/pkgconfig")
Loading