cmake: Use GnuInstallDirs to customize install directories
Replace custom LIB_INSTALL_DIR with standard CMAKE_INSTALL_LIBDIR variable.
For backward compatibility, set CMAKE_INSTALL_LIBDIR if LIB_INSTALL_DIR is set.
Signed-off-by: Biswapriyo Nath <nathbappai@gmail.com>
diff --git a/CMakeLists.txt b/CMakeLists.txt
index 0fccd3d..11ca1c9 100644
--- a/CMakeLists.txt
+++ b/CMakeLists.txt
@@ -39,6 +39,8 @@
project("mbed TLS" C)
endif()
+include(GNUInstallDirs)
+
# Determine if mbed TLS is being built as a subproject using add_subdirectory()
if(NOT DEFINED MBEDTLS_AS_SUBPROJECT)
set(MBEDTLS_AS_SUBPROJECT ON)
@@ -249,8 +251,7 @@
endif(CMAKE_BUILD_TYPE STREQUAL "Coverage")
if(LIB_INSTALL_DIR)
-else()
- set(LIB_INSTALL_DIR lib)
+ set(CMAKE_INSTALL_LIBDIR "${LIB_INSTALL_DIR}")
endif()
add_subdirectory(include)