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

cmake: Switch to GNUInstallDirs #742

Merged
merged 1 commit into from
Jan 12, 2024
Merged
Show file tree
Hide file tree
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
12 changes: 5 additions & 7 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -196,17 +196,15 @@ add_subdirectory(docs)
########################################################################
# Detect /lib versus /lib64
########################################################################
if (${CMAKE_INSTALL_LIBDIR} MATCHES lib64)
set(LIB_SUFFIX 64)
endif()
include(GNUInstallDirs)

########################################################################
# Setup the package config file
########################################################################
#set variables found in the pc.in file
set(prefix ${CMAKE_INSTALL_PREFIX})
set(exec_prefix "\${prefix}")
set(libdir "\${exec_prefix}/lib${LIB_SUFFIX}")
set(libdir "\${exec_prefix}/${CMAKE_INSTALL_LIBDIR}")
set(includedir "\${prefix}/include")

configure_file(
Expand All @@ -216,15 +214,15 @@ configure_file(

install(
FILES ${CMAKE_CURRENT_BINARY_DIR}/volk.pc
DESTINATION lib${LIB_SUFFIX}/pkgconfig
DESTINATION ${CMAKE_INSTALL_LIBDIR}/pkgconfig
COMPONENT "volk_devel"
)

########################################################################
# Install all headers in the include directories
########################################################################
set(VOLK_RUNTIME_DIR bin)
set(VOLK_LIBRARY_DIR lib${LIB_SUFFIX})
set(VOLK_LIBRARY_DIR ${CMAKE_INSTALL_LIBDIR})
set(VOLK_INCLUDE_DIR include)

install(
Expand Down Expand Up @@ -314,7 +312,7 @@ configure_file(
########################################################################

if(NOT CMAKE_MODULES_DIR)
set(CMAKE_MODULES_DIR lib${LIB_SUFFIX}/cmake)
set(CMAKE_MODULES_DIR ${CMAKE_INSTALL_LIBDIR}/cmake)
endif(NOT CMAKE_MODULES_DIR)

install(
Expand Down
8 changes: 4 additions & 4 deletions cmake/Modules/FindORC.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@
FIND_PACKAGE(PkgConfig)
PKG_CHECK_MODULES(PC_ORC "orc-0.4 > 0.4.11")


INCLUDE(GNUInstallDirs)


FIND_PROGRAM(ORCC_EXECUTABLE orcc
Expand All @@ -23,15 +23,15 @@ FIND_PATH(ORC_INCLUDE_DIR NAMES orc/orc.h

FIND_PATH(ORC_LIBRARY_DIR NAMES ${CMAKE_SHARED_LIBRARY_PREFIX}orc-0.4${CMAKE_SHARED_LIBRARY_SUFFIX}
HINTS ${PC_ORC_LIBDIR}
PATHS ${ORC_ROOT}/lib${LIB_SUFFIX} ${CMAKE_INSTALL_PREFIX}/lib${LIB_SUFFIX})
PATHS ${ORC_ROOT}/${CMAKE_INSTALL_LIBDIR} ${CMAKE_INSTALL_PREFIX}/${CMAKE_INSTALL_LIBDIR})

FIND_LIBRARY(ORC_LIB orc-0.4
HINTS ${PC_ORC_LIBRARY_DIRS}
PATHS ${ORC_ROOT}/lib${LIB_SUFFIX} ${CMAKE_INSTALL_PREFIX}/lib${LIB_SUFFIX})
PATHS ${ORC_ROOT}/${CMAKE_INSTALL_LIBDIR} ${CMAKE_INSTALL_PREFIX}/${CMAKE_INSTALL_LIBDIR})

FIND_LIBRARY(ORC_LIBRARY_STATIC liborc-0.4.a
HINTS ${PC_ORC_LIBRARY_DIRS}
PATHS ${ORC_ROOT}/lib${LIB_SUFFIX} ${CMAKE_INSTALL_PREFIX}/lib${LIB_SUFFIX})
PATHS ${ORC_ROOT}/${CMAKE_INSTALL_LIBDIR} ${CMAKE_INSTALL_PREFIX}/${CMAKE_INSTALL_LIBDIR})

LIST(APPEND ORC_LIBRARY
${ORC_LIB}
Expand Down
8 changes: 4 additions & 4 deletions lib/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -568,9 +568,9 @@ set_target_properties(volk PROPERTIES DEFINE_SYMBOL "volk_EXPORTS")
#Install locations
install(TARGETS volk
EXPORT VOLK-export
LIBRARY DESTINATION lib${LIB_SUFFIX} COMPONENT "volk_runtime" # .so file
ARCHIVE DESTINATION lib${LIB_SUFFIX} COMPONENT "volk_devel" # .lib file
RUNTIME DESTINATION bin COMPONENT "volk_runtime" # .dll file
LIBRARY DESTINATION ${CMAKE_INSTALL_LIBDIR} COMPONENT "volk_runtime" # .so file
ARCHIVE DESTINATION ${CMAKE_INSTALL_LIBDIR} COMPONENT "volk_devel" # .lib file
RUNTIME DESTINATION bin COMPONENT "volk_runtime" # .dll file
)

#Configure static library
Expand Down Expand Up @@ -609,7 +609,7 @@ if(ENABLE_STATIC_LIBS)

install(TARGETS volk_static
EXPORT VOLK-export
ARCHIVE DESTINATION lib${LIB_SUFFIX} COMPONENT "volk_devel"
ARCHIVE DESTINATION ${CMAKE_INSTALL_LIBDIR} COMPONENT "volk_devel"
)
endif(ENABLE_STATIC_LIBS)

Expand Down
Loading