I run cmake in the path "${PROJECT_NAME}/build", and I want generate the executable file in "${PROJECT_NAME}/bin" not "${PROJECT_NAME}/build".
When I used "ADD_EXECUTABLE(../bin/${PROJECT_NAME} ${sources})", I got the error: The target name "../bin/xxxx" is reserved or not valid for certain CMake features, such as generator expressions, and may result in undefined behavior.
Then I changed to "ADD_EXECUTABLE(${PROJECT_NAME} ${sources})", it passed, but it's generated in "${PROJECT_NAME}/build".
What can I do?