Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Make LIBRARY_OUTPUT_DIRECTORY a cache entry (editable) #4432

Open
danny-mhlv opened this issue Jan 31, 2024 · 2 comments
Open

Make LIBRARY_OUTPUT_DIRECTORY a cache entry (editable) #4432

danny-mhlv opened this issue Jan 31, 2024 · 2 comments
Labels

Comments

@danny-mhlv
Copy link

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.

@aleks-f
Copy link
Member

aleks-f commented Feb 1, 2024

@danny-mhlv please send a pull request

@andrewauclair
Copy link
Contributor

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)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

3 participants