forked from robotology/yarp
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Import updated modules from cmake-3.5 and YCM and fix GTK2 c++11 issues
All GTK related modules now use imported targets. This means that for CMake 3.1 or later, c++11 is automatically enabled. for older versions, it is manually enabled wherever it is required. NOTE: conf/cmake-3.5/Modules/FindPackageHandleStandardArgs.cmake initial comment changed from new style to old style. Fixes robotology#598 CC-Issue: robotology/icub-main#232
- Loading branch information
Showing
26 changed files
with
1,462 additions
and
163 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 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 |
---|---|---|
|
@@ -16,7 +16,7 @@ | |
# GooCanvas_TWEAK_VERSION - GooCanvas tweak version | ||
|
||
#============================================================================= | ||
# Copyright 2012-2013 iCub Facility, Istituto Italiano di Tecnologia | ||
# Copyright 2012-2015 iCub Facility, Istituto Italiano di Tecnologia | ||
# Authors: Daniele E. Domenichelli <[email protected]> | ||
# | ||
# Distributed under the OSI-approved BSD License (the "License"); | ||
|
@@ -31,7 +31,14 @@ | |
|
||
|
||
include(StandardFindModule) | ||
standard_find_module(GooCanvas goocanvas) | ||
include(ReplaceImportedTargets) | ||
include(CMakeFindDependencyMacro) | ||
|
||
find_dependency(GTK2) | ||
|
||
standard_find_module(GooCanvas goocanvas | ||
TARGET GooCanvas::goocanvas | ||
REPLACE_TARGETS ${GTK2_LIBRARIES}) | ||
|
||
# Set package properties if FeatureSummary was included | ||
if(COMMAND set_package_properties) | ||
|
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 |
---|---|---|
|
@@ -16,7 +16,7 @@ | |
# GooCanvasMM_TWEAK_VERSION - GooCanvasMM tweak version | ||
|
||
#============================================================================= | ||
# Copyright 2012-2013 iCub Facility, Istituto Italiano di Tecnologia | ||
# Copyright 2012-2015 iCub Facility, Istituto Italiano di Tecnologia | ||
# Authors: Daniele E. Domenichelli <[email protected]> | ||
# | ||
# Distributed under the OSI-approved BSD License (the "License"); | ||
|
@@ -31,7 +31,16 @@ | |
|
||
|
||
include(StandardFindModule) | ||
standard_find_module(GooCanvasMM goocanvasmm-1.0) | ||
include(ReplaceImportedTargets) | ||
include(CMakeFindDependencyMacro) | ||
|
||
find_dependency(GTK2) | ||
find_dependency(GooCanvas) | ||
|
||
standard_find_module(GooCanvasMM goocanvasmm-1.0 | ||
TARGET GooCanvasMM::goocanvasmm | ||
REPLACE_TARGETS ${GTK2_LIBRARIES} | ||
${GooCanvas_LIBRARIES}) | ||
|
||
# Set package properties if FeatureSummary was included | ||
if(COMMAND set_package_properties) | ||
|
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 |
---|---|---|
|
@@ -16,7 +16,7 @@ | |
# GtkDatabox_TWEAK_VERSION - GtkDatabox tweak version | ||
|
||
#============================================================================= | ||
# Copyright 2012-2013 iCub Facility, Istituto Italiano di Tecnologia | ||
# Copyright 2012-2015 iCub Facility, Istituto Italiano di Tecnologia | ||
# Authors: Daniele E. Domenichelli <[email protected]> | ||
# | ||
# Distributed under the OSI-approved BSD License (the "License"); | ||
|
@@ -31,7 +31,14 @@ | |
|
||
|
||
include(StandardFindModule) | ||
standard_find_module(GtkDatabox gtkdatabox) | ||
include(ReplaceImportedTargets) | ||
include(CMakeFindDependencyMacro) | ||
|
||
find_dependency(GTK2) | ||
|
||
standard_find_module(GtkDatabox gtkdatabox | ||
TARGET GtkDatabox::gtkdatabox | ||
REPLACE_TARGETS ${GTK2_LIBRARIES}) | ||
|
||
# Set package properties if FeatureSummary was included | ||
if(COMMAND set_package_properties) | ||
|
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 |
---|---|---|
|
@@ -16,7 +16,7 @@ | |
# GtkDataboxMM_TWEAK_VERSION - GtkDataboxMM tweak version | ||
|
||
#============================================================================= | ||
# Copyright 2012-2013 iCub Facility, Istituto Italiano di Tecnologia | ||
# Copyright 2012-2015 iCub Facility, Istituto Italiano di Tecnologia | ||
# Authors: Daniele E. Domenichelli <[email protected]> | ||
# | ||
# Distributed under the OSI-approved BSD License (the "License"); | ||
|
@@ -29,8 +29,18 @@ | |
# (To distribute this file outside of YCM, substitute the full | ||
# License text for the above reference.) | ||
|
||
|
||
include(StandardFindModule) | ||
standard_find_module(GtkDataboxMM gtkdataboxmm-0.9) | ||
include(ReplaceImportedTargets) | ||
include(CMakeFindDependencyMacro) | ||
|
||
find_dependency(GTK2) | ||
find_dependency(GtkDatabox) | ||
|
||
standard_find_module(GtkDataboxMM gtkdataboxmm-0.9 | ||
TARGET GtkDataboxMM::gtkdataboxmm | ||
REPLACE_TARGETS ${GTK2_LIBRARIES} | ||
${GtkDatabox_LIBRARIES}) | ||
|
||
# Set package properties if FeatureSummary was included | ||
if(COMMAND set_package_properties) | ||
|
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 |
---|---|---|
@@ -0,0 +1,113 @@ | ||
#.rst: | ||
# ReplaceImportedTargets | ||
# ---------------------- | ||
# | ||
# Adds the :command:`replace_imported_targets` command that useful to | ||
# replace paths with imported targets in link variables (like | ||
# ``<FOO>_LIBRARIES``) and targets. | ||
# | ||
# .. command:: replace_imported_targets | ||
# | ||
# Replace imported targets in a list of and targets and paths:: | ||
# | ||
# replace_imported_targets(<var> [target [target [...]]]) | ||
# | ||
# Each path in ``var`` corrisponding to one of the ``targets`` will be | ||
# replaced with the corrisponding ``target``, taking care to remove the | ||
# relative ``optimized`` and ``debug`` keywords. | ||
# | ||
# For each existing target in ``var``, the following properties will be | ||
# searched for imported locations of targets, and, if set, will be | ||
# replaced in the same way:: | ||
# | ||
# IMPORTED_LINK_DEPENDENT_LIBRARIES | ||
# IMPORTED_LINK_DEPENDENT_LIBRARIES_<CONFIG> | ||
# IMPORTED_LINK_INTERFACE_LIBRARIES | ||
# IMPORTED_LINK_INTERFACE_LIBRARIES_<CONFIG> | ||
# INTERFACE_LINK_LIBRARIES | ||
# LINK_INTERFACE_LIBRARIES | ||
# LINK_INTERFACE_LIBRARIES_<CONFIG> | ||
# LINK_LIBRARIES | ||
|
||
#============================================================================= | ||
# Copyright 2015 iCub Facility, Istituto Italiano di Tecnologia | ||
# Authors: Daniele E. Domenichelli <[email protected]> | ||
# | ||
# Distributed under the OSI-approved BSD License (the "License"); | ||
# see accompanying file Copyright.txt for details. | ||
# | ||
# This software is distributed WITHOUT ANY WARRANTY; without even the | ||
# implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. | ||
# See the License for more information. | ||
#============================================================================= | ||
# (To distribute this file outside of YCM, substitute the full | ||
# License text for the above reference.) | ||
|
||
|
||
function(_REPLACE_IMPORTED_TARGETS_INTERNAL _var) | ||
foreach(_target ${ARGN}) | ||
if(TARGET ${_target}) | ||
get_target_property(_imported ${_target} IMPORTED) | ||
if(_imported) | ||
get_target_property(_configurations ${_target} IMPORTED_CONFIGURATIONS) | ||
foreach(_conf ${_configurations}) | ||
get_target_property(_location ${_target} IMPORTED_LOCATION_${_conf}) | ||
string(REGEX REPLACE "((optimized|debug);)?${_location}" ${_target} ${_var} "${${_var}}") | ||
endforeach() | ||
endif() | ||
endif() | ||
endforeach() | ||
list(REMOVE_DUPLICATES ${_var}) | ||
set(${_var} ${${_var}} PARENT_SCOPE) | ||
endfunction() | ||
|
||
|
||
function(REPLACE_IMPORTED_TARGETS _var) | ||
set(_replace_targets ${ARGN}) | ||
|
||
if(TARGET ${_var}) | ||
set(_tgt ${_var}) | ||
else() | ||
set(_tgt ${${_var}}) | ||
endif() | ||
foreach(_target ${_tgt}) | ||
if(TARGET ${_target}) | ||
|
||
# Replace in all link related properties. | ||
set(_properties IMPORTED_LINK_DEPENDENT_LIBRARIES | ||
IMPORTED_LINK_INTERFACE_LIBRARIES | ||
INTERFACE_LINK_LIBRARIES | ||
LINK_INTERFACE_LIBRARIES | ||
LINK_LIBRARIES) | ||
get_property(_configurations TARGET ${_target} PROPERTY IMPORTED_CONFIGURATIONS) | ||
foreach(_config ${_configurations}) | ||
list(APPEND _properties IMPORTED_LINK_DEPENDENT_LIBRARIES_${_config} | ||
IMPORTED_LINK_INTERFACE_LIBRARIES_${_config} | ||
LINK_INTERFACE_LIBRARIES_${_config}) | ||
endforeach() | ||
|
||
foreach(_prop ${_properties}) | ||
get_property(_prop_set TARGET ${_target} PROPERTY ${_prop} SET) | ||
if(_prop_set) | ||
get_property(_prop_value TARGET ${_target} PROPERTY ${_prop}) | ||
_replace_imported_targets_internal(_prop_value ${_replace_targets}) | ||
|
||
# CMake 3.0.x throws an exception when setting an empty | ||
# property. All the other versions are fine with it. | ||
# Remove this check when CMake minimum required version is | ||
# 3.1 or higher. | ||
if(NOT ("${CMAKE_MAJOR_VERSION}.${CMAKE_MINOR_VERSION}" VERSION_EQUAL 3.0 AND "${_prop_value}" STREQUAL "")) | ||
set_property(TARGET ${_target} PROPERTY ${_prop} ${_prop_value}) | ||
endif() | ||
endif() | ||
endforeach() | ||
endif() | ||
endforeach() | ||
|
||
if(NOT TARGET ${_var}) | ||
# replace in the variable. | ||
_replace_imported_targets_internal(${_var} ${_replace_targets}) | ||
set(${_var} ${${_var}} PARENT_SCOPE) | ||
endif() | ||
|
||
endfunction() |
Oops, something went wrong.