Skip to content

Commit 5bba3ff

Browse files
committed
Install into proper subdirectories on Linux
1 parent 4266851 commit 5bba3ff

File tree

3 files changed

+8
-5
lines changed

3 files changed

+8
-5
lines changed

CMakeLists.txt

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,9 @@ include(CTest)
99
include(CheckFunctionExists)
1010
include(CheckIncludeFiles)
1111

12+
# install into proper lib dirs on Linux
13+
include(GNUInstallDirs)
14+
1215
# platform checks
1316
foreach(header inttypes memory stdint stdlib strings sys/stat sys/types unistd time)
1417
string(REPLACE "/" "_" underscore_header "${header}")

cmake/export.cmake

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@ set(CMP0090 NEW)
55
# set up installion of exported targets (consider libzsync2 a namespace for use in CMake)
66
install(
77
TARGETS libzsync2
8-
DESTINATION lib
8+
DESTINATION ${CMAKE_INSTALL_LIBDIR}
99
EXPORT libzsync2
1010
)
1111

src/CMakeLists.txt

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -51,8 +51,8 @@ target_link_libraries(zsyncmake2 PRIVATE cpr)
5151
# install targets
5252
install(
5353
TARGETS zsync2 libzsync2 zsyncmake2
54-
RUNTIME DESTINATION bin
55-
LIBRARY DESTINATION lib
56-
ARCHIVE DESTINATION lib/static
57-
INCLUDES DESTINATION include
54+
RUNTIME DESTINATION ${CMAKE_INSTALL_BINDIR}
55+
LIBRARY DESTINATION ${CMAKE_INSTALL_LIBDIR}
56+
ARCHIVE DESTINATION ${CMAKE_INSTALL_LIBDIR}
57+
INCLUDES DESTINATION ${CMAKE_INSTALL_INCLUDEDIR}
5858
)

0 commit comments

Comments
 (0)