Hey guys,
we are using Ninja Multi Config for Windows and Cross Platform ARM embedded builds.
On Windows (native) Ninja multi Config Works fine, however our Cross Platform Target Build needs some extra custom commands.
The simplified syntax is as follows
add_executable( ${APP_NAME} ${APP_SRC} )
target_include_directories(${APP_NAME} PRIVATE ...)
target_link_libraries(${APP_NAME} PRIVATE ...)
# ###########################################################
# create map files
# ###########################################################
add_custom_command(
TARGET "${APP_NAME}"
POST_BUILD
COMMAND ${CMAKE_NM} --format=sysv --demangle --line-numbers "${PROJECT_BINARY_DIR}/bin/${APP_NAME}${CMAKE_EXECUTABLE_SUFFIX}" > "${PROJECT_BINARY_DIR}/bin/map/${APP_NAME}.nmap")
Now as you can see the custom command expects the binary to be located in ./bin.
However - due to the multi config generator - the binary is now located in
./bin/Debug
or
./bin/Release
How can I get the actual binary path? CMAKE_CURRENT_BINARY points to the ./bin folder and not the ./bin/Debug folder.
Thx for your help