diff --git a/.gitignore b/.gitignore new file mode 100644 index 0000000..51f2338 --- /dev/null +++ b/.gitignore @@ -0,0 +1,2 @@ +# ignore the build folder +build/ \ No newline at end of file diff --git a/CMakeLists.txt b/CMakeLists.txt new file mode 100644 index 0000000..857b786 --- /dev/null +++ b/CMakeLists.txt @@ -0,0 +1,63 @@ +project(stl_reader) +cmake_minimum_required(VERSION 3.16) + +# add the stl_reader as a single target: +add_library(stl_reader INTERFACE) + +target_include_directories(stl_reader + INTERFACE + $ + $ +) + +include(GNUInstallDirs) + +install(DIRECTORY include/stl_reader DESTINATION ${CMAKE_INSTALL_INCLUDEDIR}) + +# define the export of our cmake target: +install( + TARGETS stl_reader + EXPORT stl_readerTargets + LIBRARY DESTINATION ${CMAKE_INSTALL_LIBDIR} + ARCHIVE DESTINATION ${CMAKE_INSTALL_LIBDIR} + RUNTIME DESTINATION ${CMAKE_INSTALL_BINDIR} + INCLUDES DESTINATION ${CMAKE_INSTALL_INCLUDEDIR} +) + +install( + EXPORT stl_readerTargets + FILE stl_readerTargets.cmake + NAMESPACE stl_reader:: + DESTINATION ${CMAKE_INSTALL_LIBDIR}/cmake/stl_reader +) + +# include some helper macros for generating cmake config files: +include(CMakePackageConfigHelpers) + +# create the cmake config files: +configure_package_config_file(${CMAKE_CURRENT_SOURCE_DIR}/cmake/Config.cmake.in + "${CMAKE_CURRENT_BINARY_DIR}/stl_readerConfig.cmake" + INSTALL_DESTINATION ${CMAKE_INSTALL_LIBDIR}/cmake/stl_reader +) + +# install the configuration files that we using the helper macros above: +install( + FILES + "${CMAKE_CURRENT_BINARY_DIR}/stl_readerConfig.cmake" # cmake config file + "${CMAKE_CURRENT_BINARY_DIR}/stl_readerConfigVersion.cmake" # cmake version file + DESTINATION ${CMAKE_INSTALL_LIBDIR}/cmake/stl_reader +) + +set(version 1.0.0) + +# generate the version file for the config file +write_basic_package_version_file( + "${CMAKE_CURRENT_BINARY_DIR}/stl_readerConfigVersion.cmake" + VERSION "${version}" + COMPATIBILITY AnyNewerVersion # probably don't want to set this. Would need to check other options. +) + +if (COLCON_BUILD) + find_package(ament_cmake REQUIRED) + ament_package() +endif() \ No newline at end of file diff --git a/cmake/Config.cmake.in b/cmake/Config.cmake.in new file mode 100644 index 0000000..bece25f --- /dev/null +++ b/cmake/Config.cmake.in @@ -0,0 +1,5 @@ +@PACKAGE_INIT@ + +include("${CMAKE_CURRENT_LIST_DIR}/stl_readerTargets.cmake") +check_required_components(stl_reader) + diff --git a/colcon.pkg b/colcon.pkg new file mode 100644 index 0000000..7e31378 --- /dev/null +++ b/colcon.pkg @@ -0,0 +1,3 @@ +{ + "cmake-args": ["-DCOLCON_BUILD=ON"] +} \ No newline at end of file diff --git a/stl_reader.h b/include/stl_reader/stl_reader.h similarity index 100% rename from stl_reader.h rename to include/stl_reader/stl_reader.h diff --git a/package.xml b/package.xml new file mode 100644 index 0000000..ca78b04 --- /dev/null +++ b/package.xml @@ -0,0 +1,16 @@ + + + + stl_reader + 0.0.0 + A simple package for reading STL files. + Jeff Hough + Nonstandard + + ament_cmake + + + ament_cmake + + +