Skip to content

Commit

Permalink
adding underscore to CXX namespace
Browse files Browse the repository at this point in the history
  • Loading branch information
Greg Hewett committed Aug 31, 2023
1 parent 8c6dfc0 commit b11c87c
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 5 deletions.
15 changes: 11 additions & 4 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -8,11 +8,18 @@ project(mlspp
option(TESTING "Build tests" OFF)
option(CLANG_TIDY "Perform linting with clang-tidy" OFF)
option(SANITIZERS "Enable sanitizers" OFF)
option(MLS_NAMESPACE_SUFFIX "Namespace Suffix for CXX and CMake Export")

if(MLS_NAMESPACE_SUFFIX)
set(MLS_CXX_NAMESPACE "mls_${MLS_NAMESPACE_SUFFIX}" CACHE STRING "Top-level Namespace for CXX")
set(MLS_EXPORT_NAMESPACE "MLSPP${MLS_NAMESPACE_SUFFIX}" CACHE STRING "Namespace for CMake Export")
else()
set(MLS_CXX_NAMESPACE "mls" CACHE STRING "Top-level Namespace for CXX")
set(MLS_EXPORT_NAMESPACE "MLSPP" CACHE STRING "Namespace for CMake Export")
endif()
message(STATUS "CXX Namespace: ${MLS_CXX_NAMESPACE}")
message(STATUS "CMake Export Namespace: ${MLS_EXPORT_NAMESPACE}")

# Default values for the namespaces are adequate for most uses.
set(MLS_NAMESPACE_SUFFIX "" CACHE STRING "Namespace Suffix for CPP and CMake Export")
set(MLS_CPP_NAMESPACE "mls${MLS_NAMESPACE_SUFFIX}" CACHE STRING "Top-level Namespace for CPP")
set(MLS_EXPORT_NAMESPACE "MLSPP${MLS_NAMESPACE_SUFFIX}" CACHE STRING "Namespace for CMake Export")

###
### Global Config
Expand Down
2 changes: 1 addition & 1 deletion cmake/namespace.h.in
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
#pragma once

// Configurable top-level MLS namespace
#define MLS_NAMESPACE @MLS_CPP_NAMESPACE@
#define MLS_NAMESPACE @MLS_CXX_NAMESPACE@

0 comments on commit b11c87c

Please sign in to comment.