Skip to content

Commit

Permalink
Fix CMAKE_CURRENT_SOURCE_DIR errors
Browse files Browse the repository at this point in the history
* replace with PROJECT_SOURCE_DIR
  • Loading branch information
danrosen25 committed Nov 6, 2023
1 parent 09c3e17 commit 7c4039b
Show file tree
Hide file tree
Showing 3 changed files with 10 additions and 10 deletions.
12 changes: 6 additions & 6 deletions cmake/modules/ParflowTest.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -22,11 +22,11 @@ function (pf_add_parallel_test inputfile topology)
separate_arguments(targs UNIX_COMMAND ${topology})
list(APPEND args ${targs})

add_test (NAME ${testname}_${postfix} COMMAND ${CMAKE_COMMAND} "-DPARFLOW_TEST=${args}" -DMPIEXEC=${MPIEXEC} -DMPIEXEC_NUMPROC_FLAG=${MPIEXEC_NUMPROC_FLAG} "-DMPIEXEC_PREFLAGS=${MPIEXEC_PREFLAGS}" "-DMPIEXEC_POSTFLAGS=${MPIEXEC_POSTFLAGS}" -DPARFLOW_HAVE_OAS3={PARFLOW_HAVE_OAS3} -P ${CMAKE_CURRENT_SOURCE_DIR}/cmake/modules/RunParallelTest.cmake WORKING_DIRECTORY ${CMAKE_CURRENT_SOURCE_DIR})
add_test (NAME ${testname}_${postfix} COMMAND ${CMAKE_COMMAND} "-DPARFLOW_TEST=${args}" -DMPIEXEC=${MPIEXEC} -DMPIEXEC_NUMPROC_FLAG=${MPIEXEC_NUMPROC_FLAG} "-DMPIEXEC_PREFLAGS=${MPIEXEC_PREFLAGS}" "-DMPIEXEC_POSTFLAGS=${MPIEXEC_POSTFLAGS}" -DPARFLOW_HAVE_OAS3={PARFLOW_HAVE_OAS3} -P ${PROJECT_SOURCE_DIR}/cmake/modules/RunParallelTest.cmake WORKING_DIRECTORY ${CMAKE_CURRENT_SOURCE_DIR})
set_tests_properties(${testname}_${postfix} PROPERTIES TIMEOUT 3600)

if( ${PARFLOW_HAVE_MEMORYCHECK} )
add_test (NAME ${testname}_${postfix}_memcheck COMMAND ${CMAKE_COMMAND} -DPARFLOW_HAVE_MEMORYCHECK=${PARFLOW_HAVE_MEMORYCHECK} -DPARFLOW_MEMORYCHECK_COMMAND=${PARFLOW_MEMORYCHECK_COMMAND} -DPARFLOW_MEMORYCHECK_COMMAND_OPTIONS=${PARFLOW_MEMORYCHECK_COMMAND_OPTIONS} "-DPARFLOW_TEST=${args}" -DMPIEXEC=${MPIEXEC} -DMPIEXEC_NUMPROC_FLAG=${MPIEXEC_NUMPROC_FLAG} "-DMPIEXEC_PREFLAGS=${MPIEXEC_PREFLAGS}" "-DMPIEXEC_POSTFLAGS=${MPIEXEC_POSTFLAGS}" -DPARFLOW_HAVE_OAS3=${PARFLOW_HAVE_OAS3} -P ${CMAKE_CURRENT_SOURCE_DIR}/cmake/modules/RunParallelTest.cmake WORKING_DIRECTORY ${CMAKE_CURRENT_SOURCE_DIR})
add_test (NAME ${testname}_${postfix}_memcheck COMMAND ${CMAKE_COMMAND} -DPARFLOW_HAVE_MEMORYCHECK=${PARFLOW_HAVE_MEMORYCHECK} -DPARFLOW_MEMORYCHECK_COMMAND=${PARFLOW_MEMORYCHECK_COMMAND} -DPARFLOW_MEMORYCHECK_COMMAND_OPTIONS=${PARFLOW_MEMORYCHECK_COMMAND_OPTIONS} "-DPARFLOW_TEST=${args}" -DMPIEXEC=${MPIEXEC} -DMPIEXEC_NUMPROC_FLAG=${MPIEXEC_NUMPROC_FLAG} "-DMPIEXEC_PREFLAGS=${MPIEXEC_PREFLAGS}" "-DMPIEXEC_POSTFLAGS=${MPIEXEC_POSTFLAGS}" -DPARFLOW_HAVE_OAS3=${PARFLOW_HAVE_OAS3} -P ${PROJECT_SOURCE_DIR}/cmake/modules/RunParallelTest.cmake WORKING_DIRECTORY ${CMAKE_CURRENT_SOURCE_DIR})
endif ()

endfunction()
Expand All @@ -42,11 +42,11 @@ function (pf_add_sequential_test inputfile)
list(APPEND args ${inputfile})
list(APPEND args 1 1 1)

add_test (NAME ${testname} COMMAND ${CMAKE_COMMAND} "-DPARFLOW_TEST=${args}" -DPARFLOW_HAVE_OAS3=${PARFLOW_HAVE_OAS3} -P ${CMAKE_CURRENT_SOURCE_DIR}/cmake/modules/RunParallelTest.cmake WORKING_DIRECTORY ${CMAKE_CURRENT_SOURCE_DIR})
add_test (NAME ${testname} COMMAND ${CMAKE_COMMAND} "-DPARFLOW_TEST=${args}" -DPARFLOW_HAVE_OAS3=${PARFLOW_HAVE_OAS3} -P ${PROJECT_SOURCE_DIR}/cmake/modules/RunParallelTest.cmake WORKING_DIRECTORY ${CMAKE_CURRENT_SOURCE_DIR})
set_tests_properties(${testname} PROPERTIES TIMEOUT 3600)

if( ${PARFLOW_HAVE_MEMORYCHECK} )
add_test (NAME ${testname}_memcheck COMMAND ${CMAKE_COMMAND} -DPARFLOW_HAVE_MEMORYCHECK=${PARFLOW_HAVE_MEMORYCHECK} -DPARFLOW_MEMORYCHECK_COMMAND=${PARFLOW_MEMORYCHECK_COMMAND} -DPARFLOW_MEMORYCHECK_COMMAND_OPTIONS=${PARFLOW_MEMORYCHECK_COMMAND_OPTIONS} "-DPARFLOW_TEST=${args}" -DMPIEXEC=${MPIEXEC} -DMPIEXEC_NUMPROC_FLAG=${MPIEXEC_NUMPROC_FLAG} "-DMPIEXEC_PREFLAGS=${MPIEXEC_PREFLAGS}" "-DMPIEXEC_POSTFLAGS=${MPIEXEC_POSTFLAGS}" -DPARFLOW_HAVE_OAS3=${PARFLOW_HAVE_OAS3} -P ${CMAKE_CURRENT_SOURCE_DIR}/cmake/modules/RunParallelTest.cmake WORKING_DIRECTORY ${CMAKE_CURRENT_SOURCE_DIR})
add_test (NAME ${testname}_memcheck COMMAND ${CMAKE_COMMAND} -DPARFLOW_HAVE_MEMORYCHECK=${PARFLOW_HAVE_MEMORYCHECK} -DPARFLOW_MEMORYCHECK_COMMAND=${PARFLOW_MEMORYCHECK_COMMAND} -DPARFLOW_MEMORYCHECK_COMMAND_OPTIONS=${PARFLOW_MEMORYCHECK_COMMAND_OPTIONS} "-DPARFLOW_TEST=${args}" -DMPIEXEC=${MPIEXEC} -DMPIEXEC_NUMPROC_FLAG=${MPIEXEC_NUMPROC_FLAG} "-DMPIEXEC_PREFLAGS=${MPIEXEC_PREFLAGS}" "-DMPIEXEC_POSTFLAGS=${MPIEXEC_POSTFLAGS}" -DPARFLOW_HAVE_OAS3=${PARFLOW_HAVE_OAS3} -P ${PROJECT_SOURCE_DIR}/cmake/modules/RunParallelTest.cmake WORKING_DIRECTORY ${CMAKE_CURRENT_SOURCE_DIR})
endif()

endfunction()
Expand All @@ -59,10 +59,10 @@ endfunction()
function (pf_add_amps_parallel_test test ranks loops)
set (testname amps-${test}-${ranks}-${loops})

add_test (NAME ${testname} COMMAND ${CMAKE_COMMAND} -DPARFLOW_TEST=${test} -DPARFLOW_RANKS=${ranks} -DPARFLOW_ARGS=${loops} -DMPIEXEC=${MPIEXEC} -DMPIEXEC_NUMPROC_FLAG=${MPIEXEC_NUMPROC_FLAG} "-DMPIEXEC_PREFLAGS=${MPIEXEC_PREFLAGS}" "-DMPIEXEC_POSTFLAGS=${MPIEXEC_POSTFLAGS}" -DPARFLOW_HAVE_OAS3=${PARFLOW_HAVE_OAS3} -P ${CMAKE_CURRENT_SOURCE_DIR}/cmake/modules/RunAmpsTest.cmake)
add_test (NAME ${testname} COMMAND ${CMAKE_COMMAND} -DPARFLOW_TEST=${test} -DPARFLOW_RANKS=${ranks} -DPARFLOW_ARGS=${loops} -DMPIEXEC=${MPIEXEC} -DMPIEXEC_NUMPROC_FLAG=${MPIEXEC_NUMPROC_FLAG} "-DMPIEXEC_PREFLAGS=${MPIEXEC_PREFLAGS}" "-DMPIEXEC_POSTFLAGS=${MPIEXEC_POSTFLAGS}" -DPARFLOW_HAVE_OAS3=${PARFLOW_HAVE_OAS3} -P ${PROJECT_SOURCE_DIR}/cmake/modules/RunAmpsTest.cmake)

if( ${PARFLOW_HAVE_MEMORYCHECK} )
add_test (NAME ${testname}_memcheck COMMAND ${CMAKE_COMMAND} -DPARFLOW_HAVE_MEMORYCHECK=${PARFLOW_HAVE_MEMORYCHECK} -DPARFLOW_MEMORYCHECK_COMMAND=${PARFLOW_MEMORYCHECK_COMMAND} -DPARFLOW_MEMORYCHECK_COMMAND_OPTIONS=${PARFLOW_MEMORYCHECK_COMMAND_OPTIONS} -DPARFLOW_TEST=${test} -DPARFLOW_RANKS=${ranks} -DPARFLOW_ARGS=${loops} -DMPIEXEC=${MPIEXEC} -DMPIEXEC_NUMPROC_FLAG=${MPIEXEC_NUMPROC_FLAG} "-DMPIEXEC_PREFLAGS=${MPIEXEC_PREFLAGS}" "-DMPIEXEC_POSTFLAGS=${MPIEXEC_POSTFLAGS}" -DPARFLOW_HAVE_OAS3=${PARFLOW_HAVE_OAS3} -P ${CMAKE_CURRENT_SOURCE_DIR}/cmake/modules/RunAmpsTest.cmake)
add_test (NAME ${testname}_memcheck COMMAND ${CMAKE_COMMAND} -DPARFLOW_HAVE_MEMORYCHECK=${PARFLOW_HAVE_MEMORYCHECK} -DPARFLOW_MEMORYCHECK_COMMAND=${PARFLOW_MEMORYCHECK_COMMAND} -DPARFLOW_MEMORYCHECK_COMMAND_OPTIONS=${PARFLOW_MEMORYCHECK_COMMAND_OPTIONS} -DPARFLOW_TEST=${test} -DPARFLOW_RANKS=${ranks} -DPARFLOW_ARGS=${loops} -DMPIEXEC=${MPIEXEC} -DMPIEXEC_NUMPROC_FLAG=${MPIEXEC_NUMPROC_FLAG} "-DMPIEXEC_PREFLAGS=${MPIEXEC_PREFLAGS}" "-DMPIEXEC_POSTFLAGS=${MPIEXEC_POSTFLAGS}" -DPARFLOW_HAVE_OAS3=${PARFLOW_HAVE_OAS3} -P ${PROJECT_SOURCE_DIR}/cmake/modules/RunAmpsTest.cmake)
endif()
endfunction()

Expand Down
6 changes: 3 additions & 3 deletions cmake/modules/PftoolsTest.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@
#
function (pf_add_filecompare_test testname cmd comparefile)

add_test (NAME ${testname} COMMAND ${CMAKE_COMMAND} "-DPFCMD=${cmd}" -P ${CMAKE_CURRENT_SOURCE_DIR}/cmake/modules/RunFileCompareTest.cmake WORKING_DIRECTORY ${CMAKE_CURRENT_SOURCE_DIR})
add_test (NAME ${testname} COMMAND ${CMAKE_COMMAND} "-DPFCMD=${cmd}" -P ${PROJECT_SOURCE_DIR}/cmake/modules/RunFileCompareTest.cmake WORKING_DIRECTORY ${CMAKE_CURRENT_SOURCE_DIR})

endfunction()

Expand Down Expand Up @@ -39,7 +39,7 @@ function (pf_add_mask_test testname inputfile)

list(APPEND files "${pfsolname}" "${vtkname}")

add_test (NAME ${testname} COMMAND ${CMAKE_COMMAND} "-DPFCMD=${cmd}" "-DPFFILES=${files}" -P ${CMAKE_CURRENT_SOURCE_DIR}/cmake/modules/RunFileCompareTest.cmake WORKING_DIRECTORY ${CMAKE_CURRENT_SOURCE_DIR})
add_test (NAME ${testname} COMMAND ${CMAKE_COMMAND} "-DPFCMD=${cmd}" "-DPFFILES=${files}" -P ${PROJECT_SOURCE_DIR}/cmake/modules/RunFileCompareTest.cmake WORKING_DIRECTORY ${CMAKE_CURRENT_SOURCE_DIR})

endfunction()

Expand Down Expand Up @@ -69,7 +69,7 @@ function (pf_add_multi_mask_test testname inputfile)

list(APPEND files "${pfsolname}" "${vtkname}")

add_test (NAME ${testname} COMMAND ${CMAKE_COMMAND} "-DPFCMD=${cmd}" "-DPFFILES=${files}" -P ${CMAKE_CURRENT_SOURCE_DIR}/cmake/modules/RunFileCompareTest.cmake WORKING_DIRECTORY ${CMAKE_CURRENT_SOURCE_DIR})
add_test (NAME ${testname} COMMAND ${CMAKE_COMMAND} "-DPFCMD=${cmd}" "-DPFFILES=${files}" -P ${PROJECT_SOURCE_DIR}/cmake/modules/RunFileCompareTest.cmake WORKING_DIRECTORY ${CMAKE_CURRENT_SOURCE_DIR})

endfunction()

2 changes: 1 addition & 1 deletion pftools/python/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -68,7 +68,7 @@ install(
"bin"
)

install(SCRIPT "${CMAKE_CURRENT_SOURCE_DIR}/pftools/python/PostInstall.cmake")
install(SCRIPT "${PROJECT_SOURCE_DIR}/pftools/python/PostInstall.cmake")

add_custom_target(
pf-python ALL
Expand Down

0 comments on commit 7c4039b

Please sign in to comment.