# CASA - Common Astronomy Software Applications
# Copyright (C) 2010 by ESO (in the framework of the ALMA collaboration)
# Copyright (C) 2010-2013 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)
add_definitions ("-DUseCasacoreNamespace")
add_definitions ("-DWITHOUT_BOOST")
add_definitions(-DUSE_THREADS) # new casacore requirement:
# https://github.com/casacore/casacore/commit/2184df898452e1de695a04eb2e785419f707434c
set( CMAKE_MODULE_PATH ${CMAKE_SOURCE_DIR}/install )
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} -revision url=${CMAKE_SOURCE_DIR}
OUTPUT_VARIABLE SVNREVISION
OUTPUT_STRIP_TRAILING_WHITESPACE
execute_process( COMMAND ${CASA_svngen} -date url=${CMAKE_SOURCE_DIR}
OUTPUT_STRIP_TRAILING_WHITESPACE
execute_process( COMMAND ${CASA_svngen} -url url=${CMAKE_SOURCE_DIR}
OUTPUT_VARIABLE CASASRCURL
OUTPUT_STRIP_TRAILING_WHITESPACE
message("Couldn't detect svn. Not running svn scripts.")
set( CASA_VERSION_MAJOR 5 )
set( CASA_VERSION_MINOR 7 )
set( CASA_VERSION_PATCH 0 )
set( CASA_VERSION_FEATURE 0 CACHE STRING "feature version" )
set( CASA_VERSION_DESC "" )
if( CASA_VERSION_FEATURE STREQUAL "0" )
execute_process( COMMAND svn info
RESULT_VARIABLE SVNINFOSTATUS
WORKING_DIRECTORY ${CMAKE_SOURCE_DIR} )
### hash-bound git will need another solution
if ( ${SVNINFOSTATUS} STREQUAL "0" )
execute_process( COMMAND svnversion
OUTPUT_VARIABLE SUBVERSION_REVISION
WORKING_DIRECTORY ${CMAKE_SOURCE_DIR}