diff --git a/CMakeLists.txt b/CMakeLists.txt index 18309141bd713551d3e6c9d2aa565b8651e8256a..63af603797d0db050bf07c91d84c13b79b0280f2 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -2,8 +2,15 @@ cmake_minimum_required(VERSION 3.0.0) project(lofarbeam) +# Configure directory for data files +set(CMAKE_INSTALL_DATA_DIR "${CMAKE_INSTALL_PREFIX}/data") +message("Storing data in: " ${CMAKE_INSTALL_DATA_DIR}) +configure_file(${CMAKE_SOURCE_DIR}/CMake/config.h.in ${CMAKE_BINARY_DIR}/config.h) + add_subdirectory(external) +# Add element models +add_subdirectory(hamaker) add_subdirectory(lobes) add_subdirectory(oskar) @@ -12,13 +19,6 @@ cmake_policy(SET CMP0074 NEW) find_package(HDF5 COMPONENTS CXX REQUIRED) include_directories(${HDF5_INCLUDE_DIR}) -set(CMAKE_INSTALL_DATA_DIR "${CMAKE_INSTALL_PREFIX}/data") -message("Storing data in: " ${CMAKE_INSTALL_DATA_DIR}) -install(FILES "${CMAKE_SOURCE_DIR}/HamakerHBACoeff.h5" DESTINATION ${CMAKE_INSTALL_DATA_DIR}) -install(FILES "${CMAKE_SOURCE_DIR}/HamakerLBACoeff.h5" DESTINATION ${CMAKE_INSTALL_DATA_DIR}) - -configure_file(${CMAKE_SOURCE_DIR}/CMake/config.h.in ${CMAKE_BINARY_DIR}/config.h) -include_directories(${CMAKE_BINARY_DIR}) set(CMAKE_MODULE_PATH ${CMAKE_SOURCE_DIR}/CMake) @@ -36,21 +36,19 @@ add_library(stationresponse SHARED AntennaModelLBA.cc DualDipoleAntenna.cc ElementResponseModel.cc - HamakerElementResponse.cc ITRFConverter.cc ITRFDirection.cc LofarMetaDataUtil.cc MathUtil.cc Station.cc TileAntenna.cc - Types.cc - HamakerCoeff.cc) + Types.cc) set_target_properties(stationresponse PROPERTIES VERSION 3) target_link_libraries(stationresponse ${CASACORE_LIBRARIES}) -target_link_libraries(stationresponse oskar) +target_link_libraries(stationresponse hamaker oskar) install (TARGETS stationresponse DESTINATION lib) diff --git a/DualDipoleAntenna.cc b/DualDipoleAntenna.cc index a327867e66de456a78e10758320cb850ad42992e..d80e805e005051b6952b7beb47520d3bdad32895 100644 --- a/DualDipoleAntenna.cc +++ b/DualDipoleAntenna.cc @@ -24,7 +24,6 @@ #include "DualDipoleAntenna.h" #include "Constants.h" #include "MathUtil.h" -#include "HamakerElementResponse.h" namespace LOFAR { diff --git a/Station.cc b/Station.cc index 5a1c98b3715aebde353fe0070ef51af7b0c0da4f..8395b8ca118c4bc4be80749c9e52b68e8792eaea 100644 --- a/Station.cc +++ b/Station.cc @@ -23,7 +23,7 @@ #include "Station.h" #include "MathUtil.h" -#include "HamakerElementResponse.h" +#include "hamaker/HamakerElementResponse.h" #include "oskar/OSKARElementResponse.h" #include "DualDipoleAntenna.h" #include "TileAntenna.h" diff --git a/TileAntenna.cc b/TileAntenna.cc index a8b97192596e7a185f675f61df71779d05d878ee..cd5878a8e5d010fae7b95dc8b4fc27a47880f4da 100644 --- a/TileAntenna.cc +++ b/TileAntenna.cc @@ -23,7 +23,6 @@ #include "TileAntenna.h" #include "Constants.h" #include "MathUtil.h" -#include "HamakerElementResponse.h" namespace LOFAR { diff --git a/hamaker/CMakeLists.txt b/hamaker/CMakeLists.txt new file mode 100644 index 0000000000000000000000000000000000000000..0afc29a87209f15bae329efe98a6e6c50a5ce6c0 --- /dev/null +++ b/hamaker/CMakeLists.txt @@ -0,0 +1,12 @@ +# directory for config.h +include_directories(${CMAKE_BINARY_DIR}) + +# build libhamaker.so +add_library(hamaker SHARED + HamakerElementResponse.cc + HamakerCoeff.cc) + +# install coefficients +message("install hamaker in: " ${CMAKE_INSTALL_DATA_DIR}) +install(FILES "${CMAKE_SOURCE_DIR}/hamaker/HamakerHBACoeff.h5" DESTINATION ${CMAKE_INSTALL_DATA_DIR}) +install(FILES "${CMAKE_SOURCE_DIR}/hamaker/HamakerLBACoeff.h5" DESTINATION ${CMAKE_INSTALL_DATA_DIR}) \ No newline at end of file diff --git a/HamakerCoeff.cc b/hamaker/HamakerCoeff.cc similarity index 100% rename from HamakerCoeff.cc rename to hamaker/HamakerCoeff.cc diff --git a/HamakerCoeff.h b/hamaker/HamakerCoeff.h similarity index 100% rename from HamakerCoeff.h rename to hamaker/HamakerCoeff.h diff --git a/HamakerElementResponse.cc b/hamaker/HamakerElementResponse.cc similarity index 100% rename from HamakerElementResponse.cc rename to hamaker/HamakerElementResponse.cc diff --git a/HamakerElementResponse.h b/hamaker/HamakerElementResponse.h similarity index 95% rename from HamakerElementResponse.h rename to hamaker/HamakerElementResponse.h index ba5ec052bc3bb463def8965cf9e84d4a7d149bb5..682e09117f4c8125b08430eb5fabb04d6d25e934 100644 --- a/HamakerElementResponse.h +++ b/hamaker/HamakerElementResponse.h @@ -1,4 +1,4 @@ -#include "ElementResponse.h" +#include "../ElementResponse.h" #include "HamakerCoeff.h" #include <memory> diff --git a/HamakerHBACoeff.h5 b/hamaker/HamakerHBACoeff.h5 similarity index 100% rename from HamakerHBACoeff.h5 rename to hamaker/HamakerHBACoeff.h5 diff --git a/HamakerLBACoeff.h5 b/hamaker/HamakerLBACoeff.h5 similarity index 100% rename from HamakerLBACoeff.h5 rename to hamaker/HamakerLBACoeff.h5