[A] Add target export in cmake.
This commit is contained in:
parent
bff48549de
commit
c22a518766
@ -15,6 +15,7 @@
|
|||||||
### Internal
|
### Internal
|
||||||
|
|
||||||
- Refactoring of code that uses vectors.
|
- Refactoring of code that uses vectors.
|
||||||
|
- Add target export in cmake.
|
||||||
|
|
||||||
### Docs
|
### Docs
|
||||||
|
|
||||||
|
@ -6,7 +6,8 @@ add_library(fort
|
|||||||
|
|
||||||
target_include_directories(fort
|
target_include_directories(fort
|
||||||
PUBLIC
|
PUBLIC
|
||||||
${CMAKE_CURRENT_SOURCE_DIR}
|
$<BUILD_INTERFACE:${CMAKE_CURRENT_SOURCE_DIR}>
|
||||||
|
$<INSTALL_INTERFACE:${CMAKE_INSTALL_INCLUDEDIR}>
|
||||||
)
|
)
|
||||||
|
|
||||||
set_target_properties(fort
|
set_target_properties(fort
|
||||||
@ -30,14 +31,25 @@ endif()
|
|||||||
|
|
||||||
include(GNUInstallDirs)
|
include(GNUInstallDirs)
|
||||||
install(
|
install(
|
||||||
TARGETS
|
TARGETS fort
|
||||||
fort
|
EXPORT LibFort
|
||||||
LIBRARY DESTINATION ${CMAKE_INSTALL_LIBDIR}
|
LIBRARY DESTINATION ${CMAKE_INSTALL_LIBDIR}
|
||||||
ARCHIVE DESTINATION ${CMAKE_INSTALL_LIBDIR}
|
ARCHIVE DESTINATION ${CMAKE_INSTALL_LIBDIR}
|
||||||
RUNTIME DESTINATION ${CMAKE_INSTALL_BINDIR}
|
RUNTIME DESTINATION ${CMAKE_INSTALL_BINDIR}
|
||||||
)
|
)
|
||||||
|
install(
|
||||||
install(FILES fort.h fort.hpp DESTINATION ${CMAKE_INSTALL_INCLUDEDIR})
|
FILES fort.h fort.hpp
|
||||||
|
DESTINATION ${CMAKE_INSTALL_INCLUDEDIR}
|
||||||
|
)
|
||||||
|
|
||||||
configure_file(libfort.pc.in libfort.pc @ONLY)
|
configure_file(libfort.pc.in libfort.pc @ONLY)
|
||||||
install(FILES ${CMAKE_CURRENT_BINARY_DIR}/libfort.pc DESTINATION lib/pkgconfig)
|
install(
|
||||||
|
FILES ${CMAKE_CURRENT_BINARY_DIR}/libfort.pc
|
||||||
|
DESTINATION lib/pkgconfig
|
||||||
|
)
|
||||||
|
|
||||||
|
install(
|
||||||
|
EXPORT LibFort
|
||||||
|
NAMESPACE LibFort::
|
||||||
|
DESTINATION ${CMAKE_INSTALL_LIBDIR}/cmake/${PROJECT_NAME}
|
||||||
|
)
|
||||||
|
Loading…
Reference in New Issue
Block a user