1
0
Fork 0

Convert obsolete uses of get_filename_component(<var> <FileName> PATH)

In the context of get_filename_component(), PATH is a legacy alias for
DIRECTORY. Replace it with DIRECTORY, which is recommended[1] for
CMake versions > 2.8.11.

[1] https://cmake.org/cmake/help/latest/command/get_filename_component.html
This commit is contained in:
Florent Rougon 2019-04-25 19:03:23 +02:00
parent b2d6acdd4d
commit 63f6d0b5bf
2 changed files with 5 additions and 4 deletions

View file

@ -1,7 +1,7 @@
# ConfigureMsvc3rdParty.cmake - Configure 3rd Party Library Paths on Windows
if (MSVC)
GET_FILENAME_COMPONENT(PARENT_DIR ${PROJECT_BINARY_DIR} PATH)
get_filename_component(PARENT_DIR ${PROJECT_BINARY_DIR} DIRECTORY)
if (CMAKE_CL_64)
SET(TEST_3RDPARTY_DIR "${PARENT_DIR}/3rdparty.x64")
else (CMAKE_CL_64)
@ -52,7 +52,8 @@ if (MSVC AND MSVC_3RDPARTY_ROOT)
# if this variable was not set by the user, set it to 3rdparty root's
# parent dir, which is the normal location for people using our
# windows-3rd-party repo
GET_FILENAME_COMPONENT(MSVC_ROOT_PARENT_DIR ${MSVC_3RDPARTY_ROOT} PATH)
get_filename_component(MSVC_ROOT_PARENT_DIR ${MSVC_3RDPARTY_ROOT}
DIRECTORY)
set(BOOST_INCLUDEDIR ${MSVC_ROOT_PARENT_DIR})
message(STATUS "BOOST_INCLUDEDIR is ${BOOST_INCLUDEDIR}")
endif()

View file

@ -43,7 +43,7 @@ FIND_PATH(DBUS_INCLUDE_DIR
${PC_DBUS_INCLUDE_DIRS}
)
GET_FILENAME_COMPONENT(_DBUS_LIBRARY_DIR ${DBUS_LIBRARIES} PATH)
GET_FILENAME_COMPONENT(_DBUS_LIBRARY_DIR ${DBUS_LIBRARIES} DIRECTORY)
FIND_PATH(DBUS_ARCH_INCLUDE_DIR
NAMES dbus/dbus-arch-deps.h
HINTS ${PC_DBUS_INCLUDEDIR}
@ -56,4 +56,4 @@ FIND_PATH(DBUS_ARCH_INCLUDE_DIR
SET(DBUS_INCLUDE_DIRS ${DBUS_INCLUDE_DIR} ${DBUS_ARCH_INCLUDE_DIR})
INCLUDE(FindPackageHandleStandardArgs)
FIND_PACKAGE_HANDLE_STANDARD_ARGS(DBUS REQUIRED_VARS DBUS_INCLUDE_DIRS DBUS_LIBRARIES)
FIND_PACKAGE_HANDLE_STANDARD_ARGS(DBUS REQUIRED_VARS DBUS_INCLUDE_DIRS DBUS_LIBRARIES)