diff --git a/CMakeLists.txt b/CMakeLists.txt index 4a28a5b..8417804 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -1,10 +1,10 @@ -project(clew) +cmake_minimum_required(VERSION 3.1) +project(clew VERSION 0.11 LANGUAGES C CXX) option( BUILD_TESTS "Build test program." ON ) option( BUILD_SHARED_LIBRARY "Shared library, rather than static library." OFF ) option( INSTALL_CL_HEADER "Install cl.h / opencl.h proxy headers to ease compilation of software not aware of CLEW" OFF ) -cmake_minimum_required (VERSION 2.6) if (NOT CMAKE_VERSION VERSION_LESS 2.8.4) cmake_policy (SET CMP0017 NEW) endif() @@ -39,3 +39,12 @@ if( BUILD_TESTS ) add_subdirectory(clewTest) endif( BUILD_TESTS ) +# Generate pkg-config file +configure_file( + "${CMAKE_CURRENT_SOURCE_DIR}/cmake/clew.pc.in" + "${CMAKE_CURRENT_BINARY_DIR}/clew.pc" + @ONLY +) + +install(FILES "${CMAKE_CURRENT_BINARY_DIR}/clew.pc" + DESTINATION lib/pkgconfig) diff --git a/cmake/clew.pc.in b/cmake/clew.pc.in new file mode 100644 index 0000000..2feb751 --- /dev/null +++ b/cmake/clew.pc.in @@ -0,0 +1,17 @@ +prefix=@CMAKE_INSTALL_PREFIX@ +exec_prefix=${prefix} +libdir=${exec_prefix}/lib +includedir=${exec_prefix}/include + +Name: clew +Description: OpenCL Extension Wrangler Library +Version: @PROJECT_VERSION@ + +Requires: +Requires.private: + +Libs: -L${libdir} -lclew +Libs.private: + +Cflags: -I${includedir} +Cflags.private: