Skip to content

Commit

Permalink
CMake: Use GNUInstallDirs
Browse files Browse the repository at this point in the history
  • Loading branch information
jschueller committed Jun 5, 2023
1 parent 3b525df commit e9b1f29
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 7 deletions.
11 changes: 5 additions & 6 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -43,16 +43,15 @@ if (MSVC)
set (CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} /wd4197 /wd4244 /wd4251 /wd4267 /wd4996")
endif ()

if (NOT DEFINED CMAKE_INSTALL_LIBDIR)
set (CMAKE_INSTALL_LIBDIR lib${LIB_SUFFIX})
endif ()
include (GNUInstallDirs)

set (OTMORRIS_LIBRARY_PATH ${CMAKE_INSTALL_LIBDIR})
set (OTMORRIS_INCLUDE_PATH include)
set (OTMORRIS_BIN_PATH ${CMAKE_INSTALL_BINDIR})
set (OTMORRIS_INCLUDE_PATH ${CMAKE_INSTALL_INCLUDEDIR})
set (OTMORRIS_SWIG_INCLUDE_DIRS ${OTMORRIS_INCLUDE_PATH}/${PACKAGE_NAME}/swig)
set (OTMORRIS_DATA_PATH share)
set (OTMORRIS_DATA_PATH ${CMAKE_INSTALL_DATAROOTDIR})
set (OTMORRIS_CONFIG_CMAKE_PATH ${CMAKE_INSTALL_LIBDIR}/cmake/otmorris)
set (OTMORRIS_DOC_PATH share/${PACKAGE_NAME}/doc)
set (OTMORRIS_DOC_PATH ${CMAKE_INSTALL_DATAROOTDIR}/${PACKAGE_NAME}/doc)

set (CMAKE_CXX_STANDARD 11)

Expand Down
2 changes: 1 addition & 1 deletion lib/src/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@ install(EXPORT OTMORRIS-Targets

install(TARGETS otmorris
EXPORT OTMORRIS-Targets
RUNTIME DESTINATION bin
RUNTIME DESTINATION ${OTMORRIS_BIN_PATH}
LIBRARY DESTINATION ${OTMORRIS_LIBRARY_PATH}
ARCHIVE DESTINATION ${OTMORRIS_LIBRARY_PATH}
)
Expand Down

0 comments on commit e9b1f29

Please sign in to comment.