* Update and modernize some aspects of CMake
Ease integration with projects targeting more recent CMake versions:
* Update minimum required CMake version to 3.1.
* Specify a version `1.2` to the `project` CMake command, this silences
developer warnings when the OpenCL-ICD-Loader is integrated in another
project using `add_subdirectory`.
* Specify include directory on the `OpenCL` target, this removes the
need to set the OpenCL-Headers include directory globally (old CMake)
or set them manually per target which links the `OpenCL` target
library.
* Update AppVeyor project config
- cmake -DOPENCL_ICD_LOADER_HEADERS_DIR=inc/OpenCL-Headers -H. -Bbuild -A%PLATFORM%
build:
- project: build\OPENCL_ICD_LOADER.sln
+ project: build\OpenCL-ICD-Loader.sln
parallel: true
verbosity: normal
-cmake_minimum_required (VERSION 2.8.11)
+cmake_minimum_required (VERSION 3.1)
-project (OPENCL_ICD_LOADER)
+project (OpenCL-ICD-Loader VERSION 1.2)
include (GNUInstallDirs)
find_package (Threads REQUIRED)
add_library (OpenCL ${OPENCL_ICD_LOADER_SOURCES})
set_target_properties (OpenCL PROPERTIES VERSION "1.2" SOVERSION "1")
+target_include_directories(OpenCL SYSTEM PUBLIC ${OPENCL_ICD_LOADER_HEADERS_DIR})
if (WIN32)
target_link_libraries (OpenCL cfgmgr32.lib runtimeobject.lib)