change install directory to /opt

This commit is contained in:
张壹 2021-07-31 16:07:15 +08:00
parent bc5671c373
commit e59ec89fed
3 changed files with 6 additions and 5 deletions

View File

@ -7,7 +7,8 @@ if(${CMAKE_HOST_SYSTEM_NAME} STREQUAL "Linux")
set(CMAKE_INSTALL_PREFIX /usr/local)
elseif (${CMAKE_HOST_SYSTEM_NAME} STREQUAL "Darwin")
message(STATUS "Platform: " ${CMAKE_HOST_SYSTEM_NAME})
set(CMAKE_INSTALL_PREFIX /usr/local)
#
set(CMAKE_INSTALL_PREFIX /opt)
elseif (${CMAKE_HOST_SYSTEM_NAME} STREQUAL "Windows")
message(STATUS "Platform: " ${CMAKE_HOST_SYSTEM_NAME})
# 使MinGW GCC

View File

@ -38,7 +38,7 @@ if(${CMAKE_HOST_SYSTEM_NAME} STREQUAL "Linux")
target_link_libraries(tess_static m.a)
endif()
#
# /opt/lib
if(WIN32)
install(TARGETS tess DESTINATION lib)
install(TARGETS tess_static DESTINATION lib)
@ -50,5 +50,5 @@ endif()
#
file(GLOB LIBTESS_HEAD *.h)
# /opt/include/tess
install(FILES ${LIBTESS_HEAD} DESTINATION include/tess)

View File

@ -22,8 +22,8 @@ macro(add_tools name)
set_target_properties(${name} PROPERTIES INSTALL_RPATH ${CMAKE_INSTALL_PREFIX}/lib)
#
target_link_libraries(${name} PUBLIC tess)
# /usr/local/sbin
install(TARGETS ${name} RUNTIME DESTINATION sbin/tess)
# /opt/bin/tess
install(TARGETS ${name} RUNTIME DESTINATION bin/tess)
endmacro()
# tools