-
Notifications
You must be signed in to change notification settings - Fork 9
/
CMakeLists.txt
87 lines (72 loc) · 2.72 KB
/
CMakeLists.txt
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
#############################################################################
#
# AVL
#
# Copyright (C) 2002 Mark Drela, Harold Youngren
#
# 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 2 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, write to the Free Software
# Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
#
#############################################################################
cmake_minimum_required(VERSION 3.5)
project(avl LANGUAGES C Fortran VERSION 3.32)
if(NOT CMAKE_BUILD_TYPE AND NOT CMAKE_CONFIGURATION_TYPES)
set(CMAKE_BUILD_TYPE Release CACHE STRING
"Choose the type of build; options are Debug Release RelWithDebInfo MinSizeRel"
FORCE)
set_property(CACHE CMAKE_BUILD_TYPE PROPERTY
STRINGS
Debug
Release
RelWithDebInfo
MinSizeRel)
endif()
include(CTest)
if(CMAKE_Fortran_COMPILER_ID STREQUAL GNU)
set(CMAKE_Fortran_FLAGS "${CMAKE_Fortran_FLAGS} -std=legacy")
endif()
option(DOUBLE_PRECISION
"Make the real and complex types eight bytes long" OFF)
if(DOUBLE_PRECISION)
if(CMAKE_Fortran_COMPILER_ID STREQUAL Intel)
if(WIN32)
set(CMAKE_Fortran_FLAGS "${CMAKE_Fortran_FLAGS} /real-size:64")
else()
set(CMAKE_Fortran_FLAGS "${CMAKE_Fortran_FLAGS} -real-size 64")
endif()
elseif(CMAKE_Fortran_COMPILER_ID STREQUAL GNU)
set(CMAKE_Fortran_FLAGS "${CMAKE_Fortran_FLAGS} -fdefault-real-8")
endif()
endif()
include(GNUInstallDirs)
add_subdirectory(eispack)
add_subdirectory(plotlib)
add_subdirectory(src)
set(AVL_DOCS avl_doc.txt version_notes.txt)
install(FILES ${AVL_DOCS} DESTINATION ${CMAKE_INSTALL_DOCDIR})
include(CMakePackageConfigHelpers)
configure_package_config_file(avl-config.cmake.in avl-config.cmake.in
INSTALL_DESTINATION ${CMAKE_INSTALL_DATADIR}/${PROJECT_NAME}
PATH_VARS CMAKE_INSTALL_BINDIR
NO_SET_AND_CHECK_MACRO NO_CHECK_REQUIRED_COMPONENTS_MACRO)
file(GENERATE
OUTPUT avl-config.cmake
INPUT "${CMAKE_CURRENT_BINARY_DIR}/avl-config.cmake.in")
write_basic_package_version_file(avl-config-version.cmake
COMPATIBILITY SameMajorVersion)
install(FILES
"${CMAKE_CURRENT_BINARY_DIR}/avl-config.cmake"
"${CMAKE_CURRENT_BINARY_DIR}/avl-config-version.cmake"
DESTINATION ${CMAKE_INSTALL_DATADIR}/${PROJECT_NAME})
include(CPack)