Skip to content

Commit

Permalink
pig-config fixes
Browse files Browse the repository at this point in the history
  • Loading branch information
evaleev committed Nov 26, 2016
1 parent a7ce7de commit aa03747
Show file tree
Hide file tree
Showing 2 changed files with 17 additions and 3 deletions.
19 changes: 16 additions & 3 deletions external/madness.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,17 @@ include(ConvertLibrariesListToCompilerArgs)

find_package(MADNESS 0.10.1 CONFIG QUIET COMPONENTS world HINTS ${MADNESS_ROOT_DIR})

macro(replace_mad_targets_with_libnames _mad_libraries _mad_config_libs)
set(${_mad_config_libs} )
foreach (_lib ${${_mad_libraries}})
if (${_lib} MATCHES "MAD*")
set(${_mad_config_libs} "${${_mad_config_libs}} -l${_lib}")
else ()
set(${_mad_config_libs} "${${_mad_config_libs}} ${_lib}")
endif()
endforeach()
endmacro()

if(MADNESS_FOUND)

cmake_push_check_state()
Expand Down Expand Up @@ -67,7 +78,8 @@ if(MADNESS_FOUND)

# Set config variables
list(APPEND TiledArray_CONFIG_INCLUDE_DIRS ${MADNESS_INCLUDE_DIRS})
set(TiledArray_CONFIG_LIBRARIES ${MADNESS_LIBRARIES} ${TiledArray_CONFIG_LIBRARIES})
replace_mad_targets_with_libnames(MADNESS_LIBRARIES MADNESS_CONFIG_LIBRARIES)
list(APPEND TiledArray_CONFIG_LIBRARIES ${MADNESS_CONFIG_LIBRARIES})
set(TiledArray_LIBRARIES ${MADNESS_LIBRARIES} ${TiledArray_LIBRARIES})


Expand Down Expand Up @@ -344,8 +356,9 @@ else()
# Set build dependencies and compiler arguments
add_dependencies(External build-madness)

# Set config variables
list(APPEND TiledArray_CONFIG_LIBRARIES ${MADNESS_LIBRARIES})
# Set config variables
replace_mad_targets_with_libnames(MADNESS_LIBRARIES MADNESS_CONFIG_LIBRARIES)
list(APPEND TiledArray_CONFIG_LIBRARIES ${MADNESS_CONFIG_LIBRARIES})

endif()

Expand Down
1 change: 1 addition & 0 deletions tiledarray.pc.in
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
Name: tiledarray
Description: A modern C++ library for block-sparse tensor computation
Version: @TILEDARRAY_VERSION@
URL: https://github.com/ValeevGroup/tiledarray
Cflags: -I@CMAKE_INSTALL_PREFIX@/include @CMAKE_CXX_FLAGS@ @TiledArray_PC_CFLAGS@
Libs: -L@CMAKE_INSTALL_PREFIX@/lib @CMAKE_EXE_LINKER_FLAGS@ @TiledArray_PC_LIBS@

0 comments on commit aa03747

Please sign in to comment.