mirror of
https://git.mirrors.martin98.com/https://github.com/gulrak/filesystem
synced 2025-06-11 02:36:33 +08:00
[cmake] Define alias ghcFilesystem::ghc_filesystem unconditionally
This alias is needed whether or not the install rules of `ghcfilesystem` are enabled. It allows projects to use the same target regardless of where `ghcfilesystem` comes from, `add_subdirectory` or `find_package`.
This commit is contained in:
parent
3e5b930d96
commit
6c6f2c2ec0
@ -37,6 +37,7 @@ message(STATUS "Compiler ID: ${CMAKE_CXX_COMPILER_ID}")
|
|||||||
message(STATUS "CMAKE_CXX_COMPILE_FEATURES: ${CMAKE_CXX_COMPILE_FEATURES}")
|
message(STATUS "CMAKE_CXX_COMPILE_FEATURES: ${CMAKE_CXX_COMPILE_FEATURES}")
|
||||||
|
|
||||||
add_library(ghc_filesystem INTERFACE)
|
add_library(ghc_filesystem INTERFACE)
|
||||||
|
add_library(ghcFilesystem::ghc_filesystem ALIAS ghc_filesystem)
|
||||||
target_include_directories(ghc_filesystem INTERFACE
|
target_include_directories(ghc_filesystem INTERFACE
|
||||||
$<BUILD_INTERFACE:${CMAKE_CURRENT_SOURCE_DIR}/include>
|
$<BUILD_INTERFACE:${CMAKE_CURRENT_SOURCE_DIR}/include>
|
||||||
$<INSTALL_INTERFACE:include>)
|
$<INSTALL_INTERFACE:include>)
|
||||||
@ -72,5 +73,4 @@ if(GHC_FILESYSTEM_WITH_INSTALL)
|
|||||||
PATH_VARS CMAKE_INSTALL_INCLUDEDIR)
|
PATH_VARS CMAKE_INSTALL_INCLUDEDIR)
|
||||||
install(FILES "${PROJECT_BINARY_DIR}/cmake/ghc_filesystem-config.cmake"
|
install(FILES "${PROJECT_BINARY_DIR}/cmake/ghc_filesystem-config.cmake"
|
||||||
DESTINATION "${CMAKE_INSTALL_LIBDIR}/cmake/ghc_filesystem")
|
DESTINATION "${CMAKE_INSTALL_LIBDIR}/cmake/ghc_filesystem")
|
||||||
add_library(ghcFilesystem::ghc_filesystem ALIAS ghc_filesystem)
|
|
||||||
endif()
|
endif()
|
||||||
|
Loading…
x
Reference in New Issue
Block a user