mirror of
https://github.com/triqs/dft_tools
synced 2024-11-18 12:03:50 +01:00
[cmake] Make sure imported targets are always global, some copyright header adjustments
This commit is contained in:
parent
abdc51ca94
commit
182550a831
49
deps/external_dependency.cmake
vendored
49
deps/external_dependency.cmake
vendored
@ -1,25 +1,38 @@
|
|||||||
###################################################################################
|
# Copyright (c) 2020 Simons Foundation
|
||||||
#
|
#
|
||||||
# APP4TRIQS: a Toolbox for Research in Interacting Quantum Systems
|
# 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.
|
||||||
#
|
#
|
||||||
# Copyright (C) 2020 Simons Foundation
|
# This program is distributed in the hope that it will be useful,
|
||||||
# authors: N. Wentzell
|
# 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.
|
||||||
#
|
#
|
||||||
# APP4TRIQS is free software: you can redistribute it and/or modify it under the
|
# You may obtain a copy of the License at
|
||||||
# terms of the GNU General Public License as published by the Free Software
|
# https://www.gnu.org/licenses/gpl-3.0.txt
|
||||||
# Foundation, either version 3 of the License, or (at your option) any later
|
|
||||||
# version.
|
|
||||||
#
|
|
||||||
# APP4TRIQS 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
|
|
||||||
# APP4TRIQS. If not, see <http://www.gnu.org/licenses/>.
|
|
||||||
#
|
|
||||||
###################################################################################
|
|
||||||
|
|
||||||
|
|
||||||
|
# Consider ROOT env variables in find_package
|
||||||
|
if(POLICY CMP0074)
|
||||||
|
cmake_policy(SET CMP0074 NEW)
|
||||||
|
endif()
|
||||||
|
|
||||||
|
# Make sure that imported targets are always global
|
||||||
|
get_property(IMPORTED_ALWAYS_GLOBAL GLOBAL PROPERTY IMPORTED_ALWAYS_GLOBAL)
|
||||||
|
if(NOT IMPORTED_ALWAYS_GLOBAL)
|
||||||
|
function(add_library)
|
||||||
|
set(_args ${ARGN})
|
||||||
|
if ("${_args}" MATCHES ";IMPORTED")
|
||||||
|
list(APPEND _args GLOBAL)
|
||||||
|
endif()
|
||||||
|
_add_library(${_args})
|
||||||
|
endfunction()
|
||||||
|
set_property(GLOBAL PROPERTY IMPORTED_ALWAYS_GLOBAL TRUE)
|
||||||
|
endif()
|
||||||
|
|
||||||
|
# Define External Dependency Function
|
||||||
function(external_dependency)
|
function(external_dependency)
|
||||||
cmake_parse_arguments(ARG "EXCLUDE_FROM_ALL;BUILD_ALWAYS" "VERSION;GIT_REPO;GIT_TAG" "" ${ARGN})
|
cmake_parse_arguments(ARG "EXCLUDE_FROM_ALL;BUILD_ALWAYS" "VERSION;GIT_REPO;GIT_TAG" "" ${ARGN})
|
||||||
|
|
||||||
|
@ -15,7 +15,13 @@ set(@PROJECT_NAME@_GIT_HASH @PROJECT_GIT_HASH@ CACHE STRING "@PROJECT_NAME@ git
|
|||||||
set(@PROJECT_NAME@_ROOT @CMAKE_INSTALL_PREFIX@ CACHE STRING "@PROJECT_NAME@ root directory")
|
set(@PROJECT_NAME@_ROOT @CMAKE_INSTALL_PREFIX@ CACHE STRING "@PROJECT_NAME@ root directory")
|
||||||
|
|
||||||
## Find the target dependencies
|
## Find the target dependencies
|
||||||
#find_package(... REQUIRED HINTS @CMAKE_INSTALL_PREFIX@)
|
#function(find_dep)
|
||||||
|
# get_property(${ARGV0}_FOUND GLOBAL PROPERTY ${ARGV0}_FOUND)
|
||||||
|
# if(NOT ${ARGV0}_FOUND)
|
||||||
|
# find_package(${ARGN} REQUIRED HINTS @CMAKE_INSTALL_PREFIX@)
|
||||||
|
# endif()
|
||||||
|
#endfunction()
|
||||||
|
#find_dep(depname 1.0)
|
||||||
|
|
||||||
# Include the exported targets of this project
|
# Include the exported targets of this project
|
||||||
include(@CMAKE_INSTALL_PREFIX@/lib/cmake/@PROJECT_NAME@/@PROJECT_NAME@-targets.cmake)
|
include(@CMAKE_INSTALL_PREFIX@/lib/cmake/@PROJECT_NAME@/@PROJECT_NAME@-targets.cmake)
|
||||||
|
@ -1,24 +1,18 @@
|
|||||||
###################################################################################
|
# Copyright (c) 2019-2020 Simons Foundation
|
||||||
#
|
#
|
||||||
# TRIQS: a Toolbox for Research in Interacting Quantum Systems
|
# 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.
|
||||||
#
|
#
|
||||||
# Copyright (C) 2019-2020 Simons Foundation
|
# This program is distributed in the hope that it will be useful,
|
||||||
# author: N. Wentzell
|
# 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.
|
||||||
#
|
#
|
||||||
# TRIQS is free software: you can redistribute it and/or modify it under the
|
# You may obtain a copy of the License at
|
||||||
# terms of the GNU General Public License as published by the Free Software
|
# https://www.gnu.org/licenses/gpl-3.0.txt
|
||||||
# Foundation, either version 3 of the License, or (at your option) any later
|
|
||||||
# version.
|
|
||||||
#
|
|
||||||
# TRIQS 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
|
|
||||||
# TRIQS. If not, see <http://www.gnu.org/licenses/>.
|
|
||||||
#
|
|
||||||
###################################################################################
|
|
||||||
|
|
||||||
# Recursively fetch all targets that the interface of a target depends upon
|
# Recursively fetch all targets that the interface of a target depends upon
|
||||||
macro(get_all_interface_targets name target)
|
macro(get_all_interface_targets name target)
|
||||||
|
Loading…
Reference in New Issue
Block a user