Skip to content

Commit

Permalink
cmake removed CMAKE_EXPORT_PACKAGE_REGISTRY=ON
Browse files Browse the repository at this point in the history
Removed setting the default value for the CMAKE_EXPORT_PACKAGE_REGISTRY
to ON.

The new behavior is not to set this variable by default. Its initial
value is taken from the TINYORM_EXPORT_PACKAGE_REGISTRY environment
variable if not already defined.

[skip ci]
  • Loading branch information
silverqx committed May 5, 2024
1 parent 1382ac2 commit 5b79996
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 13 deletions.
18 changes: 6 additions & 12 deletions cmake/Modules/TinyInitDefaultVariables.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -6,20 +6,14 @@ macro(tiny_init_cmake_variables_pre)

# Set the CMAKE_EXPORT_PACKAGE_REGISTRY from the TINYORM_EXPORT_PACKAGE_REGISTRY
# environment variable
set(environmentValue ON) # Default value
if(DEFINED ENV{TINYORM_EXPORT_PACKAGE_REGISTRY})
if($ENV{TINYORM_EXPORT_PACKAGE_REGISTRY})
set(environmentValue ON)
else()
set(environmentValue OFF)
endif()
if(NOT DEFINED CMAKE_EXPORT_PACKAGE_REGISTRY AND
DEFINED ENV{TINYORM_EXPORT_PACKAGE_REGISTRY}
)
set(CMAKE_EXPORT_PACKAGE_REGISTRY $ENV{TINYORM_EXPORT_PACKAGE_REGISTRY}
CACHE BOOL "Enables the export(PACKAGE) command, export packages \
to the user package registry")
endif()

set(CMAKE_EXPORT_PACKAGE_REGISTRY ${environmentValue} CACHE BOOL
"Enables the export(PACKAGE) command, export packages to the user package \
registry")
unset(environmentValue)

endmacro()

# Initialize default CMake variables
Expand Down
2 changes: 1 addition & 1 deletion docs/building/tinyorm.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -532,7 +532,7 @@ Important `CMake` options.
| `CMAKE_DISABLE_PRECOMPILE_HEADERS` | `OFF` | Disable precompiled headers. |
| `CMAKE_CXX_COMPILER` | `auto` | The full path to the `C++` compiler. |
| `CMAKE_CXX_COMPILER_LAUNCHER` | `-` | Default compiler launcher to use for the `C++` compiler.<br/>Can be used to enable `ccache`, eg. `ccache.exe` on `MinGW` or `/usr/bin/ccache` on `Linux`. |
| `CMAKE_EXPORT_PACKAGE_REGISTRY` | `ON` | Enable the `export(TinyOrm)` command.<br/>`TinyORM` sets this variable to `ON` by default. |
| `CMAKE_EXPORT_PACKAGE_REGISTRY` | `OFF` | Enable the `export(TinyOrm)` command.<br/>`TinyORM` doesn't set this variable by default. Its initial value is taken from the `TINYORM_EXPORT_PACKAGE_REGISTRY` environment variable if not already defined. |
| `CMAKE_VERBOSE_MAKEFILE` | `OFF` | Enable verbose output from Makefile builds. |

</APITable>
Expand Down

0 comments on commit 5b79996

Please sign in to comment.