Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
13 changes: 11 additions & 2 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -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()
Expand Down Expand Up @@ -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)
17 changes: 17 additions & 0 deletions cmake/clew.pc.in
Original file line number Diff line number Diff line change
@@ -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: