Skip to content

Commit 40e8559

Browse files
author
Alexander Damian
committed
Remove warning for cmake policy CMP0074
1 parent d20cab6 commit 40e8559

File tree

1 file changed

+8
-3
lines changed

1 file changed

+8
-3
lines changed

CMakeLists.txt

Lines changed: 8 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,9 @@
11
cmake_minimum_required(VERSION 3.9.2)
22
project(CppKafka)
3-
4-
#Allows using '<Package>_ROOT' to point to a package install dir. After CMake v3.14 this becomes default behavior.
5-
#cmake_policy(SET CMP0074 NEW)
3+
if (${CMAKE_VERSION} VERSION_GREATER_EQUAL "3.12.0")
4+
# Use <package>_ROOT variable to find configuration files
5+
cmake_policy(SET CMP0074 NEW)
6+
endif()
67

78
include(GNUInstallDirs)
89
include(CMakePackageConfigHelpers)
@@ -47,6 +48,10 @@ option(CPPKAFKA_RDKAFKA_STATIC_LIB "Link with Rdkafka static library." OFF)
4748
# Add FindRdKafka.cmake
4849
set(CMAKE_MODULE_PATH ${CMAKE_MODULE_PATH} "${CMAKE_CURRENT_SOURCE_DIR}/cmake/")
4950

51+
if (NOT CPPKAFKA_CONFIG_DIR)
52+
set(CPPKAFKA_CONFIG_DIR lib/cmake/${PROJECT_NAME})
53+
endif()
54+
5055
# Maintain previous compatibility
5156
if (RDKAFKA_ROOT_DIR)
5257
set(RdKafka_ROOT ${RDKAFKA_ROOT_DIR})

0 commit comments

Comments
 (0)