diff --git a/src/CMake/PluginVsInstallHelpers.cmake b/src/CMake/PluginVsInstallHelpers.cmake index e11217648b..2a4a6c1ccd 100644 --- a/src/CMake/PluginVsInstallHelpers.cmake +++ b/src/CMake/PluginVsInstallHelpers.cmake @@ -274,17 +274,17 @@ if(VISIT_MPICH_INSTALL) "${f0_VISIT_PARALLEL_INCLUDE}") string(REPLACE "${VISIT_MPICH_DIR}/lib" "\${VISIT_LIBRARY_DIR}" - f0_VISIT_PARALLEL_DEFS - "${VISIT_PARALLEL_DEFS}") + f0_VISIT_PARALLEL_DEFINES + "${VISIT_PARALLEL_DEFINES}") string(REPLACE "${VISIT_MPICH_DIR}/include" "\${VISIT_ROOT_INCLUDE_DIR}/mpich/include" - filtered_VISIT_PARALLEL_DEFS - "${f0_VISIT_PARALLEL_DEFS}") + filtered_VISIT_PARALLEL_DEFINES + "${f0_VISIT_PARALLEL_DEFINES}") else(VISIT_MPICH_INSTALL) set(filtered_VISIT_PARALLEL_CXXFLAGS "${VISIT_PARALLEL_CXXFLAGS}") set(filtered_VISIT_PARALLEL_LINKER_FLAGS "${VISIT_PARALLEL_LINKER_FLAGS}") set(filtered_VISIT_PARALLEL_LIBS "${VISIT_PARALLEL_LIBS}") set(filtered_VISIT_PARALLEL_INCLUDE "${VISIT_PARALLEL_INCLUDE}") - set(filtered_VISIT_PARALLEL_DEFS "${VISIT_PARALLEL_DEFS}") + set(filtered_VISIT_PARALLEL_DEFINES "${VISIT_PARALLEL_DEFINES}") endif(VISIT_MPICH_INSTALL) # Fix some third-party include paths that are different on windows than unix. diff --git a/src/CMake/VisItMacros.cmake b/src/CMake/VisItMacros.cmake index 9e87d26b4e..d91f7287e5 100644 --- a/src/CMake/VisItMacros.cmake +++ b/src/CMake/VisItMacros.cmake @@ -77,7 +77,7 @@ function(ADD_PARALLEL_LIBRARY target) else() ADD_TARGET_INCLUDE(${target} ${VISIT_PARALLEL_INCLUDE}) - ADD_TARGET_DEFINITIONS(${target} ${VISIT_PARALLEL_DEFS}) + ADD_TARGET_DEFINITIONS(${target} ${VISIT_PARALLEL_DEFINES}) endif() if(NOT VISIT_NOLINK_MPI_WITH_LIBRARIES) target_link_libraries(${target} ${VISIT_PARALLEL_LIBS}) @@ -255,9 +255,116 @@ macro(visit_append_list) endmacro() ############################################################################## -# Adds a library target. Wrapper around blt_add_library so that CACHE vars -# possibly created by visit_append_list for forming SOURCES/INCLUDES, etc -# can be unset. +# patch a target with new sources, headers, etc: +# +# After visit-specific args are parsed and handled, +# all args are passed directly to blt_patch_target. +# +# The visit-specific args must appear first in the caller argument list +# before blt-specific, otherwise blt swallows them up with one of the args it +# does understand, causing issues. +# +# ARGUMENTS: +# NAME target name REQUIRED +# +# visit-specific (not handled by blt_patch_target) +# +# SOURCES [source1 [source2 ...]] OPTIONAL +# HEADERS [header1 [header2 ...]] OPTIONAL +# LINKDIR OPTIONAL +# +# pass-through to blt_patch_target: +# +# INCLUDES [dir1 [dir2 ...]] OPTIONAL +# DEFINES [define1 [define2 ...]] OPTIONAL +# DEPENDS_ON [dep1 ...] OPTIONAL +# +############################################################################## + +macro(visit_patch_target) + # need to parse everything that VisIt recognizes and everything that + # BLT recognizes, otherwise there ends up being issues. + set(singleValueArgs NAME) + set(multiValueArgs SOURCES HEADERS LINKDIR INCLUDES DEFINES DEPENDS_ON) + # parse the arguments + cmake_parse_arguments(vpt "" "${singleValueArgs}" "${multiValueArgs}" ${ARGN}) + + if(NOT vpt_NAME) + message(FATAL_ERROR "visit_patch_target() must be called with argument NAME ") + endif() + if(NOT TARGET ${vpt_NAME}) + message(FATAL_ERROR " attempting to patch ${vpt_NAME} but it is NOT a target!") + endif() + if (vpt_SOURCES OR vpt_HEADERS) + target_sources(${vpt_NAME} PRIVATE ${vpt_SOURCES} ${vpt_HEADERS}) + endif() + if (vpt_LINKDIR) + target_link_directories(${vpt_NAME} PRIVATE ${vpt_LINKDIR}) + endif() + blt_patch_target(${ARGV}) +endmacro() + + +############################################################################## +# Patches target with parallel specific additions common to all VisIt +# parallel targets whether library or executable. +# +# ARGUMENTS: +# NAME target name REQUIRED +# +############################################################################## + +macro(visit_patch_parallel_target) + + cmake_parse_arguments(vppt "" "NAME" "" ${ARGN}) + if(NOT vppt_NAME) + message(FATAL_ERROR "visit_patch_parallel_target() must be called with argument NAME ") + endif() + + if(UNIX) + if(VISIT_PARALLEL_CXXFLAGS) + set_property(TARGET ${vppt_NAME} APPEND + PROPERTY COMPILE_FLAGS ${VISIT_PARALLEL_CXXFLAGS}) + endif() + if(VISIT_PARALLEL_LINK_FLAGS) + set_property(TARGET ${vppt_NAME} APPEND + PROPERTY LINK_FLAGS ${VISIT_PARALLEL_LINK_FLAGS}) + endif() + + if(${CMAKE_INSTALL_RPATH}) + string(REPLACE " " ";" CPAR_RPATHS ${CAKE_INSTALL_RPATH}) + set_property(TARGET ${vppt_NAME} APPEND PROPERTY + INSTALL_RPATH ${CPAR_RPATHS}) + endif() + + if(VISIT_PARALLEL_RPATH) + set_property(TARGET ${vppt_NAME} APPEND PROPERTY + INSTALL_RPATH ${VISIT_PARALLEL_RPATH}) + endif() + if(VISIT_PARALLEL_DEFINES) + visit_patch_target( + NAME ${vppt_NAME} + DEFINES ${VISIT_PARALLEL_DEFINES}) + + endif() + else() + visit_patch_target( + NAME ${vppt_NAME} + INCLUDES ${VISIT_PARALLEL_INCLUDE} + DEFINES ${VISIT_PARALLEL_DEFINES}) + endif() + if(NOT VISIT_NOLINK_MPI_WITH_LIBRARIES AND VISIT_PARALLEL_LIBS) + visit_patch_target( + NAME ${vppt_NAME} + LINKDIR ${VISIT_PARALLEL_LINK_DIRS} + DEPENDS_ON ${VISIT_PARALLEL_LIBS}) + endif() +endmacro() + +############################################################################## +# Adds a library target. +# calls blt_add_library +# clears cache vars. # # ARGUMENTS: # NAME library name REQUIRED @@ -268,12 +375,17 @@ endmacro() # DEPENDS_ON [dep1 ...] OPTIONAL # OUTPUT_NAME [name] OPTIONAL # FEATURES [feat1 [feat2 ...]] OPTIONAL -# FOLDER [name]) OPTIONAL +# FOLDER [name] OPTIONAL +# SKIP_INSTALL OPTIONAL (visit only) +# +# Modifications: +# Kathleen Biags, Thu Oct 24, 2024 +# Added SKIP_INSTALL to indicate the target should not be installed. # ############################################################################## macro(visit_add_library) - set(options) + set(options SKIP_INSTALL) set(singleValueArgs NAME OUTPUT_NAME FOLDER) set(multiValueArgs SOURCES HEADERS INCLUDES DEFINES DEPENDS_ON FEATURES) @@ -285,7 +397,6 @@ macro(visit_add_library) if(NOT val_NAME) message(FATAL_ERROR "visit_add_library() must be called with argument NAME ") endif() - if (NOT val_SOURCES AND NOT val_HEADERS) message(FATAL_ERROR "visit_add_library(NAME ${val_NAME} ...) called with no given sources or headers (at least one is required).") endif() @@ -305,7 +416,9 @@ macro(visit_add_library) target_compile_features(${val_NAME} PRIVATE ${val_FEATURES}) endif() - visit_install_export_targets(${val_NAME}) + if(NOT ${val_SKIP_INSTALL}) + visit_install_export_targets(${val_NAME}) + endif() # vars that may have been created by calls to visit_append_list unset(${val_NAME}_SOURCES CACHE) @@ -317,81 +430,18 @@ macro(visit_add_library) endmacro() ############################################################################## -# Like visit_add_library, but adds parallel compile/link options. -# Taken mostly from VISIT_ADD_PARALLEL_LIBRARY +# Adds a parallel library target. +# calls visit_add_library +# calls visit_patch_parallel_target to set all the parallel options for the +# target # -# ARGUMENTS: -# NAME target name REQUIRED -# SOURCES [source1 [source2 ...]] REQUIRED -# HEADERS [header1 [header2 ...]] OPTIONAL -# INCLUDES [dir1 [dir2 ...]] OPTIONAL -# DEFINES [define1 [define2 ...]] OPTIONAL -# DEPENDS_ON [dep1 ...] OPTIONAL -# FOLDER [name]) OPTIONAL +# See visit_add_library for arguments. # ############################################################################## macro(visit_add_parallel_library) - visit_add_library(${ARGV}) - cmake_parse_arguments(vapl "" "NAME" "" ${ARGN}) - - if(UNIX) - if(VISIT_PARALLEL_CXXFLAGS) - # check for compile flags vs includes - set(PAR_COMPILE_FLAGS "") - set(PAR_INCLUDE "") - string(REPLACE " " ";" VISIT_PARALLEL_CXXFLAGS ${VISIT_PARALLEL_CXXFLAGS}) - foreach(X ${VISIT_PARALLEL_CXXFLAGS}) - string(SUBSTRING ${X} 0 2 is_include) - if(is_include STREQUAL "-I") - string(SUBSTRING ${X} 2 -1 x_as_include) - list(APPEND PAR_INCLUDE $) - else() - list(APPEND PAR_COMPILE_FLAGS "${X}") - endif() - endforeach() - target_include_directories(${vapl_NAME} PUBLIC ${PAR_INCLUDE}) - target_compile_options(${vapl_NAME} PUBLIC ${PAR_COMPILE_FLAGS}) - - endif() - - if(VISIT_PARALLEL_LINKER_FLAGS) - set(PAR_LINK_FLAGS "") - set(PAR_LINK_DIR "") - string(REPLACE " " ";" VISIT_PARALLEL_LINKER_FLAGS ${VISIT_PARALLEL_LINKER_FLAGS}) - foreach(X ${VISIT_PARALLEL_LINKER_FLAGS}) - string(SUBSTRING ${X} 0 2 is_link_dir) - if(is_link_dir STREQUAL "-L") - string(SUBSTRING ${X} 2 -1 x_as_link) - list(APPEND PAR_LINK_DIR ${x_as_link}) - else() - list(APPEND PAR_LINK_FLAGS "${X}") - endif() - endforeach() - target_link_options(${vapl_NAME} PUBLIC ${PAR_LINK_FLAGS}) - target_link_directories(${vapl_NAME} PUBLIC ${PAR_LINK_DIR}) - endif() - - if(VISIT_PARALLEL_RPATH) - set(PAR_RPATHS "") - foreach(X ${CMAKE_INSTALL_RPATH}) - list(APPEND PAR_RPATHS ${X}) - endforeach() - foreach(X ${VISIT_PARALLEL_RPATH}) - list(APPEND PAR_RPATHS ${X}) - endforeach() - set_property(TARGET ${vapl_NAME} - APPEND PROPERTY INSTALL_RPATH ${PAR_RPATHS}) - endif() - else() # not on unix - target_include_directories(${vapl_NAME} PUBLIC $) - target_compile_definitions(${vapl_NAME} PUBLIC ${VISIT_PARALLEL_DEFS}) - endif() - - if(NOT VISIT_NOLINK_MPI_WITH_LIBRARIES) - target_link_libraries(${vapl_NAME} PUBLIC ${VISIT_PARALLEL_LIBS}) - endif() + visit_patch_parallel_target(NAME ${vapl_NAME}) endmacro() diff --git a/src/CMake/VisItParallel.cmake b/src/CMake/VisItParallel.cmake index 334c8ba9c5..2e7ade6f1a 100644 --- a/src/CMake/VisItParallel.cmake +++ b/src/CMake/VisItParallel.cmake @@ -31,7 +31,7 @@ function(DETECT_MPI_SETTINGS COMP mlibs mflags mlflags mrpath) endforeach() set(${mlibs} ${MPI_LIBRARIES} CACHE STRING "MPI libraries") - set(${mflags} "-DPARALLEL -DMPICH_IGNORE_CXX_SEEK ${MPI_INCLUDE_PATH_CONV} ${MPI_COMPILE_FLAGS}" CACHE STRING "Parallel compiler flags") + set(${mflags} "${MPI_INCLUDE_PATH_CONV} ${MPI_COMPILE_FLAGS}" CACHE STRING "Parallel compiler flags") set(${mlflags} "${MPI_LINK_FLAGS}" CACHE STRING "Parallel linker flags") # @@ -59,41 +59,28 @@ function(ADD_PARALLEL_EXECUTABLE target) if(UNIX) if(VISIT_PARALLEL_CXXFLAGS) - set(PAR_COMPILE_FLAGS "") - foreach(X ${VISIT_PARALLEL_CXXFLAGS}) - set(PAR_COMPILE_FLAGS "${PAR_COMPILE_FLAGS} ${X}") - endforeach() set_target_properties(${target} PROPERTIES - COMPILE_FLAGS ${PAR_COMPILE_FLAGS} - ) + COMPILE_FLAGS ${VISIT_PARALLEL_CXXFLAGS}) + endif() + target_compile_definitions(${target} PRIVATE ${VISIT_PARALLEL_DEFINES}) - if(VISIT_PARALLEL_LINKER_FLAGS) - set(PAR_LINK_FLAGS "") - foreach(X ${VISIT_PARALLEL_LINKER_FLAGS}) - set(PAR_LINK_FLAGS "${PAR_LINK_FLAGS} ${X}") - endforeach() - set_target_properties(${target} PROPERTIES - LINK_FLAGS ${PAR_LINK_FLAGS} - ) - endif() + if(VISIT_PARALLEL_LINK_FLAGS) + set_target_properties(${target} PROPERTIES + LINK_FLAGS ${VISIT_PARALLEL_LINK_FLAGS}) + endif() + if(VISIT_PARALLEL_LINK_DIRS) + set_target_properties(${target} PROPERTIES + LINK_DIRECTORIES ${VISIT_PARALLEL_LINK_DIRS}) + endif() - if(VISIT_PARALLEL_RPATH) - set(PAR_RPATHS "") - foreach(X ${CMAKE_INSTALL_RPATH}) - set(PAR_RPATHS "${PAR_RPATHS} ${X}") - endforeach() - foreach(X ${VISIT_PARALLEL_RPATH}) - set(PAR_RPATHS "${PAR_RPATHS} ${X}") - endforeach() - set_target_properties(${target} PROPERTIES - INSTALL_RPATH ${PAR_RPATHS} - ) - endif() + if(VISIT_PARALLEL_RPATH) + set_target_properties(${target} PROPERTIES + INSTALL_RPATH "${VISIT_PARALLEL_RPATH};${CMAKE_INSTALL_RPATH}") endif() else() - ADD_TARGET_INCLUDE(${target} ${VISIT_PARALLEL_INCLUDE}) - ADD_TARGET_DEFINITIONS(${target} ${VISIT_PARALLEL_DEFS}) - target_link_libraries(${target} ${VISIT_PARALLEL_LIBS}) + target_include_directories(${target} PRIVATE ${VISIT_PARALLEL_INCLUDE}) + target_compile_definitions(${target} PRIVATE ${VISIT_PARALLEL_DEFINES}) + target_link_libraries(${target} PRIVATE ${VISIT_PARALLEL_LINK_LIBS}) endif() # If we're on doing this "nolink mpi" option, we rely on the @@ -112,8 +99,8 @@ function(ADD_PARALLEL_FORTRAN_EXECUTABLE target) set(PAR_COMPILE_FLAGS "${PAR_COMPILE_FLAGS} ${X}") endforeach() set_target_properties(${target} PROPERTIES - COMPILE_FLAGS ${PAR_COMPILE_FLAGS} - ) + COMPILE_FLAGS ${PAR_COMPILE_FLAGS}) + target_compile_definitions(${target} PRIVATE ${VISIT_PARALLEL_DEFINES}) if(VISIT_PARALLEL_FORTRAN_LINKER_FLAGS) set(PAR_LINK_FLAGS "") @@ -153,11 +140,7 @@ function(PARALLEL_EXECUTABLE_LINK_LIBRARIES target) endfunction() -if(WIN32) - set(VPFLAGS "PARALLEL MPICH_IGNORE_CXX_SEEK MPICH_SKIP_MPICXX OMPI_SKIP_MPICXX MPI_NO_CPPBIND") -else() - set(VPFLAGS "-DPARALLEL -DMPICH_IGNORE_CXX_SEEK -DMPICH_SKIP_MPICXX -DOMPI_SKIP_MPICXX -DMPI_NO_CPPBIND") -endif() +set(VISIT_PARALLEL_DEFINES "PARALLEL;MPICH_IGNORE_CXX_SEEK;MPICH_SKIP_MPICXX;OMPI_SKIP_MPICXX;MPI_NO_CPPBIND" CACHE STRING "Parallel compiler defines") if(VISIT_MPI_COMPILER) message(STATUS "Setting up MPI using compiler wrapper") @@ -170,18 +153,16 @@ if(VISIT_MPI_COMPILER) VISIT_PARALLEL_RPATH) set(VISIT_PARALLEL_CXXFLAGS ${VISIT_PARALLEL_CFLAGS} CACHE STRING "Parallel CXXFLAGS") - set(VISIT_PARALLEL_CFLAGS "${VPFLAGS} ${VISIT_PARALLEL_CFLAGS}") - set(VISIT_PARALLEL_CXXFLAGS "${VPFLAGS} ${VISIT_PARALLEL_CXXFLAGS}") # Detect the MPI settings that Fortran wants if(VISIT_FORTRAN AND VISIT_MPI_FORTRAN_COMPILER) DETECT_MPI_SETTINGS(${VISIT_MPI_FORTRAN_COMPILER} VISIT_PARALLEL_FORTRAN_LIBS + VISIT_PARALLEL_FORTRAN_DEFS VISIT_PARALLEL_FORTRAN_FLAGS VISIT_PARALLEL_FORTRAN_LINKER_FLAGS VISIT_PARALLEL_RPATH ) - set(VISIT_PARALLEL_FORTRAN_FLAGS "${VPFLAGS} ${VISIT_PARALLEL_FORTRAN_FLAGS}") endif() else() @@ -193,26 +174,26 @@ else() CACHE STRING "MPI libraries for Fortran") if(VISIT_MPI_C_FLAGS) - set(VISIT_PARALLEL_CFLAGS " ${VPFLAGS} ${VISIT_MPI_C_FLAGS}" + set(VISIT_PARALLEL_CFLAGS "${VISIT_MPI_C_FLAGS}" CACHE STRING "Parallel CFLAGS") else() - set(VISIT_PARALLEL_CFLAGS "${VPFLAGS}" + set(VISIT_PARALLEL_CFLAGS "" CACHE STRING "Parallel CFLAGS") endif() if(VISIT_MPI_CXX_FLAGS) - set(VISIT_PARALLEL_CXXFLAGS "${VPFLAGS} ${VISIT_MPI_CXX_FLAGS}" + set(VISIT_PARALLEL_CXXFLAGS "${VISIT_MPI_CXX_FLAGS}" CACHE STRING "Parallel CXXFLAGS") else() - set(VISIT_PARALLEL_CXXFLAGS "${VPFLAGS}" + set(VISIT_PARALLEL_CXXFLAGS "" CACHE STRING "Parallel CXXFLAGS") endif() if(VISIT_MPI_FORTRAN_FLAGS) - set(VISIT_PARALLEL_FORTRAN_FLAGS "${VPFLAGS} ${VISIT_MPI_FORTRAN_FLAGS}" + set(VISIT_PARALLEL_FORTRAN_FLAGS "${VISIT_MPI_FORTRAN_FLAGS}" CACHE STRING "Parallel Fortran flags") else() - set(VISIT_PARALLEL_FORTRAN_FLAGS "${VPFLAGS}" + set(VISIT_PARALLEL_FORTRAN_FLAGS "" CACHE STRING "Parallel flags for Fortran") endif() @@ -232,9 +213,6 @@ else() if(NOT MPI_FOUND) include(${CMAKE_ROOT}/Modules/FindMPI.cmake) if(MPI_FOUND) - string(REPLACE " " ";" VPFLAGS "${VPFLAGS}") - set(VISIT_PARALLEL_DEFS "${VPFLAGS}" - CACHE STRING "parallel defines") set(VISIT_PARALLEL_LIBS "${MPI_LIBRARY}" CACHE STRING "MPI libraries") set(VISIT_PARALLEL_INCLUDE "${MPI_INCLUDE_PATH}" @@ -269,17 +247,39 @@ else() endif() endif() - unset(VPFLAGS) endif() +# prepare these for direct use in cmake calls +if(VISIT_PARALLEL_CXXFLAGS) + string(REPLACE " " ";" VISIT_PARALLEL_CXXFLAGS ${VISIT_PARALLEL_CXXFLAGS}) +endif() +if(VISIT_PARALLEL_LINKER_FLAGS) + string(REPLACE " " ";" VISIT_PARALLEL_LINKER_FLAGS ${VISIT_PARALLEL_LINKER_FLAGS}) +endif() +if(VISIT_PARALLEL_RPATH) + string(REPLACE " " ";" VISIT_PARALLEL_RPATH ${VISIT_PARALLEL_RPATH}) +endif() + +# Separate link dirs from other flags +foreach(plf ${VISIT_PARALLEL_LINKER_FLAGS}) + string(SUBSTRING ${plf} 0 2 lf_type) + if(lf_type STREQUAL "-L") + string(SUBSTRING ${plf} 2 -1 lf_dir) + list(APPEND VISIT_PARALLEL_LINK_DIRS ${lf_dir}) + else() + list(APPEND VISIT_PARALLEL_LINK_FLAGS ${plf}) + endif() +endforeach() + message(STATUS "Parallel version of VisIt") message(STATUS " VISIT_PARALLEL_CFLAGS = ${VISIT_PARALLEL_CFLAGS}") message(STATUS " VISIT_PARALLEL_CXXFLAGS = ${VISIT_PARALLEL_CXXFLAGS}") -message(STATUS " VISIT_PARALLEL_LINKER_FLAGS = ${VISIT_PARALLEL_LINKER_FLAGS}") +message(STATUS " VISIT_PARALLEL_LINK_FLAGS = ${VISIT_PARALLEL_LINK_FLAGS}") +message(STATUS " VISIT_PARALLEL_LINK_DIRS = ${VISIT_PARALLEL_LINK_DIRS}") message(STATUS " VISIT_PARALLEL_LIBS = ${VISIT_PARALLEL_LIBS}") message(STATUS " VISIT_PARALLEL_RPATH = ${VISIT_PARALLEL_RPATH}") -message(STATUS " VISIT_PARALLEL_DEFS = ${VISIT_PARALLEL_DEFS}") +message(STATUS " VISIT_PARALLEL_DEFINES = ${VISIT_PARALLEL_DEFINES}") message(STATUS " VISIT_PARALLEL_INCLUDE = ${VISIT_PARALLEL_INCLUDE}") if(VISIT_FORTRAN AND VISIT_PARALLEL_FORTRAN_LIBS) diff --git a/src/avt/PythonFilters/CMakeLists.txt b/src/avt/PythonFilters/CMakeLists.txt index b49e3103c1..81cc25534b 100644 --- a/src/avt/PythonFilters/CMakeLists.txt +++ b/src/avt/PythonFilters/CMakeLists.txt @@ -50,7 +50,10 @@ visit_add_library( INCLUDES ${avtpythonfilters_INCLUDES} DEPENDS_ON ${avtpythonfilters_DEPENDS} avtpipeline_ser) - target_link_directories(avtpythonfilters_ser PUBLIC ${PYTHON_DIR}) + +visit_patch_target( + NAME avtpythonfilters_ser + LINKDIR ${PYTHON_DIR}) #********************************* PARALLEL ********************************** if(VISIT_PARALLEL) @@ -61,6 +64,8 @@ if(VISIT_PARALLEL) INCLUDES ${avtpythonfilters_INCLUDES} DEPENDS_ON ${avtpythonfilters_DEPENDS} avtpipeline_par) - target_link_directories(avtpythonfilters_par PUBLIC ${PYTHON_DIR}) + visit_patch_target( + NAME avtpythonfilters_par + LINKDIR ${PYTHON_DIR}) endif() diff --git a/src/avt/QtVisWindow/vtk/CMakeLists.txt b/src/avt/QtVisWindow/vtk/CMakeLists.txt index 34b8e63709..377db3f261 100644 --- a/src/avt/QtVisWindow/vtk/CMakeLists.txt +++ b/src/avt/QtVisWindow/vtk/CMakeLists.txt @@ -4,14 +4,18 @@ #**************************************************************************** # Modifications: +# Kathleen Biagas, Thu Oct 24, 2024 +# Utilize visit_patch_target. # #**************************************************************************** -target_sources(avtqtviswindow PRIVATE - vtkDashedXorGridMapper2D.C - vtkRubberBandMapper2D.C - vtkDashedXorGridMapper2D.h - vtkRubberBandMapper2D.h) +visit_patch_target( + NAME avtqtviswindow + SOURCES vtkDashedXorGridMapper2D.C + vtkRubberBandMapper2D.C + HEADERS vtkDashedXorGridMapper2D.h + vtkRubberBandMapper2D.h + INCLUDES $) if(NOT APPLE AND X11_FOUND) set_source_files_properties( @@ -19,6 +23,4 @@ if(NOT APPLE AND X11_FOUND) PROPERTIES COMPILE_FLAGS "-DHAVE_XLIB") endif() -target_include_directories(avtqtviswindow PRIVATE - $) diff --git a/src/avt/Queries/CMakeLists.txt b/src/avt/Queries/CMakeLists.txt index c9054b212f..62cdebab69 100644 --- a/src/avt/Queries/CMakeLists.txt +++ b/src/avt/Queries/CMakeLists.txt @@ -90,10 +90,14 @@ if(VISIT_PARALLEL) avtexpressions_par avtfilters_par) if(VISIT_PYTHON_FILTERS) - target_link_libraries(avtquery_par PUBLIC avtpythonfilters_par) + visit_patch_target( + NAME avtquery_par + DEPENDS_ON avtpythonfilters_par) endif() if(CONDUIT_FOUND) - target_link_libraries(avtquery_par PUBLIC conduit_mpi) + visit_patch_target( + NAME avtquery_par + DEPENDS_ON conduit_mpi) endif() endif() diff --git a/src/engine/main/CMakeLists.txt b/src/engine/main/CMakeLists.txt index 28c1c49290..e20a8ed961 100644 --- a/src/engine/main/CMakeLists.txt +++ b/src/engine/main/CMakeLists.txt @@ -128,10 +128,10 @@ visit_add_library( avtpipeline_ser) if(WIN32) - set_target_properties(engine_ser PROPERTIES OUTPUT_NAME enginelib_ser) + visit_patch_target(NAME engine_ser OUTPUT_NAME enginelib_ser) else() # This keeps comm's exceptions visible when using -fvisibility=hidden - target_compile_definitions(engine_ser PRIVATE COMM_EXPORTS) + visit_patch_target(NAME engine_ser DEFINES COMM_EXPORTS) endif() @@ -173,19 +173,24 @@ if(VISIT_PARALLEL) cognomen) if(WIN32) - set_target_properties(engine_par PROPERTIES OUTPUT_NAME enginelib_par) + visit_patch_target(NAME engine_par OUTPUT_NAME enginelib_par) + else() + # This keeps comm's exceptions visible when using -fvisibility=hidden + visit_patch_target(NAME engine_par DEFINES COMM_EXPORTS) endif() if(ICET_FOUND) - target_include_directories(engine_par PUBLIC - $ - $) - target_link_directories(engine_par PUBLIC ${ICET_LIBRARY_DIR}) + visit_patch_target( + NAME engine_par + LINKDIR ${ICET_LIBRARY_DIR} + INCLUDES $ + $ + DEFINES HAVE_ICET) if(VISIT_MESAGL_DIR) - target_include_directories(engine_par PUBLIC - $) + visit_patch_target( + NAME engine_par + INCLUDES $) endif() - target_compile_definitions(engine_par PRIVATE HAVE_ICET) endif() endif() @@ -280,6 +285,9 @@ if(VISIT_PARALLEL) ${ZLIB_LIBRARY} ) + if(ICET_FOUND) + target_link_directories(engine_par_exe PRIVATE ${ICET_LIBRARY_DIR}) + endif() # If we're building statically then the engine can't be linked until the plugin # sources are built if(VISIT_STATIC) diff --git a/src/third_party_builtin/cognomen/CMakeLists.txt b/src/third_party_builtin/cognomen/CMakeLists.txt index 41127003e6..623a272ea2 100644 --- a/src/third_party_builtin/cognomen/CMakeLists.txt +++ b/src/third_party_builtin/cognomen/CMakeLists.txt @@ -8,7 +8,7 @@ # Make cognomen always build static lib on windows. # # Kathleen Biagas, Mon Oct 7, 2024 -# Utilize visit_add_parallel_library. +# Utilize visit_add_library. # #**************************************************************************** @@ -34,6 +34,6 @@ visit_add_parallel_library( FOLDER thirdparty_builtin/cognomen) if(WIN32) - target_link_libraries(cognomen PUBLIC ws2_32) + visit_patch_target(NAME cognomen DEPENDS_ON ws2_32) endif() diff --git a/src/tools/data/DataManualExamples/Simulations/CMakeLists.txt b/src/tools/data/DataManualExamples/Simulations/CMakeLists.txt index a358309191..ec2ea8b435 100644 --- a/src/tools/data/DataManualExamples/Simulations/CMakeLists.txt +++ b/src/tools/data/DataManualExamples/Simulations/CMakeLists.txt @@ -152,6 +152,9 @@ FUNCTION(ADD_PARALLEL_SIMV2_SIMULATION target) ${EXTRA_SIM_LIBS}) ENDIF() ADD_TARGET_INCLUDE(sim_${target} ${VISIT_SOURCE_DIR}/sim/V2/lib) + if(ICET_FOUND) + target_link_directories(sim_${target} PRIVATE ${ICET_LIBRARY_DIR}) + endif() IF(BLUEGENEQ) SET(VISIT_NOLINK_MPI_WITH_LIBRARIES ${TMP_NOLINK}) ENDIF(BLUEGENEQ) diff --git a/src/viewer/core/CMakeLists.txt b/src/viewer/core/CMakeLists.txt index 6d957476e7..b4b8eb6ab4 100644 --- a/src/viewer/core/CMakeLists.txt +++ b/src/viewer/core/CMakeLists.txt @@ -132,7 +132,7 @@ visit_add_library( if(NOT WIN32) # This keeps comm's exceptions visible when using -fvisibility=hidden - target_compile_definitions(viewercore_ser PRIVATE COMM_EXPORTS) + visit_patch_target(NAME viewercore_ser DEFINES COMM_EXPORTS) endif() set_target_properties(viewercore_ser PROPERTIES HAS_CXX ON) @@ -160,7 +160,7 @@ if(VISIT_PARALLEL) if(NOT WIN32) # This keeps comm's exceptions visible when using -fvisibility=hidden - target_compile_definitions(viewercore_par PRIVATE COMM_EXPORTS) + visit_patch_target(NAME viewercore_par DEFINES COMM_EXPORTS) endif() endif() diff --git a/src/viewer/core/actions/CMakeLists.txt b/src/viewer/core/actions/CMakeLists.txt index 738d62f584..a224d45249 100644 --- a/src/viewer/core/actions/CMakeLists.txt +++ b/src/viewer/core/actions/CMakeLists.txt @@ -4,6 +4,8 @@ #**************************************************************************** # Modifications: +# Kathleen Biagas, Thu Oct 24, 2024 +# Use visit_patch_target instead of blt_patch_target. # #**************************************************************************** @@ -39,22 +41,18 @@ set(VIEWERCORE_ACTION_HEADERS ViewActions.h WindowActions.h) -target_sources(viewercore_ser PRIVATE - ${VIEWERCORE_ACTION_SOURCES} - ${VIEWERCORE_ACTION_HEADERS}) - -blt_patch_target( +visit_patch_target( NAME viewercore_ser + SOURCES ${VIEWERCORE_ACTION_SOURCES} + HEADERS ${VIEWERCORE_ACTION_HEADERS} INCLUDES $ $) if(VISIT_PARALLEL) - target_sources(viewercore_par PRIVATE - ${VIEWERCORE_ACTION_SOURCES} - ${VIEWERCORE_ACTION_HEADERS}) - - blt_patch_target( + visit_patch_target( NAME viewercore_par + SOURCES ${VIEWERCORE_ACTION_SOURCES} + HEADERS ${VIEWERCORE_ACTION_HEADERS} INCLUDES $ $) endif() diff --git a/src/viewer/main/ddt/CMakeLists.txt b/src/viewer/main/ddt/CMakeLists.txt index 9741101443..f62c113cb5 100644 --- a/src/viewer/main/ddt/CMakeLists.txt +++ b/src/viewer/main/ddt/CMakeLists.txt @@ -4,21 +4,22 @@ #**************************************************************************** # Modifications: +# Kathleen Biagas, Thu Oct 24, 2024 +# Use visit_patch_target instead of blt_patch_target. # #**************************************************************************** -target_sources(viewer PRIVATE - DDTActions.C - DDTActionsUI.C - DDTManager.C - DDTSession.C - DDTActions.h - DDTActionsUI.h - DDTManager.h - DDTSession.h) -blt_patch_target( +visit_patch_target( NAME viewer + SOURCES DDTActions.C + DDTActionsUI.C + DDTManager.C + DDTSession.C + HEADERS DDTActions.h + DDTActionsUI.h + DDTManager.h + DDTSession.h INCLUDES $ $) diff --git a/src/viewer/main/ui/CMakeLists.txt b/src/viewer/main/ui/CMakeLists.txt index 3f79c1c272..c04d25dad6 100644 --- a/src/viewer/main/ui/CMakeLists.txt +++ b/src/viewer/main/ui/CMakeLists.txt @@ -4,64 +4,64 @@ #**************************************************************************** # Modifications: +# Kathleen Biagas, Thu Oct 24, 2024 +# Use visit_patch_target instead of blt_patch_target. # #**************************************************************************** -target_sources(viewer PRIVATE - AnimationActionsUI.C - LockActionsUI.C - PlotAndOperatorActionsUI.C - PrintWindowAction.C - SetAppearanceAction.C - ToolbarActionsUI.C - ViewActionsUI.C - ViewerActionManagerUI.C - ViewerActionUI.C - ViewerActionUIMultiple.C - ViewerActionUISingle.C - ViewerActionUIToggle.C - ViewerChangeUsernameUI.C - ViewerConnectionPrinterUI.C - ViewerConnectionProgressDialog.C - ViewerFactoryUI.C - ViewerHostProfileSelectorWithWin.C - ViewerMessagingUI.C - ViewerPasswordWindow.C - ViewerPopupMenu.C - ViewerToolbar.C - ViewerWindowUI.C - VisItChangeUsernameWindow.C - VisItPasswordWindow.C - WindowActionsUI.C - AnimationActionsUI.h - ClientActionsUI.h - LockActionsUI.h - PlotAndOperatorActionsUI.h - PrintWindowAction.h - SetAppearanceAction.h - ToolbarActionsUI.h - ViewActionsUI.h - ViewerActionManagerUI.h - ViewerActionUI.h - ViewerActionUIMultiple.h - ViewerActionUISingle.h - ViewerActionUIToggle.h - ViewerChangeUsernameUI.h - ViewerConnectionPrinterUI.h - ViewerConnectionProgressDialog.h - ViewerFactoryUI.h - ViewerHostProfileSelectorWithWin.h - ViewerMessagingUI.h - ViewerPasswordWindow.h - ViewerPopupMenu.h - ViewerToolbar.h - ViewerWindowUI.h - VisItChangeUsernameWindow.h - VisItPasswordWindow.h - WindowActionsUI.h) - -blt_patch_target( +visit_patch_target( NAME viewer + SOURCES AnimationActionsUI.C + LockActionsUI.C + PlotAndOperatorActionsUI.C + PrintWindowAction.C + SetAppearanceAction.C + ToolbarActionsUI.C + ViewActionsUI.C + ViewerActionManagerUI.C + ViewerActionUI.C + ViewerActionUIMultiple.C + ViewerActionUISingle.C + ViewerActionUIToggle.C + ViewerChangeUsernameUI.C + ViewerConnectionPrinterUI.C + ViewerConnectionProgressDialog.C + ViewerFactoryUI.C + ViewerHostProfileSelectorWithWin.C + ViewerMessagingUI.C + ViewerPasswordWindow.C + ViewerPopupMenu.C + ViewerToolbar.C + ViewerWindowUI.C + VisItChangeUsernameWindow.C + VisItPasswordWindow.C + WindowActionsUI.C + HEADERS AnimationActionsUI.h + ClientActionsUI.h + LockActionsUI.h + PlotAndOperatorActionsUI.h + PrintWindowAction.h + SetAppearanceAction.h + ToolbarActionsUI.h + ViewActionsUI.h + ViewerActionManagerUI.h + ViewerActionUI.h + ViewerActionUIMultiple.h + ViewerActionUISingle.h + ViewerActionUIToggle.h + ViewerChangeUsernameUI.h + ViewerConnectionPrinterUI.h + ViewerConnectionProgressDialog.h + ViewerFactoryUI.h + ViewerHostProfileSelectorWithWin.h + ViewerMessagingUI.h + ViewerPasswordWindow.h + ViewerPopupMenu.h + ViewerToolbar.h + ViewerWindowUI.h + VisItChangeUsernameWindow.h + VisItPasswordWindow.h + WindowActionsUI.h INCLUDES $ $) diff --git a/src/visitpy/mpicom/CMakeLists.txt b/src/visitpy/mpicom/CMakeLists.txt index fbae103279..c71134e1ae 100644 --- a/src/visitpy/mpicom/CMakeLists.txt +++ b/src/visitpy/mpicom/CMakeLists.txt @@ -65,7 +65,7 @@ IF(VISIT_PARALLEL) ENDIF(VISIT_PARALLEL_LINKER_FLAGS) ELSE(UNIX) ADD_TARGET_INCLUDE(mpicom ${VISIT_PARALLEL_INCLUDE}) - ADD_TARGET_DEFINITIONS(mpicom ${VISIT_PARALLEL_DEFS}) + ADD_TARGET_DEFINITIONS(mpicom ${VISIT_PARALLEL_DEFINES}) ENDIF(UNIX) TARGET_LINK_LIBRARIES(mpicom PRIVATE