Skip to content

Commit

Permalink
sync to main
Browse files Browse the repository at this point in the history
  • Loading branch information
alfredh committed Jan 1, 2024
1 parent 4f5cae2 commit 2d439ae
Showing 1 changed file with 9 additions and 11 deletions.
20 changes: 9 additions & 11 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -99,7 +99,7 @@ if(CMAKE_C_COMPILER_ID MATCHES "Clang")
endif()

set(re_DIR ${CMAKE_CURRENT_LIST_DIR}/cmake)
include("${CMAKE_CURRENT_LIST_DIR}/cmake/re-config.cmake")
find_package(re CONFIG REQUIRED)

list(APPEND RE_DEFINITIONS
-DRE_VERSION="${PROJECT_VERSION_FULL}"
Expand Down Expand Up @@ -648,7 +648,7 @@ endif()
if(LIBRE_BUILD_STATIC)
list(APPEND RE_INSTALL_TARGETS re)
add_library(re STATIC $<TARGET_OBJECTS:re-objs>)
target_link_libraries(re PRIVATE ${RE_LIBS})
target_link_libraries(re PUBLIC ${RE_LIBS})
target_include_directories(re PUBLIC
$<BUILD_INTERFACE:${CMAKE_CURRENT_SOURCE_DIR}/include>
)
Expand Down Expand Up @@ -676,7 +676,7 @@ if(NOT PC_LIBNAME)
endif()
set(PC_REQUIRES "")
set(PC_LINKLIBS "")
foreach(item IN LISTS LINKLIBS)
foreach(item IN LISTS RE_LIBS)
if(item STREQUAL "Threads::Threads")
list(APPEND PC_LINKLIBS ${CMAKE_THREADS_LIBS_INIT})
elseif(item STREQUAL "OpenSSL::Crypto")
Expand Down Expand Up @@ -704,9 +704,6 @@ configure_file(packaging/libre.pc.in libre.pc @ONLY)

install(TARGETS ${RE_INSTALL_TARGETS}
EXPORT libre
RUNTIME
DESTINATION ${CMAKE_INSTALL_BINDIR}
COMPONENT Libraries
LIBRARY
DESTINATION ${CMAKE_INSTALL_LIBDIR}
COMPONENT Libraries
Expand All @@ -725,9 +722,7 @@ install(FILES ${HEADERS}

install(EXPORT libre
DESTINATION ${CMAKE_INSTALL_LIBDIR}/cmake/libre
FILE libre-targets.cmake
NAMESPACE libre::
COMPONENT Development
)

if(LIBRE_BUILD_SHARED)
Expand All @@ -739,9 +734,12 @@ if(LIBRE_BUILD_SHARED)
)
endif()

configure_file("${CMAKE_CURRENT_SOURCE_DIR}/cmake/libre-config.cmake"
"${CMAKE_CURRENT_BINARY_DIR}/cmake/libre-config.cmake" @ONLY)
install(FILES "${CMAKE_CURRENT_BINARY_DIR}/cmake/libre-config.cmake"
install(FILES cmake/re-config.cmake
DESTINATION ${CMAKE_INSTALL_LIBDIR}/cmake/re
COMPONENT Development
)

install(FILES cmake/libre-config.cmake
DESTINATION ${CMAKE_INSTALL_LIBDIR}/cmake/libre
COMPONENT Development
)
Expand Down

0 comments on commit 2d439ae

Please sign in to comment.