build: allow overriding installation directories

More sensible defaults and allow for overriding. Also make PDB installation
optional on Windows if RelWithDebInfo isn't the build type being used.

CMAKE_INSTALL_PREFIX defaults to GStreamer install location on Windows and
/usr/lib on other platforms.

PLUGIN_INSTALL_DIR defaults to CMAKE_INSTALL_PREFIX/gstreamer-1.0

LIBRARY_INSTALL_DIR defaults to CMAKE_INSTALL_PREFIX/

PDB_INSTALL_DIR defaults to CMAKE_INSTALL_PREFIX/
This commit is contained in:
Joshua M. Doe
2020-04-15 09:11:40 -04:00
parent 2a8fc2f84d
commit 26e05b7058
25 changed files with 80 additions and 108 deletions

View File

@@ -27,8 +27,6 @@ target_link_libraries (${libname}
)
if (WIN32)
set (pdbfile "${CMAKE_CURRENT_BINARY_DIR}/\${CMAKE_INSTALL_CONFIG_NAME}/lib${libname}.pdb")
install (FILES ${pdbfile} DESTINATION lib/gstreamer-1.0 COMPONENT pdb)
install (FILES $<TARGET_PDB_FILE:${libname}> DESTINATION ${PDB_INSTALL_DIR} COMPONENT pdb OPTIONAL)
endif ()
install(TARGETS ${libname}
LIBRARY DESTINATION lib/gstreamer-1.0)
install(TARGETS ${libname} LIBRARY DESTINATION ${PLUGIN_INSTALL_DIR})