Pack Utf8Proc stuff
Make the package required when USE_UTF8PROC IS ON. Use target_compile_definitions(), target_include_directories() and target_link_libraries().
This commit is contained in:
committed by
Yen Chi Hsuan
parent
b1f37a882c
commit
a8d994803d
+13
-7
@@ -53,12 +53,7 @@ include(qtermwidget5_use)
|
||||
option(USE_UTF8PROC "Use libutf8proc for better Unicode support. Default OFF" OFF)
|
||||
|
||||
if(USE_UTF8PROC)
|
||||
find_package(Utf8Proc)
|
||||
endif()
|
||||
|
||||
if (UTF8PROC_FOUND)
|
||||
add_definitions(-DHAVE_UTF8PROC)
|
||||
include_directories("${UTF8PROC_INCLUDE_DIRS}")
|
||||
find_package(Utf8Proc REQUIRED)
|
||||
endif()
|
||||
|
||||
# main library
|
||||
@@ -148,8 +143,19 @@ set_target_properties( ${QTERMWIDGET_LIBRARY_NAME} PROPERTIES
|
||||
VERSION ${QTERMWIDGET_VERSION}
|
||||
)
|
||||
if (UTF8PROC_FOUND)
|
||||
target_link_libraries(${QTERMWIDGET_LIBRARY_NAME} ${UTF8PROC_LIBRARIES})
|
||||
target_compile_definitions(${QTERMWIDGET_LIBRARY_NAME}
|
||||
PRIVATE
|
||||
"HAVE_UTF8PROC"
|
||||
)
|
||||
target_include_directories(${QTERMWIDGET_LIBRARY_NAME}
|
||||
INTERFACE
|
||||
${UTF8PROC_INCLUDE_DIRS}
|
||||
)
|
||||
target_link_libraries(${QTERMWIDGET_LIBRARY_NAME}
|
||||
${UTF8PROC_LIBRARIES}
|
||||
)
|
||||
endif()
|
||||
|
||||
if(APPLE)
|
||||
set (CMAKE_SKIP_RPATH 1)
|
||||
# this is a must to load the lib correctly
|
||||
|
||||
Reference in New Issue
Block a user