-
Notifications
You must be signed in to change notification settings - Fork 31
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Add examples using static libraries (#202)
This adds an example that builds a static library and a second example that links against that static library. Signed-off-by: Steve Peters <[email protected]>
- Loading branch information
Showing
13 changed files
with
109 additions
and
0 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,8 @@ | ||
cmake_minimum_required(VERSION 3.10.2 FATAL_ERROR) | ||
project(ignition-core_no_deps_static VERSION 0.1.0) | ||
find_package(ignition-cmake2 REQUIRED) | ||
ign_configure_project() | ||
OPTION(BUILD_SHARED_LIBS OFF) | ||
ign_configure_build(QUIT_IF_BUILD_ERRORS) | ||
ign_create_packages() | ||
ign_create_docs() |
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,14 @@ | ||
# core\_nodep\_static example | ||
|
||
This package sets the `BUILD_SHARED_LIBS` cmake variable to `OFF`, | ||
ensuring that a static library will be created. | ||
The package has no dependencies. | ||
|
||
To build: | ||
|
||
~~~ | ||
mkdir build | ||
cd build | ||
cmake .. | ||
make | ||
~~~ |
Empty file.
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,29 @@ | ||
/* | ||
* Copyright (C) 2021 Open Source Robotics Foundation | ||
* | ||
* Licensed under the Apache License, Version 2.0 (the "License"); | ||
* you may not use this file except in compliance with the License. | ||
* You may obtain a copy of the License at | ||
* | ||
* http://www.apache.org/licenses/LICENSE-2.0 | ||
* | ||
* Unless required by applicable law or agreed to in writing, software | ||
* distributed under the License is distributed on an "AS IS" BASIS, | ||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. | ||
* See the License for the specific language governing permissions and | ||
* limitations under the License. | ||
* | ||
*/ | ||
|
||
#include <ignition/core_no_deps_static/Export.hh> | ||
|
||
namespace ignition | ||
{ | ||
namespace core_no_deps | ||
{ | ||
class IGNITION_CORE_NO_DEPS_STATIC_VISIBLE AlmostEmpty | ||
{ | ||
public: AlmostEmpty() = default; | ||
}; | ||
} | ||
} |
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,3 @@ | ||
ign_get_libsources_and_unittests(sources gtest_sources) | ||
ign_create_core_library(SOURCES ${sources} CXX_STANDARD 11) | ||
ign_build_tests(TYPE UNIT SOURCES ${gtest_sources}) |
Empty file.
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,8 @@ | ||
cmake_minimum_required(VERSION 3.10.2 FATAL_ERROR) | ||
project(ignition-core_static_child VERSION 0.1.0) | ||
find_package(ignition-cmake2 REQUIRED) | ||
ign_configure_project() | ||
ign_find_package(ignition-core_no_deps_static REQUIRED) | ||
ign_configure_build(QUIT_IF_BUILD_ERRORS) | ||
ign_create_packages() | ||
ign_create_docs(TAGFILES "${IGNITION-CORE_NO_DEPS_STATIC_DOXYGEN_TAGFILE} = ${IGNITION-CORE_NO_DEPS_STATIC_API_URL}") |
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,15 @@ | ||
# core\_static\_child example | ||
|
||
This package links against that static library provided by | ||
the `core_no_deps_static` package. | ||
|
||
To build, ensure that `core_no_deps_static` has been installed somewhere | ||
in your `CMAKE_PREFIX_PATH` and then run: | ||
|
||
~~~ | ||
mkdir build | ||
cd build | ||
cmake .. | ||
make | ||
~~~ | ||
|
Empty file.
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,6 @@ | ||
ign_get_libsources_and_unittests(sources gtest_sources) | ||
ign_create_core_library(SOURCES ${sources} CXX_STANDARD 11) | ||
target_link_libraries(${PROJECT_LIBRARY_TARGET_NAME} | ||
PUBLIC | ||
ignition-core_no_deps_static::ignition-core_no_deps_static) | ||
ign_build_tests(TYPE UNIT SOURCES ${gtest_sources}) |
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,17 @@ | ||
/* | ||
* Copyright (C) 2021 Open Source Robotics Foundation | ||
* | ||
* Licensed under the Apache License, Version 2.0 (the "License"); | ||
* you may not use this file except in compliance with the License. | ||
* You may obtain a copy of the License at | ||
* | ||
* http://www.apache.org/licenses/LICENSE-2.0 | ||
* | ||
* Unless required by applicable law or agreed to in writing, software | ||
* distributed under the License is distributed on an "AS IS" BASIS, | ||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. | ||
* See the License for the specific language governing permissions and | ||
* limitations under the License. | ||
* | ||
*/ | ||
|
Empty file.