Skip to content

Commit

Permalink
Merge pull request #197 from dalg24/install_executables
Browse files Browse the repository at this point in the history
Make sure `kp_reader` and `kp_json_writer` executables are also installed
  • Loading branch information
dalg24 authored Jun 26, 2023
2 parents 7ab2900 + f18b72d commit 4bae71c
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 2 deletions.
8 changes: 8 additions & 0 deletions cmake/utils.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,14 @@ function(kp_add_library TARGET)
set(EXPORT_TARGETS ${EXPORT_TARGETS} CACHE STRING "" FORCE)
endfunction()

function(kp_add_executable TARGET)
add_executable(${TARGET} ${ARGN}) # SOURCES = ${ARGN}

# add this executable to exported targets
list(APPEND EXPORT_TARGETS ${TARGET})
set(EXPORT_TARGETS ${EXPORT_TARGETS} CACHE STRING "" FORCE)
endfunction()

macro(set_cache NAME VAL)
set(${NAME} ON CACHE BOOL "")
endmacro()
Expand Down
4 changes: 2 additions & 2 deletions profiling/simple-kernel-timer/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -16,8 +16,8 @@ kp_add_library(kp_kernel_timer kp_kernel_timer.cpp)
target_link_libraries(kp_kernel_timer PRIVATE kp_kernel_shared)

# Add binary utilities
add_executable(kp_reader kp_reader.cpp)
kp_add_executable(kp_reader kp_reader.cpp)
target_link_libraries(kp_reader PRIVATE kp_kernel_timer)

add_executable(kp_json_writer kp_json_writer.cpp)
kp_add_executable(kp_json_writer kp_json_writer.cpp)
target_link_libraries(kp_json_writer PRIVATE kp_kernel_timer)

0 comments on commit 4bae71c

Please sign in to comment.