From a8c68713ca9c024559545de8b50bf7654710bd31 Mon Sep 17 00:00:00 2001 From: Cedric Nugteren Date: Sun, 23 Oct 2016 15:29:27 +0200 Subject: [PATCH] Added support for pkg-config installation on Linux --- CMakeLists.txt | 8 ++++++++ cltune.pc.in | 10 ++++++++++ 2 files changed, 18 insertions(+) create mode 100644 cltune.pc.in diff --git a/CMakeLists.txt b/CMakeLists.txt index 82cc2c8..a54c4d5 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -169,6 +169,14 @@ endif() install(TARGETS cltune DESTINATION lib) install(FILES include/cltune.h DESTINATION include) +# Install pkg-config file on Linux +if(UNIX) + configure_file("${CMAKE_CURRENT_SOURCE_DIR}/cltune.pc.in" + "${CMAKE_CURRENT_BINARY_DIR}/cltune.pc" @ONLY IMMEDIATE) + install(FILES ${CMAKE_CURRENT_BINARY_DIR}/cltune.pc + DESTINATION lib/pkgconfig) +endif() + # ================================================================================================== # Optional: Enables compilation of sample programs diff --git a/cltune.pc.in b/cltune.pc.in new file mode 100644 index 0000000..41dd746 --- /dev/null +++ b/cltune.pc.in @@ -0,0 +1,10 @@ +prefix=@CMAKE_INSTALL_PREFIX@ +exec_prefix=${prefix} +includedir=${prefix}/include +libdir=${exec_prefix}/lib + +Name: CLTune +Description: CLTune: An automatic OpenCL & CUDA kernel tuner +Version: @cltune_VERSION_MAJOR@.@cltune_VERSION_MINOR@.@cltune_VERSION_PATCH@ +Libs: -L${libdir} -lcltune +Cflags: -I${includedir}