@@ -270,15 +270,15 @@ if(BUILD_SHARED_LIBS)
270
270
set (VERSION_RC ${CMAKE_CURRENT_BINARY_DIR} /version .rc)
271
271
configure_file (${CMAKE_CURRENT_SOURCE_DIR} /cmake/version .rc.in ${CMAKE_CURRENT_BINARY_DIR} /version .rc @ONLY)
272
272
endif ()
273
- add_library (spdlog SHARED ${SPDLOG_SRCS} ${SPDLOG_HEADERS} ${ VERSION_RC} )
273
+ add_library (spdlog SHARED ${SPDLOG_SRCS} ${VERSION_RC} )
274
274
target_compile_definitions (spdlog PUBLIC SPDLOG_SHARED_LIB)
275
275
if (MSVC )
276
276
# disable dlls related warnings on msvc
277
277
target_compile_options (spdlog PUBLIC $<$<AND :$<CXX_COMPILER_ID:MSVC >,$<NOT :$<COMPILE_LANGUAGE:CUDA>>>:/wd4251
278
278
/wd4275>)
279
279
endif ()
280
280
else ()
281
- add_library (spdlog STATIC ${SPDLOG_SRCS} ${SPDLOG_HEADERS} )
281
+ add_library (spdlog STATIC ${SPDLOG_SRCS} )
282
282
endif ()
283
283
add_library (spdlog::spdlog ALIAS spdlog)
284
284
@@ -287,7 +287,12 @@ if(SPDLOG_SYSTEM_INCLUDES)
287
287
set (SPDLOG_INCLUDES_LEVEL "SYSTEM" )
288
288
endif ()
289
289
290
- set_target_properties (spdlog PROPERTIES PUBLIC_HEADER "${SPDLOG_HEADERS} " )
290
+ target_sources (spdlog
291
+ PUBLIC
292
+ FILE_SET HEADERS
293
+ BASE_DIRS include /spdlog
294
+ FILES ${SPDLOG_HEADERS}
295
+ )
291
296
292
297
target_include_directories (spdlog ${SPDLOG_INCLUDES_LEVEL} PUBLIC
293
298
"$<BUILD_INTERFACE:${CMAKE_CURRENT_LIST_DIR} /include>"
@@ -370,7 +375,8 @@ if(SPDLOG_INSTALL)
370
375
LIBRARY DESTINATION ${CMAKE_INSTALL_LIBDIR}
371
376
ARCHIVE DESTINATION ${CMAKE_INSTALL_LIBDIR}
372
377
RUNTIME DESTINATION ${CMAKE_INSTALL_BINDIR}
373
- PUBLIC_HEADER DESTINATION ${CMAKE_INSTALL_INCLUDEDIR} /spdlog)
378
+ FILE_SET HEADERS DESTINATION ${CMAKE_INSTALL_INCLUDEDIR} /spdlog
379
+ )
374
380
375
381
# ---------------------------------------------------------------------------------------
376
382
# Install pkg-config file
0 commit comments