CMake 3.24 ignoring *_OUTPUT_DIRECTORY when used with CMakePresets
Hi,
I'm using cmake through visual studio to build a Ninja based project.
I'm on VS 2022 17.4.1 with cmake version 3.24.202208181-MSVC_2
and a CMakePreset with version 4 defined.
In the past, I had properties defined like this for some of my targets:
set_target_properties(${PROJECT_NAME}
PROPERTIES
OUTPUT_NAME ${${PROJECT_NAME}_OUTPUT}
PREFIX ""
ARCHIVE_OUTPUT_DIRECTORY "${PYTHON_FOLDER}"
COMPILE_PDB_OUTPUT_DIRECTORY "${PYTHON_FOLDER}"
PDB_OUTPUT_DIRECTORY "${PYTHON_FOLDER}"
EXECUTABLE_OUTPUT_DIRECTORY "${PYTHON_FOLDER}"
RUNTIME_OUTPUT_DIRECTORY "${PYTHON_FOLDER}"
LIBRARY_OUTPUT_DIRECTORY "${PYTHON_FOLDER}"
SUFFIX ${COMPILED_PYTHON_LIBRARY_SUFFIXX}
)
and my dll's and others would end up in the ${PYTHON_FOLDER}
.
But since switching to Presets, all of my outputs are ending up in the default output path of:
${CMAKE_SOURCE_DIR}\out\build\${MY-PRESET's-NAME}\
then \bin
or \lib
which is not what I expected.
I have other parts of my cmake project that has these variables defined:
set(CMAKE_LIBRARY_OUTPUT_DIRECTORY "${OUTPUT_PATH}/plugins")
set(CMAKE_ARCHIVE_OUTPUT_DIRECTORY "${OUTPUT_PATH}/plugins")
set(CMAKE_RUNTIME_OUTPUT_DIRECTORY "${OUTPUT_PATH}/plugins")
but they are ignored and end up in the binary dir.
What can I do to force them to compile to the right paths?