Skip to content

Commit

Permalink
Update project layout (#25)
Browse files Browse the repository at this point in the history
* Update project layout

- follow Pitchfork guidelines
- update links
- update README
- update googletest (incidental)
  • Loading branch information
bitweeder authored Sep 21, 2024
1 parent dcc6077 commit 76b686a
Show file tree
Hide file tree
Showing 44 changed files with 133 additions and 157 deletions.
10 changes: 6 additions & 4 deletions .github/workflows/main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
# All Rights Reserved
#
# This file is distributed under the University of Illinois Open Source
# License. See license/License.txt for details.
# License. See LICENSE.md for details.
#
# Configure GitHub actions for continuous integration.
#
Expand Down Expand Up @@ -92,7 +92,7 @@ jobs:
cmake
-S .
-B build
-D CMAKE_BUILD_TYPE=${{ matrix.config.build_type }}
-DCMAKE_BUILD_TYPE=${{ matrix.config.build_type }}
RESULT_VARIABLE
result
)
Expand Down Expand Up @@ -121,13 +121,15 @@ jobs:
execute_process(
COMMAND
cmake --build build
cmake
--build build
--config ${{ matrix.config.build_type }}
RESULT_VARIABLE
result
)
if (NOT result EQUAL 0)
message(FATAL_ERROR "Converting Windows env failed: ${result}")
message(FATAL_ERROR "CMake build failed: ${result}")
endif()
Expand Down
6 changes: 5 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
# global stuff
.DS_Store
/build/
/proj/
/tools/proj/


# CMake stuff; only intended to catch accidental spills
Expand Down Expand Up @@ -47,3 +47,7 @@ Xcode/**/*.mode2
Xcode/**/*.mode2v3
Xcode/**/*.pbxuser
xcuserdata/


# Generated code
/include/lucenaBAL/lbalGenerated.hpp
20 changes: 10 additions & 10 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
All Rights Reserved

This file is distributed under the University of Illinois Open Source
License. See license/License.txt for details.
License. See LICENSE.md for details.

Library usage example:

Expand All @@ -29,7 +29,7 @@
# This minimum is for
# - correct cross-compilation for all Apple OS’s (3.14)
# - correct Xcode project generation (3.15)
cmake_minimum_required (VERSION 3.15)
cmake_minimum_required (VERSION 3.15...3.30)


# Forbid poisoning the source tree, ’cuz we’re authoritarian that way. Note,
Expand Down Expand Up @@ -72,14 +72,14 @@ project ("lucenaBAL"
set (LBAL_PROJECT_PREFIX "lbal")

# Simplify finding our internal CMake tools.
set (CMAKE_MODULE_PATH "${CMAKE_MODULE_PATH}" "${CMAKE_CURRENT_SOURCE_DIR}/cmake")
set (CMAKE_MODULE_PATH "${CMAKE_MODULE_PATH}" "${CMAKE_CURRENT_SOURCE_DIR}/tools/cmake")


# Generate the version header, if necessary, so that it is up-to-date.
set (LBAL_GENERATION_MESSAGE "This file is automatically generated by the build system.")

configure_file (
"${PROJECT_SOURCE_DIR}/cmake/${LBAL_PROJECT_PREFIX}Generated.hpp.in"
"${PROJECT_SOURCE_DIR}/tools/cmake/${LBAL_PROJECT_PREFIX}Generated.hpp.in"
"${PROJECT_SOURCE_DIR}/include/${PROJECT_NAME}/details/${LBAL_PROJECT_PREFIX}Generated.hpp"
@ONLY
NEWLINE_STYLE UNIX
Expand Down Expand Up @@ -153,7 +153,7 @@ set (CMAKE_VISIBILITY_INLINES_HIDDEN 1)
# equivalent effect. All that said, we, we set the global values here, anyway,
# as a clear declaration of intent.
if(NOT "${CMAKE_CXX_STANDARD}")
set(CMAKE_CXX_STANDARD 20)
set(CMAKE_CXX_STANDARD 23)
endif()

if(NOT "${CMAKE_CXX_STANDARD_REQUIRED}")
Expand Down Expand Up @@ -192,7 +192,7 @@ target_include_directories(
target_compile_features(
${PROJECT_NAME}
INTERFACE
cxx_std_17)
cxx_std_23)

# Customized packaging boilerplate
target_compile_definitions (
Expand All @@ -201,7 +201,7 @@ target_compile_definitions (
LBAL_PACKAGING_PRODUCT_IDENTIFIER="${CMAKE_PROJECT_NAME}"
LBAL_PACKAGING_SIGNATURE="lbal"
LBAL_PACKAGING_COPYRIGHT_HOLDER="Lucena"
LBAL_PACKAGING_COPYRIGHT_DATE="2019-2020"
LBAL_PACKAGING_COPYRIGHT_DATE="2019-2024"
LBAL_PACKAGING_PRODUCT_DOMAIN="com.lucena"
LBAL_PACKAGING_PREFIX="lbal"
LBAL_PACKAGING_DESCRIPTION="${CMAKE_PROJECT_DESCRIPTION}"
Expand Down Expand Up @@ -299,7 +299,7 @@ write_basic_package_version_file (
COMPATIBILITY SameMajorVersion)

configure_package_config_file (
"${PROJECT_SOURCE_DIR}/cmake/${PROJECT_NAME}Config.cmake.in"
"${PROJECT_SOURCE_DIR}/tools/cmake/${PROJECT_NAME}Config.cmake.in"
"${PROJECT_BINARY_DIR}/${PROJECT_NAME}Config.cmake"
INSTALL_DESTINATION
${CMAKE_INSTALL_DATAROOTDIR}/${PROJECT_NAME}/cmake
Expand All @@ -326,7 +326,7 @@ install (
"${PROJECT_BINARY_DIR}/${PROJECT_NAME}Config.cmake"
"${PROJECT_BINARY_DIR}/${PROJECT_NAME}ConfigVersion.cmake"
DESTINATION
${CMAKE_INSTALL_DATAROOTDIR}/${PROJECT_NAME}/cmake
${CMAKE_INSTALL_DATAROOTDIR}/${PROJECT_NAME}/tools/cmake
)

install (
Expand All @@ -342,7 +342,7 @@ install (
#]]

if (${BUILD_TESTING})
add_subdirectory (test)
add_subdirectory (tests)
endif()

if (${LBAL_BUILD_DOCS})
Expand Down
33 changes: 33 additions & 0 deletions LICENSE.md
Original file line number Diff line number Diff line change
Expand Up @@ -14,3 +14,36 @@ Permission is hereby granted, free of charge, to any person obtaining a copy of
* Neither the names of Lucena nor the names of its contributors may be used to endorse or promote products derived from this Software without specific prior written permission.

THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE CONTRIBUTORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS WITH THE SOFTWARE.

-----

# Google Test License

Copyright 2008, Google Inc.
All rights reserved.

Redistribution and use in source and binary forms, with or without
modification, are permitted provided that the following conditions are
met:

* Redistributions of source code must retain the above copyright
notice, this list of conditions and the following disclaimer.
* Redistributions in binary form must reproduce the above
copyright notice, this list of conditions and the following disclaimer
in the documentation and/or other materials provided with the
distribution.
* Neither the name of Google Inc. nor the names of its
contributors may be used to endorse or promote products derived from
this software without specific prior written permission.

THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
"AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
16 changes: 7 additions & 9 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,7 @@ Enter **lucenaBAL**:

More detailed instructions are provided below, but for a quick start, simply clone the repository, open up a terminal window, change to the local repo directory, and execute the following:

Under macOS or Linux:
Under macOS or Linux (or other UNIX derivatives):

> mkdir build
> cd build
Expand All @@ -69,7 +69,7 @@ This will:

(Note that tests and docs will remain in the build directory.)

Since lucenaBAL is a header-only library, it is not necessary to link it; simply `#include <lucenaBAL/lucenaBAL.hpp>` where you need feature tests. Usage information is available in the [online docs](https://bitweeder.github.io/lucenaBAL/html/index.html), as well as in the headers themselves (primarily in `<lucenaBAL/lbalFeatureSetup.hpp>`).
Since lucenaBAL is a header-only library, it is not necessary to link to it; simply `#include <lucenaBAL/lucenaBAL.hpp>` where you need feature tests once the headers are installed. Usage information is available in the [online docs](https://bitweeder.github.io/lucenaBAL/html/index.html), as well as in the headers themselves (primarily in `<lucenaBAL/lbalFeatureSetup.hpp>`).

## Prerequisites

Expand All @@ -96,9 +96,9 @@ Line 3 can be changed to:

In line 4, the config may be chosen from the usual set with the usual meanings for CMake: Debug, Release, RelWithDebInfo and MinSizeRel. Alternatively, you may simply call `make`.

Line 5 can be replaced by `make install` (or `sudo make install`). Tests are generated by default and left in `<build>/test`. They can be automatically run by changing line 5 to:
Line 5 can be replaced by `make install` (or `sudo make install`). Tests are generated by default and left in `<build>/tests`. They can be automatically run by changing line 5 to:

5 > cmake --build . --target test
5 > cmake --build . --target tests

Tests can be scripted in the usual way for CMake and CTest, for example in order to only install the library if testing succeeds.

Expand Down Expand Up @@ -137,11 +137,9 @@ We use [SemVer](https://semver.org/) for versioning. For the versions available,

## License

This project is licensed under the University of Illinois/NCSA Open Source License - see the [LICENSE.md](./LICENSE.md) file for details.
This project is licensed under the University of Illinois/NCSA Open Source License - see the [LICENSE.md](./LICENSE.md) file for details. Some portions of the project are governed by other compatible licenses included in that same file, notably:

Some portions of the project are governed by other, compatible licenses, as described in the licenses directory, notably:

- [Google Test](https://github.com/google/googletest) is used under the terms of the BSD 3-Clause license. See [licenses/Google Test License.txt](./licenses/Google%20Test%20License.txt)w. Note that we do not include Google Test itself, but have the build system fetch it as a dependency when generating tests.
- [Google Test](https://github.com/google/googletest) is used under the terms of the BSD 3-Clause license. Note that we do not include Google Test itself, but have the build system fetch it as a dependency when generating tests.

## Acknowledgments

Expand All @@ -153,4 +151,4 @@ Some portions of the project are governed by other, compatible licenses, as desc
- [**Evan Nemerson**](https://evan.nemerson.com/)_Who figured out a_ [_viable cross-platform_ `#warning` _replacement_](https://nemequ.github.io/hedley/) _._
- [**Billie Thompson**](https://github.com/PurpleBooth)_Thanks for the_ [_Readme template_](https://gist.github.com/PurpleBooth/109311bb0361f32d87a2)_!_
- [**Coraline Ada Ehmke**](http://where.coraline.codes/ "Coraline Ada Ehmke")_Creator of_ [_The Contributor Covenant_](https://www.contributor-covenant.org/)_, used here under the terms of the_ [_Creative Commons Attribution License_](https://github.com/ContributorCovenant/contributor_covenant/blob/master/LICENSE.md)

- [**Pitchfork**](https://github.com/vector-of-bool/pitchfork)_For providing a formalized project layout convention based on the work done by John Lakos in_ Large-Scale C++ Software Design _back in 1996._
7 changes: 3 additions & 4 deletions docs/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -6,11 +6,10 @@
All Rights Reserved

This file is distributed under the University of Illinois Open Source
License. See license/License.txt for details.
License. See LICENSE.md for details.

This script expects to be called by the Lucena-Build-Abstraction root
script; in particular, default values for various properties are assumed to
have been previously set.
This script expects to be called by the lucenaBAL root script; in particular,
values for various properties are assumed to have been previously set.

##############################################################################]]

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
All Rights Reserved
This file is distributed under the University of Illinois Open Source
License. See license/License.txt for details.
License. See LICENSE.md for details.
See `lbalFeatureSetup.hpp` for descriptions of the various tokens.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
All Rights Reserved
This file is distributed under the University of Illinois Open Source
License. See license/License.txt for details.
License. See LICENSE.md for details.
See `lbalFeatureSetup.hpp` for descriptions of the various tokens.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
All Rights Reserved
This file is distributed under the University of Illinois Open Source
License. See license/License.txt for details.
License. See LICENSE.md for details.
See `lbalFeatureSetup.hpp` for descriptions of the various tokens.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
All Rights Reserved
This file is distributed under the University of Illinois Open Source
License. See license/License.txt for details.
License. See LICENSE.md for details.
See `lbalFeatureSetup.hpp` for descriptions of the various tokens.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
All Rights Reserved
This file is distributed under the University of Illinois Open Source
License. See license/License.txt for details.
License. See LICENSE.md for details.
See `lbalFeatureSetup.hpp` for descriptions of the various tokens.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
All Rights Reserved
This file is distributed under the University of Illinois Open Source
License. See license/License.txt for details.
License. See LICENSE.md for details.
See `lbalFeatureSetup.hpp` for descriptions of the various tokens.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
All Rights Reserved
This file is distributed under the University of Illinois Open Source
License. See license/License.txt for details.
License. See LICENSE.md for details.
See `lbalFeatureSetup.hpp` for descriptions of the various tokens.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
All Rights Reserved
This file is distributed under the University of Illinois Open Source
License. See license/License.txt for details.
License. See LICENSE.md for details.
See `lbalFeatureSetup.hpp` for descriptions of the various tokens.
Expand Down
2 changes: 1 addition & 1 deletion include/lucenaBAL/details/lbalCompilerSetup.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
All Rights Reserved
This file is distributed under the University of Illinois Open Source
License. See license/License.txt for details.
License. See LICENSE.md for details.
------------------------------------------------------------------------------*/

Expand Down
2 changes: 1 addition & 1 deletion include/lucenaBAL/details/lbalDefinitionTests.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
All Rights Reserved
This file is distributed under the University of Illinois Open Source
License. See license/License.txt for details.
License. See LICENSE.md for details.
See `lbalFeatureSetup.hpp` for descriptions of the various tokens.
Expand Down
2 changes: 1 addition & 1 deletion include/lucenaBAL/details/lbalDetectCompiler.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
All Rights Reserved
This file is distributed under the University of Illinois Open Source
License. See license/License.txt for details.
License. See LICENSE.md for details.
See `lbalFeatureSetup.hpp` for descriptions of the various tokens.
Expand Down
2 changes: 1 addition & 1 deletion include/lucenaBAL/details/lbalDetectStandardLibrary.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
All Rights Reserved
This file is distributed under the University of Illinois Open Source
License. See license/License.txt for details.
License. See LICENSE.md for details.
See `lbalFeatureSetup.hpp` for descriptions of the various tokens.
Expand Down
2 changes: 1 addition & 1 deletion include/lucenaBAL/details/lbalGenerated.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
All Rights Reserved
This file is distributed under the University of Illinois Open Source
License. See license/License.txt for details.
License. See LICENSE.md for details.
This file is automatically generated by the build system.
Expand Down
2 changes: 1 addition & 1 deletion include/lucenaBAL/details/lbalKnownVersions.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
All Rights Reserved
This file is distributed under the University of Illinois Open Source
License. See license/License.txt for details.
License. See LICENSE.md for details.
See `lbalFeatureSetup.hpp` for descriptions of the various tokens.
Expand Down
2 changes: 1 addition & 1 deletion include/lucenaBAL/details/lbalLibrarySetup.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
All Rights Reserved

This file is distributed under the University of Illinois Open Source
License. See license/License.txt for details.
License. See LICENSE.md for details.

See `lbalFeatureSetup.hpp` for descriptions of the various tokens.

Expand Down
2 changes: 1 addition & 1 deletion include/lucenaBAL/details/lbalPlatformSetup.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
All Rights Reserved
This file is distributed under the University of Illinois Open Source
License. See license/License.txt for details.
License. See LICENSE.md for details.
See `lbalFeatureSetup.hpp` for descriptions of the various tokens.
Expand Down
2 changes: 1 addition & 1 deletion include/lucenaBAL/details/lbalVersionSetup.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
All Rights Reserved
This file is distributed under the University of Illinois Open Source
License. See license/License.txt for details.
License. See LICENSE.md for details.
See `lbalFeatureSetup.hpp` for descriptions of the various tokens.
Expand Down
Loading

0 comments on commit 76b686a

Please sign in to comment.