Skip to content
Snippets Groups Projects
Commit c76bab3c authored by Adrian Herrera's avatar Adrian Herrera
Browse files

Added ability to auto generate and install a keystone.pc file

This is required for when I get around to writing some Haskell bindings :-)
parent 595792eb
No related branches found
No related tags found
No related merge requests found
......@@ -2,6 +2,7 @@
# By Nguyen Anh Quynh, 2016
cmake_minimum_required(VERSION 2.8.7)
project(keystone)
set(KEYSTONE_VERSION_MAJOR 0)
set(KEYSTONE_VERSION_MINOR 9)
......@@ -46,6 +47,30 @@ else()
add_subdirectory(kstool)
endif()
# generate and install pkg-config.pc
FIND_PACKAGE(PkgConfig)
SET(PKG_CONFIG_FILE_PATH
"${CMAKE_CURRENT_BINARY_DIR}/${PROJECT_NAME}.pc"
)
SET(PKG_CONFIG_LIBDIR
"${CMAKE_INSTALL_PREFIX}/lib"
)
SET(PKG_CONFIG_INCLUDEDIR
"${CMAKE_INSTALL_PREFIX}/include"
)
SET(PKG_CONFIG_LIBS
"-L\${libdir} -lkeystone"
)
SET(PKG_CONFIG_CFLAGS
"-I\${includedir}"
)
CONFIGURE_FILE(
"${CMAKE_CURRENT_SOURCE_DIR}/pkg-config.pc.cmake"
"${PKG_CONFIG_FILE_PATH}"
)
INSTALL(FILES "${PKG_CONFIG_FILE_PATH}"
DESTINATION lib/pkgconfig)
# uninstall target
configure_file(
"${CMAKE_CURRENT_SOURCE_DIR}/CMakeUninstall.in"
......
Name: ${PROJECT_NAME}
Description: Keystone assembler engine
Version: ${KEYSTONE_VERSION_MAJOR}.${KEYSTONE_VERSION_MINOR}
libdir=${PKG_CONFIG_LIBDIR}
includedir=${PKG_CONFIG_INCLUDEDIR}
Libs: ${PKG_CONFIG_LIBS}
Cflags: ${PKG_CONFIG_CFLAGS}
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment