File: items-config.cmake.in

package info (click to toggle)
kim-api 2.4.1-1~exp1
  • links: PTS, VCS
  • area: main
  • in suites: experimental
  • size: 4,624 kB
  • sloc: cpp: 32,594; f90: 12,746; ansic: 3,041; sh: 1,283; lisp: 130; python: 35; makefile: 13
file content (114 lines) | stat: -rw-r--r-- 3,735 bytes parent folder | download | duplicates (2)
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
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
#
# KIM-API: An API for interatomic models
# Copyright (c) 2013--2022, Regents of the University of Minnesota.
# All rights reserved.
#
# Contributors:
#    Richard Berger
#    Christoph Junghans
#    Ryan S. Elliott
#    Alexander Stukowski
#
# SPDX-License-Identifier: LGPL-2.1-or-later
#
# This library is free software; you can redistribute it and/or
# modify it under the terms of the GNU Lesser General Public
# License as published by the Free Software Foundation; either
# version 2.1 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
# Lesser General Public License for more details.
#
# You should have received a copy of the GNU Lesser General Public License
# along with this library; if not, write to the Free Software Foundation,
# Inc., 51 Franklin Street, Fifth Floor, Boston, MA  02110-1301  USA
#

#
# Release: This file is part of the kim-api.git repository.
#


#
# - KIM-API-ITEMS package
#
#  kim_api_items_setup_before_project()  - standard item configure, part 1
#  kim_api_items_setup_after_project()   - standard item configure, part 2
#


if(NOT REMOVE_THIS_FOR_3_0_0_RELEASE)
  set(REMOVE_THIS_FOR_3_0_0_RELEASE "")
endif()

set(KIM-API-ITEMS_VERSION_STRING "@PROJECT_VERSION_STRING@")
set(KIM-API-ITEMS_UID "@KIM_API_UID@")

#
# Macro to perform any necessary standard configuration that must be completed
# BEFORE the user calls the 'project()' command
#
macro(kim_api_items_setup_before_project)
  set(_options "")
  set(_oneValueArgs ITEM_TYPE)
  set(_multiValueArgs "")
  cmake_parse_arguments(_before_setup "${_options}" "${_oneValueArgs}" "${_multiValueArgs}" ${ARGN})
  if(_before_setup_UNPARSED_ARGUMENTS)
    message(FATAL_ERROR "Unparsed arguments found in 'kim_api_items_setup_before_project'")
  endif()
  unset(_options)
  unset(_oneValueArgs)
  unset(_multiValueArgs)

  set(_known_item_types portableModel modelDriver simulatorModel)
  if(NOT ${_before_setup_ITEM_TYPE} IN_LIST _known_item_types)
    message(FATAL_ERROR "Unknown KIM API Item type")
  endif()
  unset(_known_item_types)

  kim_api_items_set_cmake_compiler_variables()
  kim_api_items_set_cmake_build_type_variable_in_cache()
endmacro(kim_api_items_setup_before_project)

#
# Macro to perform any necessary standard configuration that must be completed
# AFTER the user calls the 'project()' command
#
macro(kim_api_items_setup_after_project)
  set(_options "")
  set(_oneValueArgs ITEM_TYPE)
  set(_multiValueArgs "")
  cmake_parse_arguments(_after_setup "${_options}" "${_oneValueArgs}" "${_multiValueArgs}" ${ARGN})
  if(_after_setup_UNPARSED_ARGUMENTS)
    message(FATAL_ERROR "Unparsed arguments found in 'kim_api_items_setup_after_project'")
  endif()
  unset(_options)
  unset(_oneValueArgs)
  unset(_multiValueArgs)

  set(_known_item_types portableModel modelDriver simulatorModel)
  if(NOT ${_after_setup_ITEM_TYPE} IN_LIST _known_item_types)
    message(FATAL_ERROR "Unknown KIM API Item type")
  endif()
  unset(_known_item_types)

  # Enable CXX and C so that Items can list only the languages they actually use
  enable_language(CXX)
  enable_language(C)
  enable_testing()

  kim_api_items_set_cmake_compiler_standard_variables()
  kim_api_items_prepend_compiler_flags_to_cmake_variables()

  find_package(KIM-API 2.2 REQUIRED CONFIG)
endmacro(kim_api_items_setup_after_project)


include("${CMAKE_CURRENT_LIST_DIR}/kim-api-items-macros.cmake")

if(NOT KIM-API-ITEMS_FIND_QUIETLY)
  include(FindPackageMessage)
  find_package_message(KIM-API-ITEMS "Found KIM-API-ITEMS pacakge." "KIM-API-ITEMS")
endif()