Use IN_LIST operator in dew.cmake
This commit is contained in:
parent
7d3cd9c385
commit
47db944e6e
17
dew.cmake
17
dew.cmake
|
@ -7,7 +7,8 @@
|
||||||
# It is encouraged to check this file into your project's VCS. Doing so will allow your cmake project to easily
|
# It is encouraged to check this file into your project's VCS. Doing so will allow your cmake project to easily
|
||||||
# integrate with Dew.
|
# integrate with Dew.
|
||||||
#
|
#
|
||||||
cmake_minimum_required(VERSION 3.2)
|
cmake_minimum_required(VERSION 3.3)
|
||||||
|
cmake_policy(SET CMP0057 NEW) # IN_LIST operator
|
||||||
|
|
||||||
function(integrate_dew)
|
function(integrate_dew)
|
||||||
#
|
#
|
||||||
|
@ -73,33 +74,27 @@ function(integrate_dew)
|
||||||
# Check if we have already added the dew directory to CMAKE_PREFIX_PATH
|
# Check if we have already added the dew directory to CMAKE_PREFIX_PATH
|
||||||
#
|
#
|
||||||
set(needs_new_prefix TRUE)
|
set(needs_new_prefix TRUE)
|
||||||
foreach (path ${CMAKE_PREFIX_PATH})
|
if ("${dew_cmake_prefix_path}" IN_LIST CMAKE_PREFIX_PATH)
|
||||||
if (path STREQUAL "${dew_cmake_prefix_path}")
|
|
||||||
set(needs_new_prefix FALSE)
|
set(needs_new_prefix FALSE)
|
||||||
break()
|
|
||||||
endif()
|
endif()
|
||||||
endforeach()
|
|
||||||
|
|
||||||
#
|
#
|
||||||
# Check if we have already added the dew cmake module directory to CMAKE_MODULE_PATH
|
# Check if we have already added the dew cmake module directory to CMAKE_MODULE_PATH
|
||||||
#
|
#
|
||||||
set(needs_new_module_path TRUE)
|
set(needs_new_module_path TRUE)
|
||||||
foreach (path ${CMAKE_MODULE_PATH})
|
if ("${dew_cmake_module_path}" IN_LIST CMAKE_MODULE_PATH)
|
||||||
if (path STREQUAL "${dew_cmake_module_path}")
|
|
||||||
set(needs_new_module_path FALSE)
|
set(needs_new_module_path FALSE)
|
||||||
break()
|
|
||||||
endif()
|
endif()
|
||||||
endforeach()
|
|
||||||
|
|
||||||
#
|
#
|
||||||
# Add dew directory to CMAKE_PREFIX_PATH if necesary
|
# Add dew directory to CMAKE_PREFIX_PATH if necessary
|
||||||
#
|
#
|
||||||
if ("${needs_new_prefix}")
|
if ("${needs_new_prefix}")
|
||||||
set(CMAKE_PREFIX_PATH ${CMAKE_PREFIX_PATH} "${dew_cmake_prefix_path}" CACHE PATH "" FORCE)
|
set(CMAKE_PREFIX_PATH ${CMAKE_PREFIX_PATH} "${dew_cmake_prefix_path}" CACHE PATH "" FORCE)
|
||||||
endif()
|
endif()
|
||||||
|
|
||||||
#
|
#
|
||||||
# Add dew cmake module directory to CMAKE_MODULE_PATH if necesary
|
# Add dew cmake module directory to CMAKE_MODULE_PATH if necessary
|
||||||
#
|
#
|
||||||
if ("${needs_new_module_path}")
|
if ("${needs_new_module_path}")
|
||||||
set(CMAKE_MODULE_PATH ${CMAKE_MODULE_PATH} "${dew_cmake_module_path}" CACHE PATH "" FORCE)
|
set(CMAKE_MODULE_PATH ${CMAKE_MODULE_PATH} "${dew_cmake_module_path}" CACHE PATH "" FORCE)
|
||||||
|
|
Loading…
Reference in New Issue