diff --git a/test/core/ProcessEnabledTpls/CMakeLists.txt b/test/core/ProcessEnabledTpls/CMakeLists.txt index da1dcee88..7edf1f627 100644 --- a/test/core/ProcessEnabledTpls/CMakeLists.txt +++ b/test/core/ProcessEnabledTpls/CMakeLists.txt @@ -344,6 +344,40 @@ create_process_enabled_tpls_test_case( ) + create_process_enabled_tpls_test_case( + HeadersAndLibsTpl_Shared_PerLibrarySetting + TPL_NAME HeadersAndLibsTpl + TPL_FINDMOD ${HeadersAndLibsTpl_FINDMOD} + INCLUDE_DIRS ${HeadersAndLibsTpl_BASE_DIR}/include + LIBRARY_DIRS ${HeadersAndLibsTpl_BASE_DIR}/lib + EXTRA_ARGS -DHeadersAndLibsTpl_FIND_SHARED_LIBS=ON + PASS_REGULAR_EXPRESSION_ALL + "Processing enabled external package/TPL: HeadersAndLibsTpl .enabled explicitly, disable with -DTPL_ENABLE_HeadersAndLibsTpl=OFF." + "-- Must find at least one lib in each of the lib sets .haltpl1[;]haltpl2." + "-- Searching for libs in HeadersAndLibsTpl_LIBRARY_DIRS='.+/HeadersAndLibsTpl/lib'" + "-- Searching for a lib in the set .haltpl1.:" + "-- Searching for lib 'haltpl1' [.][.][.]" + "-- Found lib '.+/HeadersAndLibsTpl/lib/libhaltpl1.so'" + "-- Searching for a lib in the set .haltpl2.:" + "-- Searching for lib 'haltpl2' [.][.][.]" + "-- Found lib '.+/HeadersAndLibsTpl/lib/libhaltpl2.so'" + "-- TPL_HeadersAndLibsTpl_LIBRARIES='.+/HeadersAndLibsTpl/lib/libhaltpl1.so[;].+/HeadersAndLibsTpl/lib/libhaltpl2.so'" + "-- Must find at least one header in each of the header sets .HeadersAndLibsTpl_header1.hpp[;]HeadersAndLibsTpl_header2.hpp." + "-- Searching for headers in HeadersAndLibsTpl_INCLUDE_DIRS='.+/HeadersAndLibsTpl/include'" + "-- Searching for a header file in the set .HeadersAndLibsTpl_header1.hpp.:" + "-- Searching for header 'HeadersAndLibsTpl_header1.hpp' [.][.][.]" + "-- Found header '.+/HeadersAndLibsTpl/include/?/HeadersAndLibsTpl_header1.hpp'" + "-- Searching for a header file in the set .HeadersAndLibsTpl_header2.hpp.:" + "-- Searching for header 'HeadersAndLibsTpl_header2.hpp' [.][.][.]" + "-- Found header '.+/HeadersAndLibsTpl/include/?/HeadersAndLibsTpl_header2.hpp'" + "-- Found TPL 'HeadersAndLibsTpl' include dirs '.+/HeadersAndLibsTpl/include'" + "-- TPL_HeadersAndLibsTpl_INCLUDE_DIRS='.+/HeadersAndLibsTpl/include'" + "Exported TPL_HeadersAndLibsTpl_NOT_FOUND='FALSE'" + "Exported TPL_HeadersAndLibsTpl_LIBRARIES='.+/HeadersAndLibsTpl/lib/libhaltpl1.so[;].+/HeadersAndLibsTpl/lib/libhaltpl2.so'" + "Exported TPL_HeadersAndLibsTpl_INCLUDE_DIRS='.+/HeadersAndLibsTpl/include'" + ) + + create_process_enabled_tpls_test_case( HeadersAndLibsTpl_Shared_FindAll_sets1 TPL_NAME HeadersAndLibsTpl diff --git a/tribits/core/package_arch/TribitsTplFindIncludeDirsAndLibraries.cmake b/tribits/core/package_arch/TribitsTplFindIncludeDirsAndLibraries.cmake index 722d0710a..1aea34933 100644 --- a/tribits/core/package_arch/TribitsTplFindIncludeDirsAndLibraries.cmake +++ b/tribits/core/package_arch/TribitsTplFindIncludeDirsAndLibraries.cmake @@ -411,10 +411,15 @@ function(tribits_tpl_find_include_dirs_and_libraries TPL_NAME) #print_var(TPL_CMAKE_FIND_LIBRARY_SUFFIXES_DEFAULT) endif() + # Allow per-TPL shared lib find setting + if (NOT DEFINED ${TPL_NAME}_FIND_SHARED_LIBS) + set(${TPL_NAME}_FIND_SHARED_LIBS ${TPL_FIND_SHARED_LIBS}) + endif() + #print_var(TPL_FIND_SHARED_LIBS) #print_var(CMAKE_FIND_LIBRARY_SUFFIXES) # Set libraries to find - if (TPL_FIND_SHARED_LIBS) + if (${TPL_NAME}_FIND_SHARED_LIBS) # The default should be to find shared libs first set(TPL_CMAKE_FIND_LIBRARY_SUFFIXES ${TPL_CMAKE_FIND_LIBRARY_SUFFIXES_DEFAULT}) else()