Support public resources in libraries
This commit is contained in:
parent
7520901f30
commit
4f88ce3101
1 changed files with 10 additions and 2 deletions
|
|
@ -1,6 +1,6 @@
|
||||||
psemek_add_build_tool(psemek-resource-compiler FALSE compiler.cpp)
|
psemek_add_build_tool(psemek-resource-compiler FALSE compiler.cpp)
|
||||||
|
|
||||||
function(psemek_add_resources TARGET)
|
function(psemek_add_resources_impl MODE TARGET)
|
||||||
if(PSEMEK_PACKAGE_MODE)
|
if(PSEMEK_PACKAGE_MODE)
|
||||||
if(NOT (TARGET ${TARGET}))
|
if(NOT (TARGET ${TARGET}))
|
||||||
return()
|
return()
|
||||||
|
|
@ -10,7 +10,7 @@ function(psemek_add_resources TARGET)
|
||||||
get_target_property(OUT_DIR ${TARGET} BINARY_DIR)
|
get_target_property(OUT_DIR ${TARGET} BINARY_DIR)
|
||||||
get_target_property(INPUT_DIR ${TARGET} SOURCE_DIR)
|
get_target_property(INPUT_DIR ${TARGET} SOURCE_DIR)
|
||||||
|
|
||||||
target_include_directories(${TARGET} PRIVATE "${OUT_DIR}/resource/include")
|
target_include_directories(${TARGET} ${MODE} "${OUT_DIR}/resource/include")
|
||||||
|
|
||||||
while(ARGN)
|
while(ARGN)
|
||||||
list(GET ARGN 0 FILE)
|
list(GET ARGN 0 FILE)
|
||||||
|
|
@ -38,3 +38,11 @@ function(psemek_add_resources TARGET)
|
||||||
target_sources(${TARGET} PRIVATE "${OUT_HEADER}" "${OUT_SOURCE}")
|
target_sources(${TARGET} PRIVATE "${OUT_HEADER}" "${OUT_SOURCE}")
|
||||||
endwhile()
|
endwhile()
|
||||||
endfunction()
|
endfunction()
|
||||||
|
|
||||||
|
function(psemek_add_resources)
|
||||||
|
psemek_add_resources_impl(PRIVATE ${ARGN})
|
||||||
|
endfunction()
|
||||||
|
|
||||||
|
function(psemek_add_public_resources)
|
||||||
|
psemek_add_resources_impl(PUBLIC ${ARGN})
|
||||||
|
endfunction()
|
||||||
|
|
|
||||||
Loading…
Add table
Reference in a new issue