Skip to content

Commit

Permalink
Merge pull request #3 from rogerfraser/installation-script-fixes
Browse files Browse the repository at this point in the history
Improve code quality of installation scripts
  • Loading branch information
rogerfraser authored Oct 8, 2020
2 parents 5f07da1 + 1853dba commit 0a65507
Show file tree
Hide file tree
Showing 6 changed files with 246 additions and 241 deletions.
64 changes: 31 additions & 33 deletions dynadjust/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -14,10 +14,10 @@ endif()

#set(CMAKE_VERBOSE_MAKEFILE ON)

message (STATUS " " )
message (STATUS "**********************************************" )
message (STATUS "Configuring DynAdjust ${DYNADJUST_VERSION} (${CMAKE_BUILD_TYPE}) build using cmake..." )
message (STATUS " " )
message (" ")
message ("===========================================================================")
message ("Configuring DynAdjust ${DYNADJUST_VERSION} (${CMAKE_BUILD_TYPE}) build using cmake...")
message (" ")

if(UNIX)
set(DNA_PROGRAM_PREFIX "dna")
Expand Down Expand Up @@ -51,29 +51,29 @@ else()
set (CMAKE_EXE_LINKER_FLAGS "${CMAKE_EXE_LINKER_FLAGS} -Wl,--no-as-needed")
endif()

message (STATUS "Looking for xerces-c..." )
message (STATUS "Looking for xerces-c...")
find_package (XercesC COMPONENTS xerces-c REQUIRED)
if (NOT XERCESC_FOUND )
set (DNA_BUILD_ERROR 1)
set (XERCES_FIND_ERROR 1)
message (SEND_ERROR "Cannot find XercesC library")
else ()
message (STATUS "xerces-c seems to be installed correctly." )
message (STATUS "xerces-c seems to be installed correctly.")
endif ()
message (STATUS " " )
message (" ")

message (STATUS "Looking for xsd headers..." )
message (STATUS "Looking for xsd headers...")
find_package (XSD REQUIRED)
if (NOT XSD_FOUND )
set (DNA_BUILD_ERROR 1)
set (XSD_FIND_ERROR 1)
message (SEND_ERROR "Cannot find XSD library")
else ()
message (STATUS "xsd headers seem to be installed correctly." )
message (STATUS "xsd headers seem to be installed correctly.")
endif ()
message (STATUS " " )
message (" ")

message (STATUS "Looking for boost..." )
message (STATUS "Looking for boost...")
set (Boost_USE_MULTITHREADED ON)
set (BOOST_MIN_VERSION "1.58.0")
find_package (Boost ${BOOST_MIN_VERSION} COMPONENTS system filesystem timer thread program_options REQUIRED)
Expand All @@ -84,9 +84,9 @@ if (NOT Boost_FOUND )
else ()
message (STATUS "boost seems to be installed correctly.")
endif ()
message (STATUS " ")
message (" ")

message (STATUS "Looking for intel math kernel library (mkl)..." )
message (STATUS "Looking for intel math kernel library (mkl)...")
find_package (MKL COMPONENTS mkl_blas95_ilp64 mkl_intel_ilp64 mkl_intel_thread mkl_core REQUIRED)
if (NOT MKL_FOUND )
set (DNA_BUILD_ERROR 1)
Expand All @@ -95,7 +95,7 @@ if (NOT MKL_FOUND )
else ()
message (STATUS "MKL seems to be installed correctly.")
endif ()
message (STATUS " ")
message (" ")

if (CMAKE_SYSTEM_NAME MATCHES "Darwin")
find_library(IOMP5_LIB iomp5 PATHS /opt/intel/lib)
Expand All @@ -112,13 +112,13 @@ set (DNA_LIBRARIES ${Boost_LIBRARIES} ${XERCESC_LIBRARY} ${MKL_LIBRARIES} ${IOMP

message (STATUS "DynAdjust library dependencies:")
message (STATUS ${DNA_LIBRARIES})
message (STATUS "")
message (" ")

include_directories( ${CMAKE_SOURCE_DIR} ${Boost_INCLUDE_DIRS} ${MKL_INCLUDE_DIRS} ${XERCESC_INCLUDE_DIR} ${XSD_INCLUDE_DIR})

if (DNA_BUILD_ERROR)
message (STATUS " " )
message (STATUS "**********************************************" )
message (" ")
message (STATUS "**********************************************")
message (STATUS "Cannot build DynaAjust ${DYNADJUST_VERSION}. Missing components:")
if (XERCES_FIND_ERROR)
message (STATUS " xerces-c")
Expand All @@ -135,34 +135,34 @@ endif ()
if (IOMP5_FIND_ERROR)
message (STATUS " iomp5")
endif ()
message (STATUS " ")
message (" ")
message (FATAL_ERROR "Build terminating.")
endif ()

message (STATUS "configuring import" )
message (STATUS "Configuring import")
add_subdirectory (dynadjust/dnaimportwrapper)

message (STATUS "configuring reftran" )
message (STATUS "Configuring reftran")
add_subdirectory (dynadjust/dnareftranwrapper)

message (STATUS "configuring segment" )
message (STATUS "Configuring segment")
add_subdirectory (dynadjust/dnasegmentwrapper)

message (STATUS "configuring geoid" )
message (STATUS "Configuring geoid")
add_subdirectory (dynadjust/dnageoidwrapper)

message (STATUS "configuring adjust" )
message (STATUS "Configuring adjust")
add_subdirectory (dynadjust/dnaadjustwrapper)

message (STATUS "configuring plot" )
message (STATUS "Configuring plot")
add_subdirectory (dynadjust/dnaplotwrapper)

message (STATUS "configuring dynadjust" )
message (STATUS "Configuring dynadjust")
add_subdirectory (dynadjust/dynadjust)

if (BUILD_TESTING)
message (STATUS " " )
message (STATUS "configuring tests" )
message (" ")
message (STATUS "Configuring tests")
# test execution of dynadjust binaries
# 1. gnss network (simultaneous)
add_test (NAME import-gnss-network COMMAND $<TARGET_FILE:dnaimportwrapper> -n gnss ${CMAKE_SOURCE_DIR}/../sampleData/gnss-network.stn ${CMAKE_SOURCE_DIR}/../sampleData/gnss-network.msr --export-dna --export-xml --export-asl --export-aml --export-map --output-msr-to-stn --test-integrity -r GDA94)
Expand Down Expand Up @@ -199,9 +199,7 @@ if (BUILD_TESTING)
set_tests_properties(test-gnss-network PROPERTIES DEPENDS adjust-gnss-network)
endif ()

message (STATUS " " )
message (STATUS "finished configuring DynAdjust ${DYNADJUST_VERSION} (${CMAKE_BUILD_TYPE})." )
message (STATUS "**********************************************" )
message (STATUS " " )
#message (STATUS "Now run make to build DynAdjust ${DYNADJUST_VERSION} (${CMAKE_BUILD_TYPE}) binaries" )
#message (STATUS " " )
message (" ")
message ("===========================================================================")
message ("Finished configuring DynAdjust ${DYNADJUST_VERSION} (${CMAKE_BUILD_TYPE}).")
message (" ")
Loading

0 comments on commit 0a65507

Please sign in to comment.