summaryrefslogtreecommitdiff
path: root/cmake
diff options
context:
space:
mode:
authorAndrej Rode <mail@andrejro.de>2018-09-21 14:37:54 -0700
committerMarcus Müller <marcus@hostalia.de>2018-10-28 13:57:10 +0100
commit4544702fbc21b561345c57ca7c40c4e69cfad22f (patch)
tree48e5857d24851d86003b30feec490a4673c1e619 /cmake
parentf7933bbe3c002a029a83556547d672906ad08189 (diff)
cmake: adhere to the new behaviour of CMP0026 policy
Previously the LOCATION property was used in several places through the tree. The Generator Syntax $<TARGET_FILE:tgt> has to be used now instead. This helps cmake figuring out the right file path.
Diffstat (limited to 'cmake')
-rw-r--r--cmake/Modules/CMakeMacroLibtoolFile.cmake5
-rw-r--r--cmake/Modules/GrTest.cmake10
2 files changed, 5 insertions, 10 deletions
diff --git a/cmake/Modules/CMakeMacroLibtoolFile.cmake b/cmake/Modules/CMakeMacroLibtoolFile.cmake
index 2ec7912077..5e0841716b 100644
--- a/cmake/Modules/CMakeMacroLibtoolFile.cmake
+++ b/cmake/Modules/CMakeMacroLibtoolFile.cmake
@@ -19,7 +19,6 @@ set(__INCLUDED_CREATE_LIBTOOL_FILE TRUE)
ENDMACRO (GET_TARGET_PROPERTY_WITH_DEFAULT)
MACRO(CREATE_LIBTOOL_FILE _target _install_DIR)
- GET_TARGET_PROPERTY(_target_location ${_target} LOCATION)
GET_TARGET_PROPERTY_WITH_DEFAULT(_target_static_lib ${_target} STATIC_LIB "")
GET_TARGET_PROPERTY_WITH_DEFAULT(_target_dependency_libs ${_target} LT_DEPENDENCY_LIBS "")
GET_TARGET_PROPERTY_WITH_DEFAULT(_target_current ${_target} LT_VERSION_CURRENT 0)
@@ -29,8 +28,8 @@ set(__INCLUDED_CREATE_LIBTOOL_FILE TRUE)
GET_TARGET_PROPERTY_WITH_DEFAULT(_target_shouldnotlink ${_target} LT_SHOULDNOTLINK yes)
GET_TARGET_PROPERTY_WITH_DEFAULT(_target_dlopen ${_target} LT_DLOPEN "")
GET_TARGET_PROPERTY_WITH_DEFAULT(_target_dlpreopen ${_target} LT_DLPREOPEN "")
- GET_FILENAME_COMPONENT(_laname ${_target_location} NAME_WE)
- GET_FILENAME_COMPONENT(_soname ${_target_location} NAME)
+ GET_FILENAME_COMPONENT(_laname $<TARGET_FILE:$_target> NAME_WE)
+ GET_FILENAME_COMPONENT(_soname $<TARGET_FILE:$_target> NAME)
SET(_laname ${CMAKE_CURRENT_BINARY_DIR}/${_laname}.la)
FILE(WRITE ${_laname} "# ${_laname} - a libtool library file\n")
FILE(WRITE ${_laname} "# Generated by CMake ${CMAKE_VERSION} (like GNU libtool)\n")
diff --git a/cmake/Modules/GrTest.cmake b/cmake/Modules/GrTest.cmake
index c12601fcc2..3ab88b61e0 100644
--- a/cmake/Modules/GrTest.cmake
+++ b/cmake/Modules/GrTest.cmake
@@ -42,12 +42,9 @@ function(GR_ADD_TEST test_name)
#we must manually set them in the PATH to run tests.
#The following appends the path of a target dependency.
foreach(target ${GR_TEST_TARGET_DEPS})
- get_target_property(location ${target} LOCATION)
- if(location)
- get_filename_component(path ${location} PATH)
- string(REGEX REPLACE "\\$\\(.*\\)" "${CMAKE_BUILD_TYPE}" path "${path}")
- list(APPEND GR_TEST_LIBRARY_DIRS ${path})
- endif(location)
+ get_filename_component(path $<TARGET_FILE:$target> PATH)
+ string(REGEX REPLACE "\\$\\(.*\\)" "${CMAKE_BUILD_TYPE}" path "${path}")
+ list(APPEND GR_TEST_LIBRARY_DIRS ${path})
endforeach(target)
if(WIN32)
@@ -163,4 +160,3 @@ function(GR_ADD_CPP_TEST test_name test_source)
)
GR_ADD_TEST(${test_name} ${test_name})
endfunction(GR_ADD_CPP_TEST)
-