-
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.
- Loading branch information
1 parent
bd34884
commit 2543f86
Showing
4 changed files
with
81 additions
and
0 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 |
---|---|---|
@@ -0,0 +1,50 @@ | ||
cmake_minimum_required(VERSION 3.12) | ||
|
||
project(nwidget VERSION 0.1.0 LANGUAGES CXX) | ||
|
||
set(CMAKE_CXX_STANDARD 17) | ||
set(CMAKE_CXX_STANDARD_REQUIRED TRUE) | ||
|
||
add_library(nwidget INTERFACE) | ||
|
||
target_include_directories(nwidget | ||
INTERFACE | ||
$<BUILD_INTERFACE:${CMAKE_CURRENT_SOURCE_DIR}/include> | ||
$<INSTALL_INTERFACE:${CMAKE_INSTALL_INCLUDEDIR}> | ||
) | ||
|
||
include(GNUInstallDirs) | ||
|
||
install(TARGETS nwidget | ||
EXPORT nwidget-targets | ||
ARCHIVE DESTINATION ${CMAKE_INSTALL_LIBDIR} | ||
LIBRARY DESTINATION ${CMAKE_INSTALL_LIBDIR} | ||
RUNTIME DESTINATION ${CMAKE_INSTALL_BINDIR} | ||
) | ||
|
||
include(CMakePackageConfigHelpers) | ||
|
||
write_basic_package_version_file( | ||
${PROJECT_BINARY_DIR}/nwidget-config-version.cmake | ||
VERSION ${PROJECT_VERSION} | ||
COMPATIBILITY SameMajorVersion | ||
) | ||
configure_package_config_file( | ||
${PROJECT_SOURCE_DIR}/cmake/nwidget-config.cmake.in | ||
${PROJECT_BINARY_DIR}/nwidget-config.cmake | ||
INSTALL_DESTINATION ${CMAKE_INSTALL_DATAROOTDIR}/nwidget/cmake | ||
) | ||
|
||
install(EXPORT nwidget-targets | ||
FILE nwidget-targets.cmake | ||
NAMESPACE nwidget:: | ||
DESTINATION ${CMAKE_INSTALL_DATAROOTDIR}/nwidget/cmake | ||
) | ||
|
||
install(FILES | ||
${PROJECT_BINARY_DIR}/nwidget-config.cmake | ||
${PROJECT_BINARY_DIR}/nwidget-config-version.cmake | ||
DESTINATION ${CMAKE_INSTALL_DATAROOTDIR}/nwidget/cmake | ||
) | ||
|
||
install(DIRECTORY ${PROJECT_SOURCE_DIR}/include/nwidget DESTINATION include) |
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
@PACKAGE_INIT@ | ||
|
||
include("${CMAKE_CURRENT_LIST_DIR}/nwidget-targets.cmake") |
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