From 208d3b03b7661ed95aa557cc520dbf22051b7980 Mon Sep 17 00:00:00 2001 From: JLBLine Date: Thu, 11 Jul 2024 11:49:28 +1000 Subject: [PATCH] Fix for some annoying changes in CMake default behaviour --- cmake_testing/CMakeLists.txt | 10 ++++++++++ .../add_instrumental_effects_woden/CMakeLists.txt | 5 ----- cmake_testing/scripts/add_woden_uvfits/CMakeLists.txt | 5 ----- .../scripts/concat_woden_uvfits/CMakeLists.txt | 5 ----- cmake_testing/scripts/run_woden/CMakeLists.txt | 5 ----- cmake_testing/scripts/woden_uv2ms/CMakeLists.txt | 5 ----- cmake_testing/wodenpy/array_layout/CMakeLists.txt | 2 -- cmake_testing/wodenpy/observational/CMakeLists.txt | 3 --- cmake_testing/wodenpy/phase_rotate/CMakeLists.txt | 2 -- cmake_testing/wodenpy/skymodel/CMakeLists.txt | 3 --- cmake_testing/wodenpy/use_libwoden/CMakeLists.txt | 3 --- cmake_testing/wodenpy/uvfits/CMakeLists.txt | 3 --- cmake_testing/wodenpy/wodenpy_setup/CMakeLists.txt | 3 --- 13 files changed, 10 insertions(+), 44 deletions(-) diff --git a/cmake_testing/CMakeLists.txt b/cmake_testing/CMakeLists.txt index bbe6ff8..dc183d9 100644 --- a/cmake_testing/CMakeLists.txt +++ b/cmake_testing/CMakeLists.txt @@ -40,6 +40,16 @@ function(DEFINE_COMP_FLAGS PRECISION C_FLAGS GPU_FLAGS C_COVER_FLAGS) endif() endfunction() +##make sure we have Python. Deal with differing versions of CMake causing +##slightly different definitions of PYTHON_EXECUTABLE +##Why did they change PYTHON_EXECUTABLE to Python_EXECUTABLE?? + +include(FindPython) + +if (NOT DEFINED ${PYTHON_EXECUTABLE}) + set(PYTHON_EXECUTABLE ${Python_EXECUTABLE}) +endif() + ## Test C code add_subdirectory(C_code) diff --git a/cmake_testing/scripts/add_instrumental_effects_woden/CMakeLists.txt b/cmake_testing/scripts/add_instrumental_effects_woden/CMakeLists.txt index 06d50d8..7a9d63c 100644 --- a/cmake_testing/scripts/add_instrumental_effects_woden/CMakeLists.txt +++ b/cmake_testing/scripts/add_instrumental_effects_woden/CMakeLists.txt @@ -1,7 +1,2 @@ - -include(FindPython) - -##Set an environment variable for the ctest of this, so we can find a path -##to some test files that live in this dir add_test(python_test_add_instrumental_effects_woden ${PYTHON_EXECUTABLE} ${CMAKE_CURRENT_SOURCE_DIR}/test_add_instrumental_effects_woden.py) \ No newline at end of file diff --git a/cmake_testing/scripts/add_woden_uvfits/CMakeLists.txt b/cmake_testing/scripts/add_woden_uvfits/CMakeLists.txt index 53f55e4..cb3d059 100644 --- a/cmake_testing/scripts/add_woden_uvfits/CMakeLists.txt +++ b/cmake_testing/scripts/add_woden_uvfits/CMakeLists.txt @@ -1,7 +1,2 @@ - -include(FindPython) - -##Set an environment variable for the ctest of this, so we can find a path -##to some test files that live in this dir add_test(python_test_add_woden_uvfits ${PYTHON_EXECUTABLE} ${CMAKE_CURRENT_SOURCE_DIR}/test_add_woden_uvfits.py) \ No newline at end of file diff --git a/cmake_testing/scripts/concat_woden_uvfits/CMakeLists.txt b/cmake_testing/scripts/concat_woden_uvfits/CMakeLists.txt index 90fd9c3..8faa0ec 100644 --- a/cmake_testing/scripts/concat_woden_uvfits/CMakeLists.txt +++ b/cmake_testing/scripts/concat_woden_uvfits/CMakeLists.txt @@ -1,7 +1,2 @@ - -include(FindPython) - -##Set an environment variable for the ctest of this, so we can find a path -##to some test files that live in this dir add_test(python_test_concat_woden_uvfits ${PYTHON_EXECUTABLE} ${CMAKE_CURRENT_SOURCE_DIR}/test_concat_woden_uvfits.py) \ No newline at end of file diff --git a/cmake_testing/scripts/run_woden/CMakeLists.txt b/cmake_testing/scripts/run_woden/CMakeLists.txt index 2f204ba..e6d4539 100644 --- a/cmake_testing/scripts/run_woden/CMakeLists.txt +++ b/cmake_testing/scripts/run_woden/CMakeLists.txt @@ -1,7 +1,2 @@ - -include(FindPython) - -##Set an environment variable for the ctest of this, so we can find a path -##to some test files that live in this dir add_test(python_test_run_woden ${PYTHON_EXECUTABLE} ${CMAKE_CURRENT_SOURCE_DIR}/test_run_woden.py) \ No newline at end of file diff --git a/cmake_testing/scripts/woden_uv2ms/CMakeLists.txt b/cmake_testing/scripts/woden_uv2ms/CMakeLists.txt index 66a88cd..3b5abda 100644 --- a/cmake_testing/scripts/woden_uv2ms/CMakeLists.txt +++ b/cmake_testing/scripts/woden_uv2ms/CMakeLists.txt @@ -1,7 +1,2 @@ - -include(FindPython) - -##Set an environment variable for the ctest of this, so we can find a path -##to some test files that live in this dir add_test(python_test_woden_uv2ms ${PYTHON_EXECUTABLE} ${CMAKE_CURRENT_SOURCE_DIR}/test_woden_uv2ms.py) \ No newline at end of file diff --git a/cmake_testing/wodenpy/array_layout/CMakeLists.txt b/cmake_testing/wodenpy/array_layout/CMakeLists.txt index c0c7b5f..96e8f79 100644 --- a/cmake_testing/wodenpy/array_layout/CMakeLists.txt +++ b/cmake_testing/wodenpy/array_layout/CMakeLists.txt @@ -1,5 +1,3 @@ -include(FindPython) - add_test(python_test_enh2xyz ${PYTHON_EXECUTABLE} ${CMAKE_CURRENT_SOURCE_DIR}/test_enh2xyz.py) diff --git a/cmake_testing/wodenpy/observational/CMakeLists.txt b/cmake_testing/wodenpy/observational/CMakeLists.txt index 79031d2..537aba9 100644 --- a/cmake_testing/wodenpy/observational/CMakeLists.txt +++ b/cmake_testing/wodenpy/observational/CMakeLists.txt @@ -1,6 +1,3 @@ - -include(FindPython) - add_test(python_test_calc_jdcal ${PYTHON_EXECUTABLE} ${CMAKE_CURRENT_SOURCE_DIR}/test_calc_jdcal.py) diff --git a/cmake_testing/wodenpy/phase_rotate/CMakeLists.txt b/cmake_testing/wodenpy/phase_rotate/CMakeLists.txt index 9090929..ff0272d 100644 --- a/cmake_testing/wodenpy/phase_rotate/CMakeLists.txt +++ b/cmake_testing/wodenpy/phase_rotate/CMakeLists.txt @@ -1,4 +1,2 @@ -include(FindPython) - add_test(python_test_remove_phase_tracking ${PYTHON_EXECUTABLE} ${CMAKE_CURRENT_SOURCE_DIR}/test_remove_phase_tracking.py) \ No newline at end of file diff --git a/cmake_testing/wodenpy/skymodel/CMakeLists.txt b/cmake_testing/wodenpy/skymodel/CMakeLists.txt index 507a67e..f594a01 100644 --- a/cmake_testing/wodenpy/skymodel/CMakeLists.txt +++ b/cmake_testing/wodenpy/skymodel/CMakeLists.txt @@ -1,6 +1,3 @@ -include(FindPython) - - # add_test(python_test_read_yaml_radec_count_components ${PYTHON_EXECUTABLE} # ${CMAKE_CURRENT_SOURCE_DIR}/test_read_yaml_radec_count_components.py) # set_tests_properties(python_test_read_yaml_radec_count_components PROPERTIES diff --git a/cmake_testing/wodenpy/use_libwoden/CMakeLists.txt b/cmake_testing/wodenpy/use_libwoden/CMakeLists.txt index f2a8d7b..906e12a 100644 --- a/cmake_testing/wodenpy/use_libwoden/CMakeLists.txt +++ b/cmake_testing/wodenpy/use_libwoden/CMakeLists.txt @@ -1,6 +1,3 @@ - -include(FindPython) - ## Make a library to read in the woden_settings inputs, depending on whether ## things are float or double precision foreach(PRECISION IN LISTS FLOAT DOUBLE) diff --git a/cmake_testing/wodenpy/uvfits/CMakeLists.txt b/cmake_testing/wodenpy/uvfits/CMakeLists.txt index 1b56662..2ba5db7 100644 --- a/cmake_testing/wodenpy/uvfits/CMakeLists.txt +++ b/cmake_testing/wodenpy/uvfits/CMakeLists.txt @@ -1,6 +1,3 @@ - -include(FindPython) - add_test(python_test_RTS_encoding ${PYTHON_EXECUTABLE} ${CMAKE_CURRENT_SOURCE_DIR}/test_RTS_encoding.py) diff --git a/cmake_testing/wodenpy/wodenpy_setup/CMakeLists.txt b/cmake_testing/wodenpy/wodenpy_setup/CMakeLists.txt index c2e23cd..2b463f5 100644 --- a/cmake_testing/wodenpy/wodenpy_setup/CMakeLists.txt +++ b/cmake_testing/wodenpy/wodenpy_setup/CMakeLists.txt @@ -1,6 +1,3 @@ - -include(FindPython) - ##Set an environment variable for the ctest of this, so we can find a path ##to some test files that live in this dir add_test(python_test_argument_inputs ${PYTHON_EXECUTABLE}