Skip to content

Commit

Permalink
use CMAKE_INSTALL_LIBDIR variable instead of hardcoded lib in CmakeLi…
Browse files Browse the repository at this point in the history
…sts.ext (tdlib#895)
  • Loading branch information
locez authored and levlam committed Jan 23, 2020
1 parent 6b1ef9d commit 5efaf8c
Showing 1 changed file with 8 additions and 4 deletions.
12 changes: 8 additions & 4 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,10 @@ cmake_minimum_required(VERSION 3.0.2 FATAL_ERROR)

project(TDLib VERSION 1.5.5 LANGUAGES CXX C)

if (NOT DEFINED CMAKE_INSTALL_LIBDIR)
set(CMAKE_INSTALL_LIBDIR "lib")
endif(NOT DEFINED CMAKE_INSTALL_LIBDIR)

if (POLICY CMP0054)
# do not expand quoted arguments
cmake_policy(SET CMP0054 NEW)
Expand Down Expand Up @@ -909,16 +913,16 @@ add_library(Td::TdJson ALIAS TdJson)
add_library(Td::TdJsonStatic ALIAS TdJsonStatic)

install(TARGETS tdjson TdJson tdjson_static TdJsonStatic tdjson_private tdclient tdcore TdStatic EXPORT TdTargets
LIBRARY DESTINATION lib
ARCHIVE DESTINATION lib
LIBRARY DESTINATION ${CMAKE_INSTALL_LIBDIR}
ARCHIVE DESTINATION ${CMAKE_INSTALL_LIBDIR}
RUNTIME DESTINATION bin
INCLUDES DESTINATION include
)

install(EXPORT TdTargets
FILE TdTargets.cmake
NAMESPACE Td::
DESTINATION lib/cmake/Td
DESTINATION ${CMAKE_INSTALL_LIBDIR}/cmake/Td
)

install(FILES ${TD_JSON_HEADERS} ${CMAKE_CURRENT_BINARY_DIR}/td/telegram/tdjson_export.h DESTINATION include/td/telegram)
Expand All @@ -935,7 +939,7 @@ write_basic_package_version_file("TdConfigVersion.cmake"
COMPATIBILITY ExactVersion
)
install(FILES "TdConfig.cmake" "${CMAKE_CURRENT_BINARY_DIR}/TdConfigVersion.cmake"
DESTINATION lib/cmake/Td
DESTINATION ${CMAKE_INSTALL_LIBDIR}/cmake/Td
)

# Add SOVERSION to shared libraries
Expand Down

0 comments on commit 5efaf8c

Please sign in to comment.