Skip to content

Commit 9921b59

Browse files
authored
Merge pull request #86 from robotology/switchtoextshlibpp
Switch to use released version of shlibpp instead of the vendored one
2 parents 36d8f52 + 0381584 commit 9921b59

35 files changed

+3936
-2925
lines changed

.gitignore

+2-1
Original file line numberDiff line numberDiff line change
@@ -31,4 +31,5 @@ slprj
3131
*.tmw
3232
*.dmr
3333
*.mk
34-
34+
.build
35+
.pixi

CMakeLists.txt

+13-1
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
# This software may be modified and distributed under the terms of the
33
# GNU Lesser General Public License v2.1 or any later version.
44

5-
cmake_minimum_required(VERSION 3.5)
5+
cmake_minimum_required(VERSION 3.16...3.31)
66
project(blockfactory LANGUAGES CXX VERSION 0.8.5)
77

88
if(BUILD_DOCS)
@@ -109,6 +109,18 @@ endif()
109109
# Handle unit tests support
110110
option(BUILD_TESTING "Create tests using CMake" OFF)
111111

112+
option(BLOCKFACTORY_USES_SYSTEM_SHLIBPP "If ON, find shlibpp with find_package(shlibpp)" OFF)
113+
if(BLOCKFACTORY_USES_SYSTEM_SHLIBPP)
114+
find_package(shlibpp REQUIRED)
115+
else()
116+
include(FetchContent)
117+
FetchContent_Declare(
118+
shlibpp
119+
URL https://github.com/ami-iit/shlibpp/archive/refs/tags/v0.0.2.zip
120+
)
121+
FetchContent_MakeAvailable(shlibpp)
122+
endif()
123+
112124
add_subdirectory(deps)
113125
add_subdirectory(sources)
114126

cmake/AddUninstallTarget.cmake

+71-49
Original file line numberDiff line numberDiff line change
@@ -1,70 +1,92 @@
1-
#.rst:
2-
# AddUninstallTarget
3-
# ------------------
4-
#
5-
# Add the "uninstall" target for your project::
6-
#
7-
# include(AddUninstallTarget)
8-
#
9-
#
10-
# will create a file cmake_uninstall.cmake in the build directory and add a
11-
# custom target uninstall that will remove the files installed by your package
12-
# (using install_manifest.txt)
13-
14-
#=============================================================================
15-
# Copyright 2008-2013 Kitware, Inc.
16-
# Copyright 2013 Istituto Italiano di Tecnologia (IIT)
17-
# Authors: Daniele E. Domenichelli <daniele.domenichelli@iit.it>
18-
#
19-
# Distributed under the OSI-approved BSD License (the "License");
20-
# see accompanying file Copyright.txt for details.
21-
#
22-
# This software is distributed WITHOUT ANY WARRANTY; without even the
23-
# implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
24-
# See the License for more information.
25-
#=============================================================================
26-
# (To distribute this file outside of CMake, substitute the full
27-
# License text for the above reference.)
28-
29-
30-
if(DEFINED __ADD_UNINSTALL_TARGET_INCLUDED)
1+
# SPDX-FileCopyrightText: 2012-2021 Istituto Italiano di Tecnologia (IIT)
2+
# SPDX-FileCopyrightText: 2008-2013 Kitware Inc.
3+
# SPDX-License-Identifier: BSD-3-Clause
4+
5+
#[=======================================================================[.rst:
6+
AddUninstallTarget
7+
------------------
8+
9+
Add the "uninstall" target for your project::
10+
11+
include(AddUninstallTarget)
12+
13+
14+
will create a file ``cmake_uninstall.cmake`` in the build directory and add a
15+
custom target ``uninstall`` (or ``UNINSTALL`` on Visual Studio and Xcode) that
16+
will remove the files installed by your package (using
17+
``install_manifest.txt``).
18+
See also
19+
https://gitlab.kitware.com/cmake/community/wikis/FAQ#can-i-do-make-uninstall-with-cmake
20+
21+
The :module:`AddUninstallTarget` module must be included in your main
22+
``CMakeLists.txt``. If included in a subdirectory it does nothing.
23+
This allows you to use it safely in your main ``CMakeLists.txt`` and include
24+
your project using ``add_subdirectory`` (for example when using it with
25+
:cmake:module:`FetchContent`).
26+
27+
If the ``uninstall`` target already exists, the module does nothing.
28+
#]=======================================================================]
29+
30+
31+
# AddUninstallTarget works only when included in the main CMakeLists.txt
32+
if(NOT "${CMAKE_CURRENT_BINARY_DIR}" STREQUAL "${CMAKE_BINARY_DIR}")
3133
return()
3234
endif()
33-
set(__ADD_UNINSTALL_TARGET_INCLUDED TRUE)
3435

36+
# The name of the target is uppercase in MSVC and Xcode (for coherence with the
37+
# other standard targets)
38+
if("${CMAKE_GENERATOR}" MATCHES "^(Visual Studio|Xcode)")
39+
set(_uninstall "UNINSTALL")
40+
else()
41+
set(_uninstall "uninstall")
42+
endif()
43+
44+
# If target is already defined don't do anything
45+
if(TARGET ${_uninstall})
46+
return()
47+
endif()
3548

36-
set(_filename ${CMAKE_CURRENT_BINARY_DIR}/cmake_uninstall.cmake)
3749

38-
file(WRITE ${_filename}
50+
set(_filename cmake_uninstall.cmake)
51+
52+
file(WRITE "${CMAKE_CURRENT_BINARY_DIR}/${_filename}"
3953
"if(NOT EXISTS \"${CMAKE_CURRENT_BINARY_DIR}/install_manifest.txt\")
40-
message(WARNING \"Cannot find install manifest: \\\"${CMAKE_CURRENT_BINARY_DIR}/install_manifest.txt\\\"\")
41-
return()
54+
message(WARNING \"Cannot find install manifest: \\\"${CMAKE_CURRENT_BINARY_DIR}/install_manifest.txt\\\"\")
55+
return()
4256
endif()
4357
4458
file(READ \"${CMAKE_CURRENT_BINARY_DIR}/install_manifest.txt\" files)
4559
string(STRIP \"\${files}\" files)
4660
string(REGEX REPLACE \"\\n\" \";\" files \"\${files}\")
4761
list(REVERSE files)
4862
foreach(file \${files})
63+
if(IS_SYMLINK \"\$ENV{DESTDIR}\${file}\" OR EXISTS \"\$ENV{DESTDIR}\${file}\")
4964
message(STATUS \"Uninstalling: \$ENV{DESTDIR}\${file}\")
50-
if(EXISTS \"\$ENV{DESTDIR}\${file}\")
51-
execute_process(
52-
COMMAND \${CMAKE_COMMAND} -E remove \"\$ENV{DESTDIR}\${file}\"
53-
OUTPUT_VARIABLE rm_out
54-
RESULT_VARIABLE rm_retval)
55-
if(NOT \"\${rm_retval}\" EQUAL 0)
56-
message(FATAL_ERROR \"Problem when removing \\\"\$ENV{DESTDIR}\${file}\\\"\")
57-
endif()
58-
else()
59-
message(STATUS \"File \\\"\$ENV{DESTDIR}\${file}\\\" does not exist.\")
65+
execute_process(
66+
COMMAND \${CMAKE_COMMAND} -E remove \"\$ENV{DESTDIR}\${file}\"
67+
OUTPUT_VARIABLE rm_out
68+
RESULT_VARIABLE rm_retval)
69+
if(NOT \"\${rm_retval}\" EQUAL 0)
70+
message(FATAL_ERROR \"Problem when removing \\\"\$ENV{DESTDIR}\${file}\\\"\")
6071
endif()
72+
else()
73+
message(STATUS \"Not-found: \$ENV{DESTDIR}\${file}\")
74+
endif()
6175
endforeach(file)
6276
")
6377

64-
if("${CMAKE_GENERATOR}" MATCHES "^(Visual Studio|Xcode)")
65-
set(_uninstall "UNINSTALL")
78+
set(_desc "Uninstall the project...")
79+
if(CMAKE_GENERATOR STREQUAL "Unix Makefiles")
80+
set(_comment COMMAND \$\(CMAKE_COMMAND\) -E cmake_echo_color --switch=$\(COLOR\) --cyan "${_desc}")
6681
else()
67-
set(_uninstall "uninstall")
82+
set(_comment COMMENT "${_desc}")
6883
endif()
69-
add_custom_target(${_uninstall} COMMAND "${CMAKE_COMMAND}" -P "${_filename}")
84+
add_custom_target(${_uninstall}
85+
${_comment}
86+
COMMAND ${CMAKE_COMMAND} -P ${_filename}
87+
USES_TERMINAL
88+
BYPRODUCTS uninstall_byproduct
89+
WORKING_DIRECTORY "${CMAKE_CURRENT_BINARY_DIR}")
90+
set_property(SOURCE uninstall_byproduct PROPERTY SYMBOLIC 1)
91+
7092
set_property(TARGET ${_uninstall} PROPERTY FOLDER "CMakePredefinedTargets")

deps/CMakeLists.txt

-2
Original file line numberDiff line numberDiff line change
@@ -6,8 +6,6 @@ if(USES_MATLAB)
66
add_subdirectory(mxpp)
77
endif()
88

9-
add_subdirectory(sharedlibpp)
10-
119
if(BUILD_TESTING)
1210
add_subdirectory(catch)
1311
endif()

deps/sharedlibpp/.gitignore

-2
This file was deleted.

deps/sharedlibpp/AUTHORS

-10
This file was deleted.

deps/sharedlibpp/CMakeLists.txt

-86
This file was deleted.

deps/sharedlibpp/LICENSE

-26
This file was deleted.

deps/sharedlibpp/README.md

-45
This file was deleted.

0 commit comments

Comments
 (0)