Skip to content

Commit

Permalink
Use GNUInstallDirs
Browse files Browse the repository at this point in the history
Import and use GNUInstallDirs from CMake
  • Loading branch information
win8linux committed May 22, 2024
1 parent 93f494c commit 966226d
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 4 deletions.
2 changes: 2 additions & 0 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -151,6 +151,8 @@ option(TV_OPTIMIZE_BUILD "Use CMake's Precompiled Headers" ON)

option(TV_BUILD_AVSCOLOR "Build AviSynth TermColor plugin" OFF)

include(GNUInstallDirs)

tv_message_mp(STATUS "Install path: ${CMAKE_INSTALL_PREFIX}")
tv_message(STATUS "Build Examples: ${TV_BUILD_EXAMPLES}")
if (MAY_BUILD_USING_GPM)
Expand Down
2 changes: 1 addition & 1 deletion examples/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ if (TV_BUILD_EXAMPLES)
# Until CMake 3.13, 'install' only accepts targets defined
# in the current directory. So install from this function.
if (${app} IN_LIST TVINSTALLAPPS)
install(TARGETS ${app} RUNTIME DESTINATION bin)
install(TARGETS ${app} RUNTIME DESTINATION ${CMAKE_INSTALL_BINDIR})
endif()
endfunction()

Expand Down
6 changes: 3 additions & 3 deletions source/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -153,14 +153,14 @@ tv_set_output_dir(${PROJECT_NAME})
#
install(TARGETS ${PROJECT_NAME}
EXPORT ${PROJECT_NAME}-config
ARCHIVE DESTINATION lib
ARCHIVE DESTINATION ${CMAKE_INSTALL_LIBDIR}
COMPONENT library
)

# package configuration

install(EXPORT ${PROJECT_NAME}-config
DESTINATION lib/cmake/${PROJECT_NAME}
DESTINATION ${CMAKE_INSTALL_LIBDIR}/cmake/${PROJECT_NAME}
NAMESPACE ${PROJECT_NAME}::
FILE ${PROJECT_NAME}-config.cmake
COMPONENT library
Expand All @@ -169,7 +169,7 @@ install(EXPORT ${PROJECT_NAME}-config
# includes
# ./include/tvision and children copied to destination/include/tvision etc...
#
install(DIRECTORY "${PROJECT_SOURCE_DIR}/include/tvision" DESTINATION include)
install(DIRECTORY "${PROJECT_SOURCE_DIR}/include/tvision" DESTINATION ${CMAKE_INSTALL_INCLUDEDIR})

# Build optimization

Expand Down

0 comments on commit 966226d

Please sign in to comment.