poco icon indicating copy to clipboard operation
poco copied to clipboard

Make LIBRARY_OUTPUT_DIRECTORY a cache entry (editable)

Open danny-mhlv opened this issue 1 year ago • 3 comments

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 avatar Jan 31 '24 12:01 danny-mhlv

@danny-mhlv please send a pull request

aleks-f avatar Feb 01 '24 11:02 aleks-f

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)

andrewauclair avatar May 02 '24 12:05 andrewauclair