File tree Expand file tree Collapse file tree 2 files changed +17
-3
lines changed
Expand file tree Collapse file tree 2 files changed +17
-3
lines changed Original file line number Diff line number Diff line change @@ -16,6 +16,17 @@ include(ConvertLibrariesListToCompilerArgs)
1616
1717find_package (MADNESS 0.10.1 CONFIG QUIET COMPONENTS world HINTS ${MADNESS_ROOT_DIR} )
1818
19+ macro (replace_mad_targets_with_libnames _mad_libraries _mad_config_libs)
20+ set (${_mad_config_libs} )
21+ foreach (_lib ${${_mad_libraries} })
22+ if (${_lib} MATCHES "MAD*" )
23+ set (${_mad_config_libs} "${${_mad_config_libs} } -l${_lib} " )
24+ else ()
25+ set (${_mad_config_libs} "${${_mad_config_libs} } ${_lib} " )
26+ endif ()
27+ endforeach ()
28+ endmacro ()
29+
1930if (MADNESS_FOUND)
2031
2132 cmake_push_check_state()
@@ -67,7 +78,8 @@ if(MADNESS_FOUND)
6778
6879 # Set config variables
6980 list (APPEND TiledArray_CONFIG_INCLUDE_DIRS ${MADNESS_INCLUDE_DIRS} )
70- set (TiledArray_CONFIG_LIBRARIES ${MADNESS_LIBRARIES} ${TiledArray_CONFIG_LIBRARIES} )
81+ replace_mad_targets_with_libnames(MADNESS_LIBRARIES MADNESS_CONFIG_LIBRARIES)
82+ list (APPEND TiledArray_CONFIG_LIBRARIES ${MADNESS_CONFIG_LIBRARIES} )
7183 set (TiledArray_LIBRARIES ${MADNESS_LIBRARIES} ${TiledArray_LIBRARIES} )
7284
7385
@@ -344,8 +356,9 @@ else()
344356 # Set build dependencies and compiler arguments
345357 add_dependencies (External build -madness)
346358
347- # Set config variables
348- list (APPEND TiledArray_CONFIG_LIBRARIES ${MADNESS_LIBRARIES} )
359+ # Set config variables
360+ replace_mad_targets_with_libnames(MADNESS_LIBRARIES MADNESS_CONFIG_LIBRARIES)
361+ list (APPEND TiledArray_CONFIG_LIBRARIES ${MADNESS_CONFIG_LIBRARIES} )
349362
350363endif ()
351364
Original file line number Diff line number Diff line change 11Name: tiledarray
22Description: A modern C++ library for block-sparse tensor computation
33Version: @TILEDARRAY_VERSION@
4+ URL: https://github.com/ValeevGroup/tiledarray
45Cflags: -I@CMAKE_INSTALL_PREFIX@/include @CMAKE_CXX_FLAGS@ @TiledArray_PC_CFLAGS@
56Libs: -L@CMAKE_INSTALL_PREFIX@/lib @CMAKE_EXE_LINKER_FLAGS@ @TiledArray_PC_LIBS@
You can’t perform that action at this time.
0 commit comments