Skip to content

Commit

Permalink
Fix issue #105, make SOFA external dependency
Browse files Browse the repository at this point in the history
  • Loading branch information
tammojan committed May 21, 2015
1 parent 09cb934 commit a03bfab
Show file tree
Hide file tree
Showing 131 changed files with 35 additions and 27,976 deletions.
9 changes: 5 additions & 4 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -181,13 +181,13 @@ if (NOT ${MODULE} STREQUAL "casa")
if (NOT ${MODULE} STREQUAL "measures")
set (_modules ${_modules} fits)
set (_usefits YES)
if (${MODULE} STREQUAL "ms" OR ${MODULE} STREQUAL "all")
if (${MODULE} STREQUAL "ms" OR ${MODULE} STREQUAL "all")
set (_modules ${_modules} ms derivedmscal msfits)
endif (${MODULE} STREQUAL "ms" OR ${MODULE} STREQUAL "all")
if (${MODULE} STREQUAL "images" OR ${MODULE} STREQUAL "all")
endif (${MODULE} STREQUAL "ms" OR ${MODULE} STREQUAL "all")
if (${MODULE} STREQUAL "images" OR ${MODULE} STREQUAL "all")
set (_modules ${_modules} mirlib coordinates images)
set (_usewcs YES)
endif (${MODULE} STREQUAL "images" OR ${MODULE} STREQUAL "all")
endif (${MODULE} STREQUAL "images" OR ${MODULE} STREQUAL "all")
endif (NOT ${MODULE} STREQUAL "measures")
endif (NOT ${MODULE} STREQUAL "tables")
endif (NOT ${MODULE} STREQUAL "casa")
Expand All @@ -202,6 +202,7 @@ endif (BUILD_PYTHON)
include (CTest)
find_package (DL)
find_package (Readline)
find_package (SOFA)
if (USE_HDF5)
find_package (HDF5 REQUIRED)
endif (USE_HDF5)
Expand Down
21 changes: 21 additions & 0 deletions cmake/FindSOFA.cmake
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
# - Try to find SOFA: the IAU Standards of Fundamental Astronomy libraries
# Variables used by this module:
# SOFA_ROOT_DIR - SOFA root directory
# Variables defined by this module:
# SOFA_FOUND - system has SOFA
# SOFA_LIBRARY - the SOFA library (cached)
# SOFA_LIBRARIES - the SOFA libraries
# (identical to SOFA_LIBRARY)

if(NOT SOFA_FOUND)

find_library(SOFA_LIBRARY sofa
HINTS ${SOFA_ROOT_DIR} PATH_SUFFIXES lib)
mark_as_advanced(SOFA_LIBRARY)

include(FindPackageHandleStandardArgs)
find_package_handle_standard_args(SOFA DEFAULT_MSG SOFA_LIBRARY)

set(SOFA_LIBRARIES ${SOFA_LIBRARY})

endif(NOT SOFA_FOUND)
5 changes: 1 addition & 4 deletions measures/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,6 @@ Measures/Nutation.cc
Measures/ParAngleMachine.cc
Measures/Precession.cc
Measures/Quality.cc
Measures/SofaTest.cc
Measures/SolarPos.cc
Measures/Stokes.cc
Measures/UVWMachine.cc
Expand All @@ -64,7 +63,7 @@ TableMeasures/TableMeasValueDesc.cc
TableMeasures/TableQuantumDesc.cc
)

target_link_libraries (casa_measures casa_tables casa_scimath)
target_link_libraries (casa_measures casa_tables casa_scimath ${SOFA_LIBARIES})

add_subdirectory (apps)

Expand Down Expand Up @@ -123,7 +122,6 @@ Measures/Nutation.h
Measures/ParAngleMachine.h
Measures/Precession.h
Measures/Quality.h
Measures/SofaTest.h
Measures/SolarPos.h
Measures/Stokes.h
Measures/UVWMachine.h
Expand Down Expand Up @@ -159,7 +157,6 @@ DESTINATION include/casacore/measures
)

if (BUILD_TESTING)
add_subdirectory (fortran/sofa)
add_subdirectory (Measures/test)
add_subdirectory (TableMeasures/test)
endif (BUILD_TESTING)
Expand Down
10 changes: 5 additions & 5 deletions measures/Measures/test/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -27,8 +27,8 @@ foreach (test ${tests})
add_test (${test} ${CMAKE_SOURCE_DIR}/cmake/cmake_assay ./${test})
endforeach (test)

foreach (test tIAU2000)
add_executable (tIAU2000 tIAU2000.cc)
target_link_libraries (tIAU2000 casa_measures sofa)
add_test (${test} ${CMAKE_SOURCE_DIR}/cmake/cmake_assay ./${test})
endforeach (test)
if (SOFA_FOUND)
add_executable (tIAU2000 SofaTest.cc tIAU2000.cc)
target_link_libraries (tIAU2000 casa_measures ${SOFA_LIBRARY})
add_test (tIAU2000 ${CMAKE_SOURCE_DIR}/cmake/cmake_assay ./tIAU2000)
endif (SOFA_FOUND)
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@
//# $Id$

//# Include files
#include <casacore/measures/Measures/SofaTest.h>
#include "SofaTest.h"
#include <casacore/casa/BasicMath/Math.h>
#include <casacore/casa/iostream.h>
#include <limits.h>
Expand Down
File renamed without changes.
3 changes: 2 additions & 1 deletion measures/Measures/test/tIAU2000.cc
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,6 @@
//# $Id$

#include <casacore/casa/aips.h>
#include <casacore/measures/Measures/SofaTest.h>
#include <casacore/casa/Arrays/ArrayMath.h>
#include <casacore/casa/Arrays/ArrayIO.h>
#include <casacore/casa/Arrays/Vector.h>
Expand All @@ -48,6 +47,8 @@
#include <casacore/casa/BasicSL/String.h>
#include <casacore/casa/iostream.h>

#include "SofaTest.h"

#include <casacore/casa/namespace.h>
// Print separation line of given (default 75) length
void SEPAR(const uInt l=75) {
Expand Down
5 changes: 0 additions & 5 deletions measures/fortran/makefile

This file was deleted.

11 changes: 0 additions & 11 deletions measures/fortran/sofa/CMakeLists.txt

This file was deleted.

166 changes: 0 additions & 166 deletions measures/fortran/sofa/a2af.f

This file was deleted.

0 comments on commit a03bfab

Please sign in to comment.