From 03c451fba836bfb0e718dd4100953039f5367344 Mon Sep 17 00:00:00 2001 From: veclavtalica Date: Tue, 8 Oct 2024 00:50:25 +0300 Subject: [PATCH] CMakeFiles.txt: no target_app --- CMakeLists.txt | 34 ++++++++++++++++------------------ 1 file changed, 16 insertions(+), 18 deletions(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index 43b267c..2f47a7c 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -255,7 +255,7 @@ function(use_townengine target sources output_directory) RUNTIME_OUTPUT_DIRECTORY ${output_directory}) # launcher binary, loads game and engine shared library - add_executable(${target}_app ${TWN_ROOT_DIR}/src/twn_main.c) + add_executable(${target} ${TWN_ROOT_DIR}/src/twn_main.c) # todo: copy instead? # put libtownengine.so alongside the binary @@ -263,38 +263,36 @@ function(use_townengine target sources output_directory) LIBRARY_OUTPUT_DIRECTORY ${output_directory}) else() # build and link all statically - add_executable(${target}_app ${sources}) + add_executable(${target} ${sources}) endif() - set_target_properties(${target}_app PROPERTIES - OUTPUT_NAME ${target} - LIBRARY_OUTPUT_DIRECTORY ${output_directory} - RUNTIME_OUTPUT_DIRECTORY ${output_directory}) + set_target_properties(${target} PROPERTIES + LIBRARY_OUTPUT_DIRECTORY ${output_directory} + RUNTIME_OUTPUT_DIRECTORY ${output_directory}) if(EMSCRIPTEN) - set_target_properties(${target}_app PROPERTIES - SUFFIX .html) + set_target_properties(${target} PROPERTIES SUFFIX .html) endif() - target_compile_options(${target}_app PRIVATE - $<$:--shell-file ${TWN_ROOT_DIR}/shell_minimal.html>) + target_compile_options(${target} PRIVATE + $<$:--shell-file ${TWN_ROOT_DIR}/shell_minimal.html>) # system libraries find_library(MATH_LIBRARY m) if (MATH_LIBRARY) - target_link_libraries(${target}_app PUBLIC ${MATH_LIBRARY}) + target_link_libraries(${target} PUBLIC ${MATH_LIBRARY}) endif() - give_options(${target}_app) - include_deps(${target}_app) - link_deps(${target}_app) + give_options(${target}) + include_deps(${target}) + link_deps(${target}) - target_link_libraries(${target}_app PUBLIC ${TWN_TARGET}) + target_link_libraries(${target} PUBLIC ${TWN_TARGET}) if(WIN32) # copy dlls for baby windows - add_custom_command(TARGET ${target}_app POST_BUILD - COMMAND ${CMAKE_COMMAND} -E copy_if_different $ - $ + add_custom_command(TARGET ${target} POST_BUILD + COMMAND ${CMAKE_COMMAND} -E copy_if_different $ + $ COMMAND_EXPAND_LISTS) endif() endfunction()