Skip to content

Commit

Permalink
improve LCIConfig.cmake.in
Browse files Browse the repository at this point in the history
PACKAGE_CMAKE_INSTALL_XXX can be changed by find_dependency
  • Loading branch information
JiakunYan committed Nov 7, 2024
1 parent be92b52 commit a2cf58f
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions LCIConfig.cmake.in
Original file line number Diff line number Diff line change
Expand Up @@ -3,15 +3,15 @@ if (NOT TARGET LCI::LCT)
@PACKAGE_INIT@

LIST(APPEND CMAKE_MODULE_PATH "${CMAKE_CURRENT_LIST_DIR}/LCI")
include(CMakeFindDependencyMacro)

set_and_check(LCT_INCLUDE_DIRS "@PACKAGE_CMAKE_INSTALL_INCLUDEDIR@")
set_and_check(LCT_SHARED_LIBRARY "@PACKAGE_CMAKE_INSTALL_LIBDIR@/@CMAKE_SHARED_LIBRARY_PREFIX@lct@CMAKE_SHARED_LIBRARY_SUFFIX@")

include(CMakeFindDependencyMacro)
set(CMAKE_THREAD_PREFER_PTHREAD TRUE)
set(THREADS_PREFER_PTHREAD_FLAG TRUE)
find_dependency(Threads)

set_and_check(LCT_INCLUDE_DIRS "@PACKAGE_CMAKE_INSTALL_INCLUDEDIR@")
set_and_check(LCT_SHARED_LIBRARY "@PACKAGE_CMAKE_INSTALL_LIBDIR@/@CMAKE_SHARED_LIBRARY_PREFIX@lct@CMAKE_SHARED_LIBRARY_SUFFIX@")

add_library(LCI::LCT SHARED IMPORTED)
set_target_properties(LCI::LCT PROPERTIES
IMPORTED_LOCATION ${LCT_SHARED_LIBRARY}
Expand Down

0 comments on commit a2cf58f

Please sign in to comment.