-
-
Notifications
You must be signed in to change notification settings - Fork 442
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
6305: Adapting build system for CMake V3.27 r=hkaiser a=hkaiser CMake starting with V3.27 complains about all-CAPS `<LIBRARY>_ROOT` variable names. Co-authored-by: Hartmut Kaiser <[email protected]>
- Loading branch information
Showing
74 changed files
with
999 additions
and
873 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,64 +1,73 @@ | ||
# Copyright (c) 2014 Thomas Heller | ||
# Copyright (c) 2012 Hartmut Kaiser | ||
# Copyright (c) 2012-2023 Hartmut Kaiser | ||
# | ||
# SPDX-License-Identifier: BSL-1.0 | ||
# Distributed under the Boost Software License, Version 1.0. (See accompanying | ||
# file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) | ||
|
||
if(NOT TARGET Amplifier::amplifier) | ||
# compatibility with older CMake versions | ||
if(AMPLIFIER_ROOT AND NOT Amplifier_ROOT) | ||
set(Amplifier_ROOT | ||
${AMPLIFIER_ROOT} | ||
CACHE PATH "Amplifier base directory" | ||
) | ||
unset(AMPLIFIER_ROOT CACHE) | ||
endif() | ||
|
||
find_package(PkgConfig QUIET) | ||
pkg_check_modules(PC_AMPLIFIER QUIET amplifier) | ||
|
||
find_path( | ||
AMPLIFIER_INCLUDE_DIR ittnotify.h | ||
HINTS ${AMPLIFIER_ROOT} ENV AMPLIFIER_ROOT ${PC_AMPLIFIER_INCLUDEDIR} | ||
${PC_AMPLIFIER_INCLUDE_DIRS} | ||
Amplifier_INCLUDE_DIR ittnotify.h | ||
HINTS ${Amplifier_ROOT} ENV AMPLIFIER_ROOT ${PC_Amplifier_INCLUDEDIR} | ||
${PC_Amplifier_INCLUDE_DIRS} | ||
PATH_SUFFIXES include | ||
) | ||
|
||
find_library( | ||
AMPLIFIER_LIBRARY | ||
Amplifier_LIBRARY | ||
NAMES ittnotify libittnotify | ||
HINTS ${AMPLIFIER_ROOT} ENV AMPLIFIER_ROOT ${PC_AMPLIFIER_LIBDIR} | ||
${PC_AMPLIFIER_LIBRARY_DIRS} | ||
HINTS ${Amplifier_ROOT} ENV AMPLIFIER_ROOT ${PC_Amplifier_LIBDIR} | ||
${PC_Amplifier_LIBRARY_DIRS} | ||
PATH_SUFFIXES lib lib64 | ||
) | ||
|
||
# Set AMPLIFIER_ROOT in case the other hints are used | ||
if(AMPLIFIER_ROOT) | ||
# Set Amplifier_ROOT in case the other hints are used | ||
if(Amplifier_ROOT) | ||
# The call to file is for compatibility for windows paths | ||
file(TO_CMAKE_PATH ${AMPLIFIER_ROOT} AMPLIFIER_ROOT) | ||
file(TO_CMAKE_PATH ${Amplifier_ROOT} Amplifier_ROOT) | ||
elseif("$ENV{AMPLIFIER_ROOT}") | ||
file(TO_CMAKE_PATH $ENV{AMPLIFIER_ROOT} AMPLIFIER_ROOT) | ||
file(TO_CMAKE_PATH $ENV{AMPLIFIER_ROOT} Amplifier_ROOT) | ||
else() | ||
file(TO_CMAKE_PATH "${AMPLIFIER_INCLUDE_DIR}" AMPLIFIER_INCLUDE_DIR) | ||
string(REPLACE "/include" "" AMPLIFIER_ROOT "${AMPLIFIER_INCLUDE_DIR}") | ||
file(TO_CMAKE_PATH "${Amplifier_INCLUDE_DIR}" Amplifier_INCLUDE_DIR) | ||
string(REPLACE "/include" "" Amplifier_ROOT "${Amplifier_INCLUDE_DIR}") | ||
endif() | ||
|
||
set(AMPLIFIER_LIBRARIES ${AMPLIFIER_LIBRARY}) | ||
set(AMPLIFIER_INCLUDE_DIRS ${AMPLIFIER_INCLUDE_DIR}) | ||
set(Amplifier_LIBRARIES ${Amplifier_LIBRARY}) | ||
set(Amplifier_INCLUDE_DIRS ${Amplifier_INCLUDE_DIR}) | ||
|
||
find_package_handle_standard_args( | ||
Amplifier DEFAULT_MSG AMPLIFIER_LIBRARY AMPLIFIER_INCLUDE_DIR | ||
Amplifier DEFAULT_MSG Amplifier_LIBRARY Amplifier_INCLUDE_DIR | ||
) | ||
|
||
get_property( | ||
_type | ||
CACHE AMPLIFIER_ROOT | ||
CACHE Amplifier_ROOT | ||
PROPERTY TYPE | ||
) | ||
if(_type) | ||
set_property(CACHE AMPLIFIER_ROOT PROPERTY ADVANCED 1) | ||
set_property(CACHE Amplifier_ROOT PROPERTY ADVANCED 1) | ||
if("x${_type}" STREQUAL "xUNINITIALIZED") | ||
set_property(CACHE AMPLIFIER_ROOT PROPERTY TYPE PATH) | ||
set_property(CACHE Amplifier_ROOT PROPERTY TYPE PATH) | ||
endif() | ||
endif() | ||
|
||
mark_as_advanced(AMPLIFIER_ROOT AMPLIFIER_LIBRARY AMPLIFIER_INCLUDE_DIR) | ||
mark_as_advanced(Amplifier_ROOT Amplifier_LIBRARY Amplifier_INCLUDE_DIR) | ||
|
||
add_library(Amplifier::amplifier INTERFACE IMPORTED) | ||
target_include_directories( | ||
Amplifier::amplifier SYSTEM INTERFACE ${AMPLIFIER_INCLUDE_DIR} | ||
Amplifier::amplifier SYSTEM INTERFACE ${Amplifier_INCLUDE_DIR} | ||
) | ||
target_link_libraries(Amplifier::amplifier INTERFACE ${AMPLIFIER_LIBRARIES}) | ||
target_link_libraries(Amplifier::amplifier INTERFACE ${Amplifier_LIBRARIES}) | ||
endif() |
Oops, something went wrong.