blob: 6fc914b60f620ac0c4fc3d2d1b77bdc62bcb6ad6 [file] [log] [blame]
Austin Schuh36244a12019-09-21 17:52:38 -07001include(GNUInstallDirs)
2
3# absl_VERSION is only set if we are an LTS release being installed, in which
4# case it may be into a system directory and so we need to make subdirectories
5# for each installed version of Abseil. This mechanism is implemented in
6# Abseil's internal Copybara (https://github.com/google/copybara) workflows and
7# isn't visible in the CMake buildsystem itself.
8
9if(absl_VERSION)
10 set(ABSL_SUBDIR "${PROJECT_NAME}_${PROJECT_VERSION}")
11 set(ABSL_INSTALL_BINDIR "${CMAKE_INSTALL_BINDIR}/${ABSL_SUBDIR}")
12 set(ABSL_INSTALL_CONFIGDIR "${CMAKE_INSTALL_LIBDIR}/cmake/${ABSL_SUBDIR}")
Austin Schuhb4691e92020-12-31 12:37:18 -080013 set(ABSL_INSTALL_INCLUDEDIR "${CMAKE_INSTALL_INCLUDEDIR}/${ABSL_SUBDIR}")
Austin Schuh36244a12019-09-21 17:52:38 -070014 set(ABSL_INSTALL_LIBDIR "${CMAKE_INSTALL_LIBDIR}/${ABSL_SUBDIR}")
15else()
16 set(ABSL_INSTALL_BINDIR "${CMAKE_INSTALL_BINDIR}")
17 set(ABSL_INSTALL_CONFIGDIR "${CMAKE_INSTALL_LIBDIR}/cmake/${PROJECT_NAME}")
18 set(ABSL_INSTALL_INCLUDEDIR "${CMAKE_INSTALL_INCLUDEDIR}")
19 set(ABSL_INSTALL_LIBDIR "${CMAKE_INSTALL_LIBDIR}")
Austin Schuhb4691e92020-12-31 12:37:18 -080020endif()