Skip to content

Commit

Permalink
build: add emil_install to emil_build_for.cmake which only installs t…
Browse files Browse the repository at this point in the history
…he target if it is part of the All target (#425)

(cherry picked from commit b669983)
  • Loading branch information
richardapeters authored Oct 3, 2023
1 parent 45eb746 commit 19d14bf
Show file tree
Hide file tree
Showing 3 changed files with 9 additions and 2 deletions.
7 changes: 7 additions & 0 deletions cmake/emil_build_for.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -88,3 +88,10 @@ function(emil_build_for target)
endif()

endfunction()

function(emil_install target)
get_target_property(exclude ${target} EXCLUDE_FROM_ALL)
if (NOT ${exclude})
install(TARGETS ${target} ${ARGN})
endif()
endfunction()
2 changes: 1 addition & 1 deletion services/echo_console/CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
if (EMIL_HOST_BUILD)
add_executable(services.echo_console ${EMIL_EXCLUDE_FROM_ALL})
install(TARGETS services.echo_console EXPORT emilProtobufTargets DESTINATION bin)
emil_install(services.echo_console EXPORT emilProtobufTargets DESTINATION bin)

target_link_libraries(services.echo_console PUBLIC
args
Expand Down
2 changes: 1 addition & 1 deletion upgrade/security_key_generator/CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
add_executable(upgrade.security_key_generator)
emil_build_for(upgrade.security_key_generator HOST All PREREQUISITE_BOOL EMIL_STANDALONE)
install(TARGETS upgrade.security_key_generator EXPORT emilUpgradeTargets DESTINATION bin)
emil_install(upgrade.security_key_generator EXPORT emilUpgradeTargets DESTINATION bin)

target_link_libraries(upgrade.security_key_generator PUBLIC
args
Expand Down

0 comments on commit 19d14bf

Please sign in to comment.