mirror of
https://github.com/Kitware/CMake.git
synced 2026-05-05 05:39:57 -05:00
c8ccd5a9e3
Add Common Package Specification support to export(EXPORT).
16 lines
518 B
CMake
16 lines
518 B
CMake
add_library(foo INTERFACE)
|
|
|
|
target_compile_features(foo INTERFACE cxx_std_23)
|
|
target_compile_options(foo INTERFACE -ffast-math)
|
|
target_compile_definitions(foo INTERFACE -DFOO -DBAR=BAR)
|
|
target_include_directories(
|
|
foo INTERFACE
|
|
$<BUILD_INTERFACE:${CMAKE_CURRENT_LIST_DIR}/foo>
|
|
)
|
|
target_link_directories(foo INTERFACE /opt/foo/lib)
|
|
target_link_options(foo INTERFACE --needed)
|
|
target_link_libraries(foo INTERFACE /usr/lib/libm.so)
|
|
|
|
install(TARGETS foo EXPORT foo DESTINATION .)
|
|
export(EXPORT foo PACKAGE_INFO foo)
|