Skip to content

Commit

Permalink
In Debug, depend on Totalview include directories if given
Browse files Browse the repository at this point in the history
  • Loading branch information
Arlie-Capps committed Sep 26, 2023
1 parent 5d59a39 commit 39c9e8c
Show file tree
Hide file tree
Showing 3 changed files with 46 additions and 1 deletion.
11 changes: 11 additions & 0 deletions src/cmake/Setup3rdParty.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -183,3 +183,14 @@ if(CALIPER_DIR)
message(FATAL_ERROR "CALIPER_DIR is set, but Caliper wasn't found.")
endif()
endif()

################################
# Setup Totalview if available
################################
# Search for Totalview.
if(TOTALVIEW_DIR)
include(cmake/thirdparty/SetupTotalview.cmake)
if(NOT TOTALVIEW_FOUND)
message(WARNING "TOTALVIEW_DIR is set, but Totalview wasn't found.")
endif()
endif()
28 changes: 28 additions & 0 deletions src/cmake/thirdparty/SetupTotalview.cmake
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
# Copyright (c) Lawrence Livermore National Security, LLC and other Conduit
# Project developers. See top-level LICENSE AND COPYRIGHT files for dates and
# other details. No copyright assignment is required to contribute to Conduit.
###############################################################################
#
# Setup TOTALVIEW


# first Check for TOTALVIEW_DIR

if(TOTALVIEW_DIR)

find_path(TOTALVIEW_INCLUDE_DIRECTORIES
tv_data_display.h
NO_DEFAULT_PATH
PATHS ${TOTALVIEW_DIR}/include)

find_path(TOTALVIEW_SOURCE_DIRECTORY
tv_data_display.c
NO_DEFAULT_PATH
PATHS ${TOTALVIEW_DIR}/src)

if (TOTALVIEW_INCLUDE_DIRECTORIES)
set(TOTALVIEW_FOUND TRUE)
set(CONDUIT_USE_TOTALVIEW TRUE)
endif()

endif()
8 changes: 7 additions & 1 deletion src/libs/conduit/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -98,6 +98,11 @@ set(conduit_sources
conduit_annotations.cpp
)

if(TOTALVIEW_FOUND)
list(APPEND conduit_sources $<$<CONFIG:Debug>:debug/conduit_node_totalview.cpp>)
list(APPEND conduit_sources $<$<CONFIG:Debug>:${TOTALVIEW_SOURCE_DIRECTORY}/tv_data_display.c>)
endif()

#
# Specify conduit c interface sources
#
Expand Down Expand Up @@ -164,7 +169,8 @@ add_compiled_library(NAME conduit
target_include_directories(conduit
PUBLIC
$<BUILD_INTERFACE:${CMAKE_CURRENT_SOURCE_DIR}>
$<BUILD_INTERFACE:${CMAKE_CURRENT_BINARY_DIR}>)
$<BUILD_INTERFACE:${CMAKE_CURRENT_BINARY_DIR}>
$<$<AND:$<BOOL:TOTALVIEW_FOUND>,$<CONFIG:Debug>>:${TOTALVIEW_INCLUDE_DIRECTORIES}>)


#################################
Expand Down

0 comments on commit 39c9e8c

Please sign in to comment.