diff options
author | AnotherTest <ali.mpfard@gmail.com> | 2020-06-24 08:27:00 +0430 |
---|---|---|
committer | Andreas Kling <kling@serenityos.org> | 2020-06-27 16:08:52 +0200 |
commit | 880c3fb83f4ab29a010c52514545859a4ff572ef (patch) | |
tree | 7fe9c0e269577b3a82835f55c5d098645a08c7b6 /Userland/CMakeLists.txt | |
parent | a6fd969d93654c1105008dcd032a96753cbd62f1 (diff) | |
download | serenity-880c3fb83f4ab29a010c52514545859a4ff572ef.zip |
Userland: Add a 'test' utility
This adds an incomplete implementation of the test util, missing some
user/group checks, and `-l STRING`.
It also symlinks '[' to 'test'.
Diffstat (limited to 'Userland/CMakeLists.txt')
-rw-r--r-- | Userland/CMakeLists.txt | 14 |
1 files changed, 11 insertions, 3 deletions
diff --git a/Userland/CMakeLists.txt b/Userland/CMakeLists.txt index 87c839dabb..ecfcff4943 100644 --- a/Userland/CMakeLists.txt +++ b/Userland/CMakeLists.txt @@ -1,10 +1,18 @@ file(GLOB CMD_SOURCES "*.cpp") +list(APPEND SPECIAL_TARGETS "test" "install") foreach(CMD_SRC ${CMD_SOURCES}) get_filename_component(CMD_NAME ${CMD_SRC} NAME_WE) - add_executable(${CMD_NAME} ${CMD_SRC}) - target_link_libraries(${CMD_NAME} LibCore) - install(TARGETS ${CMD_NAME} RUNTIME DESTINATION bin) + if (CMD_NAME IN_LIST SPECIAL_TARGETS) + add_executable("${CMD_NAME}-bin" ${CMD_SRC}) + target_link_libraries("${CMD_NAME}-bin" LibCore) + install(TARGETS "${CMD_NAME}-bin" RUNTIME DESTINATION bin) + install(CODE "execute_process(COMMAND mv ${CMD_NAME}-bin ${CMD_NAME} WORKING_DIRECTORY ${CMAKE_INSTALL_PREFIX}/bin)") + else () + add_executable(${CMD_NAME} ${CMD_SRC}) + target_link_libraries(${CMD_NAME} LibCore) + install(TARGETS ${CMD_NAME} RUNTIME DESTINATION bin) + endif() endforeach() target_link_libraries(aplay LibAudio) |