forked from microsoft/vcpkg
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
[luafilesystem] Add cmake files for find_package
Addresses microsoft#38340 for luafilesystem
- Loading branch information
1 parent
bd5a4e7
commit 7c344da
Showing
4 changed files
with
62 additions
and
18 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,17 +1,43 @@ | ||
cmake_minimum_required(VERSION 3.0) | ||
project(luafilesystem) | ||
|
||
find_path(LUA_INCLUDE_DIR lua.h PATH_SUFFIXES lua) | ||
find_library(LUA_LIBRARY lua) | ||
set(LFS_INCLUDES ${LUA_INCLUDE_DIR}) | ||
set(LFS_LIBRARIES ${LUA_LIBRARY}) | ||
|
||
add_library( lfs src/lfs.h src/lfs.c src/lfs.def) | ||
|
||
target_include_directories(lfs PRIVATE ${LFS_INCLUDES}) | ||
target_link_libraries(lfs PRIVATE ${LFS_LIBRARIES}) | ||
|
||
install(TARGETS lfs | ||
RUNTIME DESTINATION bin | ||
LIBRARY DESTINATION lib | ||
ARCHIVE DESTINATION lib) | ||
cmake_minimum_required(VERSION 3.11) | ||
project(luafilesystem) | ||
|
||
find_path(LUA_INCLUDE_DIR lua.h PATH_SUFFIXES lua) | ||
find_library(LUA_LIBRARY lua) | ||
set(LFS_INCLUDES ${LUA_INCLUDE_DIR}) | ||
set(LFS_LIBRARIES ${LUA_LIBRARY}) | ||
|
||
add_library(lfs src/lfs.h src/lfs.c src/lfs.def) | ||
|
||
target_include_directories(lfs PRIVATE ${LFS_INCLUDES}) | ||
target_link_libraries(lfs PRIVATE ${LFS_LIBRARIES}) | ||
|
||
install(TARGETS lfs | ||
EXPORT lfsTargets | ||
RUNTIME DESTINATION bin | ||
LIBRARY DESTINATION lib | ||
ARCHIVE DESTINATION lib) | ||
|
||
include(CMakePackageConfigHelpers) | ||
|
||
configure_package_config_file( | ||
"${CMAKE_CURRENT_SOURCE_DIR}/${PROJECT_NAME}Config.cmake.in" | ||
"${CMAKE_CURRENT_BINARY_DIR}/${PROJECT_NAME}Config.cmake" | ||
INSTALL_DESTINATION "share/${PROJECT_NAME}" | ||
) | ||
|
||
set(VERSION_FILE_PATH "${CMAKE_CURRENT_BINARY_DIR}/${PROJECT_NAME}ConfigVersion.cmake") | ||
write_basic_package_version_file( | ||
"${VERSION_FILE_PATH}" | ||
VERSION "${LFS_VERSION}" | ||
COMPATIBILITY SameMajorVersion | ||
) | ||
|
||
install( | ||
FILES "${CMAKE_CURRENT_BINARY_DIR}/${PROJECT_NAME}Config.cmake" | ||
DESTINATION "share/${PROJECT_NAME}" | ||
) | ||
|
||
install( | ||
EXPORT "lfsTargets" | ||
NAMESPACE "${PROJECT_NAME}::" | ||
DESTINATION "share/${PROJECT_NAME}") |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
@PACKAGE_INIT@ | ||
|
||
include("${CMAKE_CURRENT_LIST_DIR}/lfsTargets.cmake") | ||
|
||
check_required_components(luafilesystem) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters