Skip to content

Commit

Permalink
Include ALOS_preproc in cmake build
Browse files Browse the repository at this point in the history
  • Loading branch information
Florian Wobbe committed Aug 14, 2016
1 parent d85134b commit 5431b08
Show file tree
Hide file tree
Showing 5 changed files with 111 additions and 88 deletions.
3 changes: 2 additions & 1 deletion CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -55,14 +55,15 @@ find_program (GS gs gswin64)
# Find dependent libraries
find_package (GMT REQUIRED)
find_package (TIFF REQUIRED)
find_package (LAPACK)
find_package (LAPACK REQUIRED)

# check for math and POSIX functions
include(ConfigureChecks)

# Add subdirectories
add_subdirectory (gmtsar)
add_subdirectory (snaphu/src)
add_subdirectory (preproc)

# Configuration done
message(
Expand Down
109 changes: 26 additions & 83 deletions cmake/ConfigDefault.cmake
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
#
# $Id$
#
# Default GMT settings. DO NOT EDIT THIS FILE!
# Default GMTSAR settings. DO NOT EDIT THIS FILE!
#
# There are two configuration files:
# 1) "ConfigDefault.cmake" - is version controlled and used to add new default
Expand All @@ -14,101 +14,47 @@
# "ConfigUser.cmake" (not "ConfigDefault.cmake" or "ConfigUserTemplate.cmake").
#

# The GMT package name.
set (GMT_PACKAGE_NAME "GMT")
# The GMTSAR package name.
set (GMTSAR_PACKAGE_NAME "GMTSAR")

# a short description of the gmt project (only a few words).
set (GMT_PACKAGE_DESCRIPTION_SUMMARY "Includes preprocessors for ERS1/2,
set (GMTSAR_PACKAGE_DESCRIPTION_SUMMARY "Includes preprocessors for ERS1/2,
Envisat, ALOS-1, ALOS-2, TerraSAR-X, COSMOS-SkyMed, and RADARSAT-2 (beta),
Sentinel-1A TOPS")

# GMT_VERSION_YEAR is set to current date in
# GMTSAR_VERSION_YEAR is set to current date in
# cmake/modules/ConfigCMake.cmake if not specified here:
#set (GMT_VERSION_YEAR "2015")
#set (GMTSAR_VERSION_YEAR "2015")

# The GMT package version.
set (GMT_PACKAGE_VERSION_MAJOR 5)
set (GMT_PACKAGE_VERSION_MINOR 3)
set (GMT_PACKAGE_VERSION_PATCH 0)
# The GMTSAR package version.
set (GMTSAR_PACKAGE_VERSION_MAJOR 5)
set (GMTSAR_PACKAGE_VERSION_MINOR 3)
set (GMTSAR_PACKAGE_VERSION_PATCH 0)

# The subversion revision of the GMT source code.
# This is manually set when making GMT *public* releases.
# The subversion revision of the GMTSAR source code.
# This is manually set when making GMTSAR *public* releases.
# However, when making internal releases or just an ordinary developer build, leave it
# empty; if it is empty, the revision number is automatically populated for you on build.
#set (GMT_SOURCE_CODE_CONTROL_VERSION_STRING "15220")
#set (GMTSAR_SOURCE_CODE_CONTROL_VERSION_STRING "15220")

# The GMT package version.
set (GMT_PACKAGE_VERSION "${GMT_PACKAGE_VERSION_MAJOR}.${GMT_PACKAGE_VERSION_MINOR}.${GMT_PACKAGE_VERSION_PATCH}")
# The GMTSAR package version.
set (GMTSAR_PACKAGE_VERSION "${GMTSAR_PACKAGE_VERSION_MAJOR}.${GMTSAR_PACKAGE_VERSION_MINOR}.${GMTSAR_PACKAGE_VERSION_PATCH}")

# The API version (SOVERSION) of the GMT libraries.
# The API version (SOVERSION) of the GMTSAR libraries.
# Increment this when more or fewer functions are included in the
# library, the function prototype changes, or data type changes.
set (GMT_LIB_SOVERSION 5)

# The build version (VERSION) of the GMT libraries.
set (GMT_LIB_VERSION "${GMT_LIB_SOVERSION}.${GMT_PACKAGE_VERSION_MINOR}.${GMT_PACKAGE_VERSION_PATCH}")

# The GMT wiki location
set (GMT_TRAC_WIKI "https://gmt.soest.hawaii.edu/")

# Use SI units per default
if (NOT UNITS)
set (UNITS "SI")
endif (NOT UNITS)

# File locking off
if (NOT DEFINED FLOCK)
set (FLOCK off)
endif (NOT DEFINED FLOCK)

# Build supplements is on
set (BUILD_SUPPLEMENTS TRUE)

# Install into traditional directory structure per default
if (NOT DEFINED GMT_INSTALL_TRADITIONAL_FOLDERNAMES)
set (GMT_INSTALL_TRADITIONAL_FOLDERNAMES ON)
endif (NOT DEFINED GMT_INSTALL_TRADITIONAL_FOLDERNAMES)

# Do not enforce GPL conformity per default. This enables routines that cannot
# normally be redistributed under the terms of the GPL such as Shewchuk's triangulation.
if (NOT DEFINED LICENSE_RESTRICTED)
set (LICENSE_RESTRICTED no)
endif (NOT DEFINED LICENSE_RESTRICTED)

# Default location of release documentation. If the directory exists in the
# source tree, the files will be copied to GMT_DOCDIR instead of creating
# PDFs from source:
if (NOT DEFINED GMT_INSTALL_EXTERNAL_DOC)
set (GMT_INSTALL_EXTERNAL_DOC ${GMT_SOURCE_DIR}/doc_release)
endif (NOT DEFINED GMT_INSTALL_EXTERNAL_DOC)

# Default location of release manpages. If the directory exists in the source
# tree, the files will be copied to GMT_MANDIR instead of creating manpages
# from source:
if (NOT DEFINED GMT_INSTALL_EXTERNAL_MAN)
set (GMT_INSTALL_EXTERNAL_MAN ${GMT_SOURCE_DIR}/man_release)
endif (NOT DEFINED GMT_INSTALL_EXTERNAL_MAN)
set (GMTSAR_LIB_SOVERSION 5)

# Directory in which to install the release sources per default
if (NOT DEFINED GMT_RELEASE_PREFIX)
set (GMT_RELEASE_PREFIX ${GMT_BINARY_DIR}/gmt-${GMT_PACKAGE_VERSION})
endif (NOT DEFINED GMT_RELEASE_PREFIX)

# Default location of optional third-party files used by test suite
# available from svn:https://gmtserver.soest.hawaii.edu/gmt-data
if (NOT DEFINED GMT_TEST_DATA)
set (GMT_TEST_DATA ${GMT_SOURCE_DIR}/test/data)
endif (NOT DEFINED GMT_TEST_DATA)

# The GMT copyright - string version to be used in a source file.
set (GMT_COPYRIGHT_STRING)
set (GMT_COPYRIGHT_STRING "${GMT_COPYRIGHT_STRING}Copyright 1991-${GMT_VERSION_YEAR} Paul Wessel, Walter H. F. Smith, R. Scharroo, J. Luis and F. Wobbe\\n")
set (GMT_COPYRIGHT_STRING "${GMT_COPYRIGHT_STRING}This program comes with NO WARRANTY, to the extent permitted by law.\\n")
set (GMT_COPYRIGHT_STRING "${GMT_COPYRIGHT_STRING}You may redistribute copies of this program under the terms of the\\n")
set (GMT_COPYRIGHT_STRING "${GMT_COPYRIGHT_STRING}GNU General Public License.\\n")
set (GMT_COPYRIGHT_STRING "${GMT_COPYRIGHT_STRING}For more information about these matters, see the file named LICENSE.TXT.\\n")
set (GMT_COPYRIGHT_STRING "${GMT_COPYRIGHT_STRING}\\n")
# The build version (VERSION) of the GMTSAR libraries.
set (GMTSAR_LIB_VERSION "${GMTSAR_LIB_SOVERSION}.${GMTSAR_PACKAGE_VERSION_MINOR}.${GMTSAR_PACKAGE_VERSION_PATCH}")

# The GMTSAR wiki location
set (GMTSAR_TRAC_WIKI "https://gmt.soest.hawaii.edu/projects/gmt5sar/wiki")

# Directory in which to install the release sources per default
if (NOT DEFINED GMTSAR_RELEASE_PREFIX)
set (GMTSAR_RELEASE_PREFIX ${GMTSAR_BINARY_DIR}/gmtsar-${GMTSAR_PACKAGE_VERSION})
endif (NOT DEFINED GMTSAR_RELEASE_PREFIX)

# You can set the build configuration type as a command-line argument to 'cmake' using -DCMAKE_BUILD_TYPE:STRING=Debug for example.
# If no build configuration type was given as a command-line option to 'cmake' then a default cache entry is set here.
Expand Down Expand Up @@ -171,7 +117,4 @@ endif (NOT DEFINED FIND_LIBRARY_USE_LIB64_PATHS)
# search order for find_*
set (CMAKE_FIND_FRAMEWORK LAST)

# install GMT developer include files
set (BUILD_DEVELOPER TRUE)

# vim: textwidth=78 noexpandtab tabstop=2 softtabstop=2 shiftwidth=2
8 changes: 4 additions & 4 deletions cmake/modules/ConfigCMake.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -91,7 +91,7 @@ if (GMTSAR_INSTALL_RELOCATABLE)
# make executables relocatable on supported platforms (relative RPATH)
if (UNIX AND NOT CYGWIN)
# find relative libdir from executable dir
file (RELATIVE_PATH _rpath /${GMTSAR_BINDIR} /${GMTSAR_LIBDIR})
file (RELATIVE_PATH _rpath /${GMTSAR_BINDIR} /lib)
# remove trailing /
string (REGEX REPLACE "/$" "" _rpath "${_rpath}")
if (APPLE)
Expand All @@ -110,14 +110,14 @@ else (GMTSAR_INSTALL_RELOCATABLE)
if (APPLE)
# CMP0042: CMake 3.0: MACOSX_RPATH is enabled by default
set (CMAKE_MACOSX_RPATH OFF)
set (CMAKE_INSTALL_NAME_DIR "${CMAKE_INSTALL_PREFIX}/${GMTSAR_LIBDIR}")
set (CMAKE_INSTALL_NAME_DIR "${CMAKE_INSTALL_PREFIX}/lib")
else (APPLE)
# the RPATH to be used when installing, but only if it's not a
# system directory
list (FIND CMAKE_PLATFORM_IMPLICIT_LINK_DIRECTORIES
"${CMAKE_INSTALL_PREFIX}/${GMTSAR_LIBDIR}" isSystemDir)
"${CMAKE_INSTALL_PREFIX}/lib" isSystemDir)
if ("${isSystemDir}" STREQUAL "-1")
set (CMAKE_INSTALL_RPATH "${CMAKE_INSTALL_PREFIX}/${GMTSAR_LIBDIR}")
set (CMAKE_INSTALL_RPATH "${CMAKE_INSTALL_PREFIX}/lib")
endif ("${isSystemDir}" STREQUAL "-1")
endif (APPLE)
endif (GMTSAR_INSTALL_RELOCATABLE)
Expand Down
71 changes: 71 additions & 0 deletions preproc/ALOS_preproc/CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,71 @@
#
# $Id$
#

if (HAVE_M_LIBRARY)
# link the math library
set (LINK_LIBS m)
endif (HAVE_M_LIBRARY)

include_directories (include)

add_library (ALOS lib_src/utils.c lib_src/null_sio_struct.c
lib_src/get_sio_struct.c lib_src/put_sio_struct.c lib_src/calc_dop.c
lib_src/hermite_c.c lib_src/ALOS_ldr_orbit.c lib_src/ALOSE_orbits_utils.c
lib_src/interpolate_ALOS_orbit.c lib_src/read_ALOS_sarleader.c
lib_src/set_ALOS_defaults.c lib_src/write_ALOS_prm.c lib_src/rng_expand.c
lib_src/rng_compress.c lib_src/rng_filter.c lib_src/find_fft_length.c
lib_src/siocomplex.c lib_src/polyfit.c lib_src/plh2xyz.c lib_src/xyz2plh.c
lib_src/cfft1d.c lib_src/swap32.c lib_src/swap16.c lib_src/fftpack.c
include/image_sio.h include/lib_functions.h include/llt2xyz.h
include/siocomplex.h)
target_link_libraries (ALOS ${LINK_LIBS})

set (LINK_LIBS ${LINK_LIBS} ALOS)

add_executable (ALOS_baseline ALOS_baseline/ALOS_baseline.c ALOS_baseline/ALOS_llt2rat_sub.c)
target_link_libraries (ALOS_baseline ${LINK_LIBS})

add_executable (ALOS_fbd2fbs ALOS_fbd2fbs/ALOS_fbd2fbs.c)
target_link_libraries (ALOS_fbd2fbs ${LINK_LIBS})

add_executable (ALOS_fbd2fbs_SLC ALOS_fbd2fbs_SLC/ALOS_fbd2fbs_SLC.c)
target_link_libraries (ALOS_fbd2fbs_SLC ${LINK_LIBS})

add_executable (ALOS_fbd2ss ALOS_fbd2ss/ALOS_fbd2ss.c)
target_link_libraries (ALOS_fbd2ss ${LINK_LIBS})

add_executable (ALOS_fbs2fbd ALOS_fbs2fbd/ALOS_fbs2fbd.c)
target_link_libraries (ALOS_fbs2fbd ${LINK_LIBS})

add_executable (ALOS_filter_SLC ALOS_filter_SLC/ALOS_filter_SLC.c)
target_link_libraries (ALOS_filter_SLC ${LINK_LIBS})

add_executable (ALOS_llt2rat ALOS_llt2rat/ALOS_llt2rat.c)
target_link_libraries (ALOS_llt2rat ${LINK_LIBS})

add_executable (ALOS_look ALOS_look/ALOS_look.c)
target_link_libraries (ALOS_look ${LINK_LIBS})

add_executable (ALOS_merge ALOS_merge/ALOS_merge.c)
target_link_libraries (ALOS_merge ${LINK_LIBS})

add_executable (ALOS_pre_process ALOS_pre_process/ALOS_pre_process.c ALOS_pre_process/parse_ALOS_commands.c ALOS_pre_process/read_ALOS_data.c ALOS_pre_process/read_ALOSE_data.c ALOS_pre_process/swap_ALOS_data_info.c ALOS_pre_process/roi_utils.c)
target_link_libraries (ALOS_pre_process ${LINK_LIBS})

add_executable (ALOS_pre_process_SLC ALOS_pre_process_SLC/ALOS_pre_process_SLC.c ALOS_pre_process_SLC/parse_ALOS_commands.c ALOS_pre_process_SLC/read_ALOS_data_SLC.c ALOS_pre_process_SLC/swap_ALOS_data_info.c)
target_link_libraries (ALOS_pre_process_SLC ${LINK_LIBS})

add_executable (ALOS_pre_process_SS ALOS_pre_process_SS/ALOS_pre_process_SS.c ALOS_pre_process_SS/parse_ALOS_commands.c ALOS_pre_process_SS/read_ALOS_data_SS.c ALOS_pre_process_SS/swap_ALOS_data_info.c)
target_link_libraries (ALOS_pre_process_SS ${LINK_LIBS})

# add the install targets
install (TARGETS ALOS ALOS_baseline ALOS_fbd2fbs ALOS_fbd2fbs_SLC ALOS_fbd2ss ALOS_fbs2fbd ALOS_filter_SLC ALOS_llt2rat ALOS_look ALOS_merge ALOS_pre_process ALOS_pre_process_SLC ALOS_pre_process_SS
ARCHIVE DESTINATION lib
COMPONENT Runtime
LIBRARY DESTINATION lib
COMPONENT Runtime
RUNTIME DESTINATION bin
COMPONENT Runtime)

# vim: textwidth=78 noexpandtab tabstop=2 softtabstop=2 shiftwidth=2
8 changes: 8 additions & 0 deletions preproc/CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
#
# $Id$
#

# Add subdirectories
add_subdirectory (ALOS_preproc)

# vim: textwidth=78 noexpandtab tabstop=2 softtabstop=2 shiftwidth=2

0 comments on commit 5431b08

Please sign in to comment.