Skip to content

Commit

Permalink
Fix for some annoying changes in CMake default behaviour
Browse files Browse the repository at this point in the history
  • Loading branch information
JLBLine committed Jul 11, 2024
1 parent 46b20ca commit 208d3b0
Show file tree
Hide file tree
Showing 13 changed files with 10 additions and 44 deletions.
10 changes: 10 additions & 0 deletions cmake_testing/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -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)

Expand Down
Original file line number Diff line number Diff line change
@@ -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)
5 changes: 0 additions & 5 deletions cmake_testing/scripts/add_woden_uvfits/CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -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)
5 changes: 0 additions & 5 deletions cmake_testing/scripts/concat_woden_uvfits/CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -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)
5 changes: 0 additions & 5 deletions cmake_testing/scripts/run_woden/CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -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)
5 changes: 0 additions & 5 deletions cmake_testing/scripts/woden_uv2ms/CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -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)
2 changes: 0 additions & 2 deletions cmake_testing/wodenpy/array_layout/CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -1,5 +1,3 @@
include(FindPython)

add_test(python_test_enh2xyz ${PYTHON_EXECUTABLE}
${CMAKE_CURRENT_SOURCE_DIR}/test_enh2xyz.py)

Expand Down
3 changes: 0 additions & 3 deletions cmake_testing/wodenpy/observational/CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -1,6 +1,3 @@

include(FindPython)

add_test(python_test_calc_jdcal ${PYTHON_EXECUTABLE}
${CMAKE_CURRENT_SOURCE_DIR}/test_calc_jdcal.py)

Expand Down
2 changes: 0 additions & 2 deletions cmake_testing/wodenpy/phase_rotate/CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -1,4 +1,2 @@
include(FindPython)

add_test(python_test_remove_phase_tracking ${PYTHON_EXECUTABLE}
${CMAKE_CURRENT_SOURCE_DIR}/test_remove_phase_tracking.py)
3 changes: 0 additions & 3 deletions cmake_testing/wodenpy/skymodel/CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -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
Expand Down
3 changes: 0 additions & 3 deletions cmake_testing/wodenpy/use_libwoden/CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -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)
Expand Down
3 changes: 0 additions & 3 deletions cmake_testing/wodenpy/uvfits/CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -1,6 +1,3 @@

include(FindPython)

add_test(python_test_RTS_encoding ${PYTHON_EXECUTABLE}
${CMAKE_CURRENT_SOURCE_DIR}/test_RTS_encoding.py)

Expand Down
3 changes: 0 additions & 3 deletions cmake_testing/wodenpy/wodenpy_setup/CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -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}
Expand Down

0 comments on commit 208d3b0

Please sign in to comment.