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

Fix cmake script to respect the CMAKE_INSTALL_LIBDIR / CMAKE_INSTALL_BINDIR settings for all platforms #792

Open
wants to merge 2 commits into
base: main
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
16 changes: 12 additions & 4 deletions cmake/AwsSharedLibSetup.cmake
Original file line number Diff line number Diff line change
@@ -1,13 +1,21 @@
# Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.
# SPDX-License-Identifier: Apache-2.0.

set(LIBRARY_DIRECTORY lib)
set(RUNTIME_DIRECTORY bin)
if(DEFINED CMAKE_INSTALL_LIBDIR)
set(LIBRARY_DIRECTORY ${CMAKE_INSTALL_LIBDIR})
else()
set(LIBRARY_DIRECTORY lib)
endif()

if(DEFINED CMAKE_INSTALL_BINDIR)
set(RUNTIME_DIRECTORY ${CMAKE_INSTALL_BINDIR})
else()
set(RUNTIME_DIRECTORY bin)
endif()

# Set the default lib installation path on GNU systems with GNUInstallDirs
if (UNIX AND NOT APPLE)
include(GNUInstallDirs)
set(LIBRARY_DIRECTORY ${CMAKE_INSTALL_LIBDIR})
set(RUNTIME_DIRECTORY ${CMAKE_INSTALL_BINDIR})

# this is the absolute dumbest thing in the world, but find_package won't work without it
# also I verified this is correctly NOT "lib64" when CMAKE_C_FLAGS includes "-m32"
Expand Down