Skip to content

Commit b22f877

Browse files
committed
Fixed install include
1 parent 1ecf32f commit b22f877

File tree

1 file changed

+10
-4
lines changed

1 file changed

+10
-4
lines changed

CMakeLists.txt

Lines changed: 10 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -270,15 +270,15 @@ if(BUILD_SHARED_LIBS)
270270
set(VERSION_RC ${CMAKE_CURRENT_BINARY_DIR}/version.rc)
271271
configure_file(${CMAKE_CURRENT_SOURCE_DIR}/cmake/version.rc.in ${CMAKE_CURRENT_BINARY_DIR}/version.rc @ONLY)
272272
endif()
273-
add_library(spdlog SHARED ${SPDLOG_SRCS} ${SPDLOG_HEADERS} ${VERSION_RC})
273+
add_library(spdlog SHARED ${SPDLOG_SRCS} ${VERSION_RC})
274274
target_compile_definitions(spdlog PUBLIC SPDLOG_SHARED_LIB)
275275
if(MSVC)
276276
# disable dlls related warnings on msvc
277277
target_compile_options(spdlog PUBLIC $<$<AND:$<CXX_COMPILER_ID:MSVC>,$<NOT:$<COMPILE_LANGUAGE:CUDA>>>:/wd4251
278278
/wd4275>)
279279
endif()
280280
else()
281-
add_library(spdlog STATIC ${SPDLOG_SRCS} ${SPDLOG_HEADERS})
281+
add_library(spdlog STATIC ${SPDLOG_SRCS})
282282
endif()
283283
add_library(spdlog::spdlog ALIAS spdlog)
284284

@@ -287,7 +287,12 @@ if(SPDLOG_SYSTEM_INCLUDES)
287287
set(SPDLOG_INCLUDES_LEVEL "SYSTEM")
288288
endif()
289289

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+
)
291296

292297
target_include_directories(spdlog ${SPDLOG_INCLUDES_LEVEL} PUBLIC
293298
"$<BUILD_INTERFACE:${CMAKE_CURRENT_LIST_DIR}/include>"
@@ -370,7 +375,8 @@ if(SPDLOG_INSTALL)
370375
LIBRARY DESTINATION ${CMAKE_INSTALL_LIBDIR}
371376
ARCHIVE DESTINATION ${CMAKE_INSTALL_LIBDIR}
372377
RUNTIME DESTINATION ${CMAKE_INSTALL_BINDIR}
373-
PUBLIC_HEADER DESTINATION ${CMAKE_INSTALL_INCLUDEDIR}/spdlog)
378+
FILE_SET HEADERS DESTINATION ${CMAKE_INSTALL_INCLUDEDIR}/spdlog
379+
)
374380

375381
# ---------------------------------------------------------------------------------------
376382
# Install pkg-config file

0 commit comments

Comments
 (0)