Make LIBRARY_OUTPUT_DIRECTORY a cache entry (editable)
Is your feature request related to a problem? Please describe.
While using POCO in my project I've encountered a problem specifying output directory for POCO's .so files.
It's unable to change it the standard CMake way, see below.
Describe the solution you'd like
I think it's quite convenient to set CMAKE_LIBRARY_OUTPUT_DIRECTORY as CACHE.
set(CMAKE_LIBRARY_OUTPUT_DIRECTORY ${CMAKE_BINARY_DIR}/lib)
set(CMAKE_LIBRARY_OUTPUT_DIRECTORY ${CMAKE_BINARY_DIR}/lib CACHE PATH "...")
Describe alternatives you've considered
As I am aware there are no alternatives, but to change CMAKE_LIBRARY_OUTPUT_DIRECTORY to be set as CACHE.
@danny-mhlv please send a pull request
I think there's still an issue with this related to multi-configs because of the below code in the root CMakeLists.txt. I'm going to give it a look later today.
# Reset output dirs for multi-config builds
foreach(OUTPUTCONFIG ${CMAKE_CONFIGURATION_TYPES})
string(TOUPPER ${OUTPUTCONFIG} OUTPUTCONFIG)
set(CMAKE_RUNTIME_OUTPUT_DIRECTORY_${OUTPUTCONFIG} ${CMAKE_BINARY_DIR}/bin)
set(CMAKE_LIBRARY_OUTPUT_DIRECTORY_${OUTPUTCONFIG} ${CMAKE_BINARY_DIR}/lib)
set(CMAKE_ARCHIVE_OUTPUT_DIRECTORY_${OUTPUTCONFIG} ${CMAKE_BINARY_DIR}/lib)
endforeach(OUTPUTCONFIG)