From 688ae78fd36fe46aade8f6e8bc3c27b0cef7da29 Mon Sep 17 00:00:00 2001 From: Riyyi Date: Sat, 29 Jan 2022 21:58:52 +0100 Subject: [PATCH] CMake: Put the run target in the targets section --- CMakeLists.txt | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index 81e4751..751cfc5 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -3,12 +3,6 @@ # Set project name set(PROJECT "stowage") -# ------------------------------------------ - -# Add 'make run' target -add_custom_target(run - COMMAND ${PROJECT} -) # ------------------------------------------ @@ -77,6 +71,12 @@ list(REMOVE_ITEM TEST_SOURCES "${CMAKE_SOURCE_DIR}/src/main.cpp") add_executable(${PROJECT} ${PROJECT_SOURCES}) target_link_libraries(${PROJECT}) +# ------------------------------------------ +# Execute target + +add_custom_target(run + COMMAND ${PROJECT}) +add_dependencies(run ${PROJECT}) # ------------------------------------------ # Unit test target