Skip to content

Commit

Permalink
Fix target name on Android
Browse files Browse the repository at this point in the history
  • Loading branch information
vicr123 committed Mar 18, 2024
1 parent b20bac3 commit be7cb4e
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 3 deletions.
6 changes: 6 additions & 0 deletions lib/cmake-scripts/cntp-init.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -72,6 +72,12 @@ function(cntp_init_android target)
file(GLOB_RECURSE ANDROID_SKEL_FILES ${ORIGINAL_PACKAGE_SOURCE_DIR}/*)
foreach(file ${ANDROID_SKEL_FILES})
cmake_path(RELATIVE_PATH file BASE_DIRECTORY ${ORIGINAL_PACKAGE_SOURCE_DIR} OUTPUT_VARIABLE relFile)
cmake_path(GET relFile FILENAME filename)

if(${filename} STREQUAL "icon.png")
continue()
endif()

set(destination ${ANDROID_FILES_DESTINATION}/${relFile})
configure_file(${file} ${destination} COPYONLY)
endforeach()
Expand Down
8 changes: 5 additions & 3 deletions lib/cmake-scripts/cntp-targetname.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -19,9 +19,11 @@ function(cntp_target_name targetName targetReadableName)
ENDIF()
ENDIF()


set_target_properties(${targetName} PROPERTIES
OUTPUT_NAME "${TARGET_FINAL_NAME}")
if(NOT ${CMAKE_SYSTEM_NAME} STREQUAL "Android")
# Changing the target name when building for Android confuses Qt Creator
set_target_properties(${targetName} PROPERTIES
OUTPUT_NAME "${TARGET_FINAL_NAME}")
endif()
target_compile_definitions(${targetName} PRIVATE
T_APPMETA_READABLE_NAME="${TARGET_READABLE_NAME}")
endfunction()

0 comments on commit be7cb4e

Please sign in to comment.