CMAKE_XXX_OUTPUT_DIRECTORY vs. target properties XXX_OUTPUT_DIRECTORY

Hello,

my goal is to use the CMAKE_XXX_OUTPUT_DIRECTORY variables to set the default location for the built binaries and use the respective target property XXX_OUTPUT_DIRECTORY (e.g. LIBRARY_OUTPUT_DIRECTORY) for specific targets to place the respective files in a different location in the build folder. According to the documentation this should work as the values of the global variables are used to set the value of the target property of the targets when they are created so i would guess that changing the property values would reflect in the output path.
The problem is now that changing the target property has no effect on the output path. Things i already double-checked:

  • the value of the property is correctly set, verified using get_target_property()
  • the name of the target is correct as setting the XXX_OUTPUT_NAME works and is reflected in the filename
  • if the global variables are not set before, the property works and the output path is correct

what am i missing here?
thx!

to answer my own question: the problem was that also the CMAKE_LIBRARY_OUTPUT_DIRECTORY_<BUILD_TYPE> was set so the target property LIBRARY_OUTPUT_DIRECTORY_<BUILD_TYPE> had to be set to change to output dir of the target.