@@ -53,6 +53,8 @@ function(slang_add_target dir type)
53
53
# explicit name instead, used for externally built things such as
54
54
# slang-glslang and slang-llvm which have large pdb files
55
55
DEBUG_INFO_INSTALL_COMPONENT
56
+ # The name of the Export set to associate with this installed target
57
+ EXPORT_SET_NAME
56
58
)
57
59
set (multi_value_args
58
60
# Use exactly these sources, instead of globbing from the directory
@@ -408,22 +410,31 @@ function(slang_add_target dir type)
408
410
# Mark for installation
409
411
#
410
412
macro (i)
413
+ if (ARG_EXPORT_SET_NAME)
414
+ set (export_args EXPORT ${ARG_EXPORT_SET_NAME} )
415
+ else ()
416
+ if (type MATCHES "^(EXECUTABLE|SHARED|MODULE)$" )
417
+ message (
418
+ WARNING
419
+ "Target ${target} is set to be INSTALLED but EXPORT_SET_NAME wasn't specified"
420
+ )
421
+ endif ()
422
+ set (export_args)
423
+ endif ()
411
424
install (
412
- TARGETS ${target}
413
- EXPORT SlangTargets
425
+ TARGETS ${target} ${export_args}
414
426
ARCHIVE DESTINATION ${archive_subdir} ${ARGN}
415
427
LIBRARY DESTINATION ${library_subdir} ${ARGN}
416
428
RUNTIME DESTINATION ${runtime_subdir} ${ARGN}
417
429
PUBLIC_HEADER DESTINATION ${CMAKE_INSTALL_INCLUDEDIR} ${ARGN}
418
430
)
419
431
endmacro ()
420
- if (ARG_INSTALL)
421
- i()
422
- set (pdb_component "debug-info" )
423
- endif ()
424
432
if (ARG_INSTALL_COMPONENT)
425
433
i(EXCLUDE_FROM_ALL COMPONENT ${ARG_INSTALL_COMPONENT} )
426
434
set (pdb_component "${ARG_INSTALL_COMPONENT} -debug-info" )
435
+ elseif (ARG_INSTALL)
436
+ i()
437
+ set (pdb_component "debug-info" )
427
438
endif ()
428
439
if (ARG_DEBUG_INFO_INSTALL_COMPONENT)
429
440
set (pdb_component ${ARG_DEBUG_INFO_INSTALL_COMPONENT} )
0 commit comments