Skip to content

Commit

Permalink
Use CMAKE_INSTALL_LIBDIR for library installation path
Browse files Browse the repository at this point in the history
  • Loading branch information
eclipseo committed May 26, 2024
1 parent 5bd9cf7 commit 97fab94
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 2 deletions.
10 changes: 8 additions & 2 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -21,8 +21,14 @@ project(merkaartor VERSION ${VCS_VERSION})
# compatibility.
# Using configure_file() allows us to store the metadata in a .cpp file, thus
# only rebuilding that one and linking.
set(SHARE_DIR ${CMAKE_INSTALL_PREFIX}/share/merkaartor)
set(LIB_DIR ${CMAKE_INSTALL_PREFIX}/lib/merkaartor)
if (${CMAKE_SYSTEM_NAME} MATCHES "Linux")
include(GNUInstallDirs)
set(SHARE_DIR ${CMAKE_INSTALL_PREFIX}/${CMAKE_INSTALL_DATAROOTDIR}/merkaartor)
set(LIB_DIR ${CMAKE_INSTALL_PREFIX}/${CMAKE_INSTALL_LIBDIR}/merkaartor)
else()
set(SHARE_DIR ${CMAKE_INSTALL_PREFIX}/share/merkaartor)
set(LIB_DIR ${CMAKE_INSTALL_PREFIX}/lib/merkaartor)
endif()
configure_file("${PROJECT_SOURCE_DIR}/cmake/build-metadata.cpp.in" "${PROJECT_BINARY_DIR}/build-metadata.cpp" @ONLY)

set(CMAKE_CXX_STANDARD 17)
Expand Down
2 changes: 2 additions & 0 deletions plugins/plugins.cmake
Original file line number Diff line number Diff line change
@@ -1,6 +1,8 @@

if (APPLE)
set(PLUGINS_INSTALL_POSTFIX "merkaartor.app/Contents/plugins")
elseif (${CMAKE_SYSTEM_NAME} MATCHES "Linux")
set(PLUGINS_INSTALL_POSTFIX "${CMAKE_INSTALL_PREFIX}/${CMAKE_INSTALL_LIBDIR}/merkaartor/plugins")
else()
set(PLUGINS_INSTALL_POSTFIX "lib/merkaartor/plugins")
endif()
Expand Down

0 comments on commit 97fab94

Please sign in to comment.