cmake: add aliases so exported target names are available in tree
Reviewed-by: Brad King Closes #5206
This commit is contained in:
Родитель
f62bd9db90
Коммит
7fa1578471
|
@ -92,6 +92,11 @@ add_library(
|
|||
${HHEADERS} ${CSOURCES}
|
||||
)
|
||||
|
||||
add_library(
|
||||
${PROJECT_NAME}::${LIB_NAME}
|
||||
ALIAS ${LIB_NAME}
|
||||
)
|
||||
|
||||
if(MSVC AND NOT BUILD_SHARED_LIBS)
|
||||
set_target_properties(${LIB_NAME} PROPERTIES STATIC_LIBRARY_FLAGS ${CMAKE_EXE_LINKER_FLAGS})
|
||||
endif()
|
||||
|
@ -143,5 +148,5 @@ install(TARGETS ${LIB_NAME}
|
|||
|
||||
export(TARGETS ${LIB_NAME}
|
||||
APPEND FILE ${PROJECT_BINARY_DIR}/libcurl-target.cmake
|
||||
NAMESPACE CURL::
|
||||
NAMESPACE ${PROJECT_NAME}::
|
||||
)
|
||||
|
|
|
@ -67,6 +67,11 @@ add_executable(
|
|||
${CURL_FILES}
|
||||
)
|
||||
|
||||
add_executable(
|
||||
${PROJECT_NAME}::${EXE_NAME}
|
||||
ALIAS ${EXE_NAME}
|
||||
)
|
||||
|
||||
if(CURL_HAS_LTO)
|
||||
set_target_properties(${EXE_NAME} PROPERTIES
|
||||
INTERPROCEDURAL_OPTIMIZATION_RELEASE TRUE
|
||||
|
@ -99,5 +104,5 @@ target_link_libraries(${EXE_NAME} libcurl ${CURL_LIBS})
|
|||
install(TARGETS ${EXE_NAME} EXPORT ${TARGETS_EXPORT_NAME} DESTINATION ${CMAKE_INSTALL_BINDIR})
|
||||
export(TARGETS ${EXE_NAME}
|
||||
APPEND FILE ${PROJECT_BINARY_DIR}/curl-target.cmake
|
||||
NAMESPACE CURL::
|
||||
NAMESPACE ${PROJECT_NAME}::
|
||||
)
|
||||
|
|
Загрузка…
Ссылка в новой задаче