# SPDX-License-Identifier: GPL-2.0-or-later
# Copyright (C) 2022 CASA project
# This library is free software; you can redistribute it and/or modify it
# under the terms of the GNU Library General Public License as published by
# the Free Software Foundation; either version 2 of the License, or (at your
# option) any later version.
# This library 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 Library General Public
# License for more details.
# You should have received a copy of the GNU General Public License
# along with this program; if not, write to the Free Software
# Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
# Correspondence concerning CASA should be addressed as follows:
# Internet email: casa-feedback@nrao.edu.
## Set general cmake configuration
# Minimum cmake required version
cmake_minimum_required(VERSION 3.12)
execute_process(COMMAND ${CMAKE_CURRENT_SOURCE_DIR}/../../scripts/version
WORKING_DIRECTORY ${CMAKE_CURRENT_SOURCE_DIR}
OUTPUT_VARIABLE CASACPP_VERSION)
string(REGEX MATCH "([0-9]+\\.[0-9]+\\.[0-9]+\\.[0-9]+)" CASACPP_VERSION ${CASACPP_VERSION})
message("CASACPP version: " ${CASACPP_VERSION})
VERSION ${CASACPP_VERSION}
DESCRIPTION "CASA C++ libraries"
HOMEPAGE_URL https://casa.nrao.edu/
# Add directory with additional macros
set (CMAKE_MODULE_PATH "${CMAKE_SOURCE_DIR}/cmake")
set(CMAKE_CXX_LINK_EXECUTABLE "${CMAKE_CXX_LINK_EXECUTABLE} -ldl")
include(DeclareCasacppComponent)
include(CheckCXXCompilerFlag)
# Set a default build type if none was specified
set(default_build_type "RelWithDebInfo")
if(NOT CMAKE_BUILD_TYPE AND NOT CMAKE_CONFIGURATION_TYPES)
message(STATUS "Setting build type to '${default_build_type}' as none was specified.")
set(CMAKE_BUILD_TYPE "${default_build_type}" CACHE
STRING "Choose the type of build." FORCE)
set(CMAKE_CXX_STANDARD 14)
message (STATUS "CMAKE_CXX_STANDARD ${CMAKE_CXX_STANDARD}")
set(CMAKE_CXX_STANDARD_REQUIRED ON)