# 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 )
message (STATUS "Searching for ccache.")
find_program(CCACHE_FOUND ccache)
message (STATUS "Ccache found.")
set_property(GLOBAL PROPERTY RULE_LAUNCH_COMPILE ccache)
set_property(GLOBAL PROPERTY RULE_LAUNCH_LINK ccache)
message("TelemetryToggle set to ${TELEMETRY_DEFAULT}")
message("No command line option provided. Setting TelemetryToggle to False")
set (TELEMETRY_DEFAULT False)
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 ("-DUseCasacoreNamespace")
add_definitions ("-DWITHOUT_BOOST")
add_definitions(-DUSE_THREADS) # new casacore requirement:
# https://github.com/casacore/casacore/commit/2184df898452e1de695a04eb2e785419f707434c
execute_process( COMMAND svn info
RESULT_VARIABLE SVNINFOSTATUS
WORKING_DIRECTORY ${CMAKE_SOURCE_DIR}
message("SVNINFOSTATUS: ${SVNINFOSTATUS}")
if(${SVNINFOSTATUS} STREQUAL "0")
message("Running svn scripts.")
set( CASA_svngen ${CMAKE_SOURCE_DIR}/install/generate-svninfo )
execute_process( COMMAND %{CASA_svngen} "u=+%a %Y/%m/%d %H:%M:%S UTC"
OUTPUT_VARIABLE BUILDTIME
OUTPUT_STRIP_TRAILING_WHITESPACE
message("Couldn't detect svn. Not running svn scripts.")
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
set( CASA_MAJOR_VERSION 5 )
set( CASA_MINOR_VERSION 6 )
set( CASA_PATCH_VERSION 0 )
set( CASA_API_VERSION "${CASA_MAJOR_VERSION}.${CASA_MINOR_VERSION}.${CASA_PATCH_VERSION}" )
### default name for casa-maintained dbus C++ library... (but could also be called just "dbus-cpp")
set( dbus-cpp-library-name casa-dbus-cpp )