# CASA - Common Astronomy Software Applications
# Copyright (C) 2010 by ESO (in the framework of the ALMA collaboration)
# Copyright (C) 2010 by NAOJ (in the framework of the ALMA collaboration)
# Copyright (C) 2010 Associated Universities, Inc. Washington DC, USA.
#
# This file is part of CASA.
#
# This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation, either version 3 of the License, or
# (at your option) any later version.
#
# This program is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU General Public License for more details.
#
# You should have received a copy of the GNU General Public License
# along with this program. If not, see <http://www.gnu.org/licenses/>.
#
cmake_minimum_required( VERSION 2.8 )
# ccache use is optional
option( UseCcache OFF )
if (UseCcache)
message (STATUS "Searching for ccache.")
find_program(CCACHE_FOUND ccache)
if(CCACHE_FOUND)
message (STATUS "Ccache found.")
set_property(GLOBAL PROPERTY RULE_LAUNCH_COMPILE ccache)
set_property(GLOBAL PROPERTY RULE_LAUNCH_LINK ccache)
endif(CCACHE_FOUND)
endif()
if (TELEMETRY_DEFAULT)
message("TelemetryToggle set to ${TELEMETRY_DEFAULT}")
else()
message("No command line option provided. Setting TelemetryToggle to False")
set (TELEMETRY_DEFAULT False)
endif()
configure_file( ${CMAKE_SOURCE_DIR}/python/scripts/init_telemetry.py.in ${CMAKE_SOURCE_DIR}/python/scripts/init_telemetry.py )
set( CMAKE_MODULE_PATH ${CMAKE_SOURCE_DIR}/install )
add_definitions(-DIMPLICIT_CTDS_32BIT)
add_definitions ("-DUseCasacoreNamespace")
add_definitions ("-DWITHOUT_BOOST")
add_definitions(-DUSE_THREADS) # new casacore requirement:
# https://github.com/casacore/casacore/commit/2184df898452e1de695a04eb2e785419f707434c
set( CASA_svngen ${CMAKE_SOURCE_DIR}/install/generate-gitinfo )
execute_process( COMMAND %{CASA_svngen} "u=+%a %Y/%m/%d %H:%M:%S UTC"
OUTPUT_VARIABLE BUILDTIME
OUTPUT_STRIP_TRAILING_WHITESPACE
)
include( config )
include( ui )
include( target )
include( CASA )
set( CASA_MAJOR_VERSION 5 )
set( CASA_MINOR_VERSION 9 )
set( CASA_PATCH_VERSION 0 )
set( CASA_API_VERSION "${CASA_MAJOR_VERSION}.${CASA_MINOR_VERSION}.${CASA_PATCH_VERSION}" )
set( casa_startup 0 )
###
### default name for casa-maintained dbus C++ library... (but could also be called just "dbus-cpp")
###
set( dbus-cpp-library-name casa-dbus-cpp )
###
### by default, look for Qt4 in the standard places... (with casa01-* RPMs and linux, we avoid system places)...
###
set( qt4 system-qt )
enable_language (Fortran)
# Define compiler paths on OSX 10.5. This must be done before invoking project()
if( APPLE )
set( SO dylib )
if( EXISTS ${CMAKE_Fortran_COMPILER})
message(STATUS "Use " ${CMAKE_Fortran_COMPILER})
elseif( EXISTS /opt/casa/core2-apple-darwin8/3rd-party/bin/gfortran )
set( CMAKE_Fortran_COMPILER /opt/casa/core2-apple-darwin8/3rd-party/bin/gfortran )
set( CMAKE_CXX_COMPILER /opt/casa/core2-apple-darwin8/3rd-party/bin/g++ )