Skip to content

Commit aa03747

Browse files
committed
pig-config fixes
1 parent a7ce7de commit aa03747

File tree

2 files changed

+17
-3
lines changed

2 files changed

+17
-3
lines changed

external/madness.cmake

Lines changed: 16 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,17 @@ include(ConvertLibrariesListToCompilerArgs)
1616

1717
find_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+
1930
if(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

350363
endif()
351364

tiledarray.pc.in

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
11
Name: tiledarray
22
Description: A modern C++ library for block-sparse tensor computation
33
Version: @TILEDARRAY_VERSION@
4+
URL: https://github.com/ValeevGroup/tiledarray
45
Cflags: -I@CMAKE_INSTALL_PREFIX@/include @CMAKE_CXX_FLAGS@ @TiledArray_PC_CFLAGS@
56
Libs: -L@CMAKE_INSTALL_PREFIX@/lib @CMAKE_EXE_LINKER_FLAGS@ @TiledArray_PC_LIBS@

0 commit comments

Comments
 (0)