diff --git a/src/CMakeLists.txt b/src/CMakeLists.txt index 29b69c5c..4da45b62 100644 --- a/src/CMakeLists.txt +++ b/src/CMakeLists.txt @@ -4,6 +4,8 @@ project(openvr_api) set( LIBNAME "openvr_api" ) set(OPENVR_HEADER_DIR ${CMAKE_CURRENT_SOURCE_DIR}/../headers) +include(GNUInstallDirs) + # Set some properies for specific files. if(APPLE) set(CMAKE_MACOSX_RPATH 1) @@ -101,7 +103,7 @@ endif() target_link_libraries(${LIBNAME} ${EXTRA_LIBS} ${CMAKE_DL_LIBS}) target_include_directories(${LIBNAME} PUBLIC ${OPENVR_HEADER_DIR}) -install(TARGETS ${LIBNAME} DESTINATION lib) +install(TARGETS ${LIBNAME} DESTINATION ${CMAKE_INSTALL_LIBDIR}) install(FILES ${PUBLIC_HEADER_FILES} DESTINATION include/openvr) # Generate a .pc file for linux environments diff --git a/src/openvr.pc.in b/src/openvr.pc.in index 3edba91c..0041a5ce 100644 --- a/src/openvr.pc.in +++ b/src/openvr.pc.in @@ -1,6 +1,6 @@ prefix=@CMAKE_INSTALL_PREFIX@ exec_prefix=${prefix} -libdir=${prefix}/lib +libdir=@CMAKE_INSTALL_FULL_LIBDIR@ includedir=${prefix}/include/openvr Name: openvr