mirror of
https://github.com/mpusz/mp-units.git
synced 2025-08-05 21:24:27 +02:00
fix: target_sources
with FILE_SET HEADERS
called only when headers are present
This commit is contained in:
@@ -62,6 +62,11 @@ function(add_mp_units_module name target_name)
|
|||||||
|
|
||||||
# define the target for a module
|
# define the target for a module
|
||||||
add_library(${target_name} ${SCOPE})
|
add_library(${target_name} ${SCOPE})
|
||||||
|
target_link_libraries(${target_name} ${${projectPrefix}TARGET_SCOPE} ${ARG_DEPENDENCIES})
|
||||||
|
set_target_properties(${target_name} PROPERTIES EXPORT_NAME ${name})
|
||||||
|
add_library(mp-units::${name} ALIAS ${target_name})
|
||||||
|
|
||||||
|
if(ARG_HEADERS)
|
||||||
target_sources(
|
target_sources(
|
||||||
${target_name}
|
${target_name}
|
||||||
${${projectPrefix}TARGET_SCOPE}
|
${${projectPrefix}TARGET_SCOPE}
|
||||||
@@ -72,15 +77,11 @@ function(add_mp_units_module name target_name)
|
|||||||
FILES
|
FILES
|
||||||
${ARG_HEADERS}
|
${ARG_HEADERS}
|
||||||
)
|
)
|
||||||
target_link_libraries(${target_name} ${${projectPrefix}TARGET_SCOPE} ${ARG_DEPENDENCIES})
|
|
||||||
if(ARG_HEADERS)
|
|
||||||
target_include_directories(
|
target_include_directories(
|
||||||
${target_name} ${unitsAsSystem} ${${projectPrefix}TARGET_SCOPE}
|
${target_name} ${unitsAsSystem} ${${projectPrefix}TARGET_SCOPE}
|
||||||
$<BUILD_INTERFACE:${CMAKE_CURRENT_SOURCE_DIR}/include> $<INSTALL_INTERFACE:include>
|
$<BUILD_INTERFACE:${CMAKE_CURRENT_SOURCE_DIR}/include> $<INSTALL_INTERFACE:include>
|
||||||
)
|
)
|
||||||
endif()
|
endif()
|
||||||
set_target_properties(${target_name} PROPERTIES EXPORT_NAME ${name})
|
|
||||||
add_library(mp-units::${name} ALIAS ${target_name})
|
|
||||||
|
|
||||||
if(${projectPrefix}BUILD_CXX_MODULES)
|
if(${projectPrefix}BUILD_CXX_MODULES)
|
||||||
target_sources(${target_name} PUBLIC FILE_SET CXX_MODULES FILES ${ARG_MODULE_INTERFACE_UNIT})
|
target_sources(${target_name} PUBLIC FILE_SET CXX_MODULES FILES ${ARG_MODULE_INTERFACE_UNIT})
|
||||||
|
Reference in New Issue
Block a user