File tree Expand file tree Collapse file tree 1 file changed +13
-0
lines changed Expand file tree Collapse file tree 1 file changed +13
-0
lines changed Original file line number Diff line number Diff line change @@ -552,3 +552,16 @@ target_include_directories("${PROJECT_NAME}" PUBLIC ${OPENLIBM_INCLUDE_DIRS})
552552file (GLOB PUBLIC_HEADERS "*.h" "include/*.h" "${OPENLIBM_ARCH_FOLDER} /*.h" "src/*.h" )
553553set_target_properties ("${PROJECT_NAME} " PROPERTIES PUBLIC_HEADER "${PUBLIC_HEADERS} " )
554554install (TARGETS "${PROJECT_NAME} " )
555+
556+ # Can't use configure_file because openlibm.pc.in uses $var instead of CMake configure @var's
557+ # Would rather string replace variables here instead of editing .pc.in, because editing .pc.in
558+ # might build break autotools build.
559+ file (READ "${PROJECT_SRC} /openlibm.pc.in" PC_FILE)
560+ string (REPLACE "\$ {version}" ${CMAKE_PROJECT_VERSION} PC_FILE ${PC_FILE} )
561+ string (PREPEND PC_FILE "prefix=${CMAKE_INSTALL_PREFIX}
562+ includedir=\$ {prefix}/${CMAKE_INSTALL_INCLUDEDIR}
563+ libdir=\$ {prefix}/${CMAKE_INSTALL_LIBDIR} \n
564+ " )
565+ file (WRITE "${CMAKE_BINARY_DIR} /${PROJECT_NAME} .pc" ${PC_FILE} )
566+ install (FILES "${CMAKE_BINARY_DIR} /${PROJECT_NAME} .pc"
567+ DESTINATION "${CMAKE_INSTALL_LIBDIR} /pkgconfig" )
You can’t perform that action at this time.
0 commit comments