Skip to content

Commit

Permalink
Use get_filename_component to normalize paths for Windows
Browse files Browse the repository at this point in the history
Using get_filename_component to do this normalizes slashes in the CMAKE_CURRENT_LIST_DIR variable to avoid paths with mixed backslashes (from Windows) and forward slashes (from Unix / CMake).

https://cmake.org/cmake/help/v3.5/command/get_filename_component.html
  • Loading branch information
nuclearsandwich committed Mar 15, 2017
1 parent 12437d1 commit efa9674
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions orocos_kdl/KDLConfig.cmake.in
Expand Up @@ -5,7 +5,8 @@
# orocos_kdl_PKGCONFIG_DIR - directory containing the .pc pkgconfig files

# Compute paths
set(orocos_kdl_INCLUDE_DIRS "${CMAKE_CURRENT_LIST_DIR}/../../include;@Boost_INCLUDE_DIRS@;@Eigen_INCLUDE_DIR@")
get_filename_component(_orocos_kdl_include_dir "${CMAKE_CURRENT_LIST_DIR}/../../include" ABSOLUTE)
set(orocos_kdl_INCLUDE_DIRS "${_orocos_kdl_include_dir};@Eigen_INCLUDE_DIR@")

if(NOT TARGET orocos-kdl)
include("${CMAKE_CURRENT_LIST_DIR}/OrocosKDLTargets.cmake")
Expand All @@ -14,4 +15,4 @@ endif()
set(orocos_kdl_LIBRARIES orocos-kdl)

# where the .pc pkgconfig files are installed
set(orocos_kdl_PKGCONFIG_DIR "${CMAKE_CURRENT_LIST_DIR}/../../lib/pkgconfig")
get_filename_component(orocos_kdl_PKGCONFIG_DIR "${CMAKE_CURRENT_LIST_DIR}/../../lib/pkgconfig" ABSOLUTE)

0 comments on commit efa9674

Please sign in to comment.