Skip to content

Commit a3d2808

Browse files
authored
Merge pull request #1 from tirimatangi/upload
Upload to github
2 parents 0160974 + dfd1197 commit a3d2808

File tree

10 files changed

+3120
-30
lines changed

10 files changed

+3120
-30
lines changed

.gitignore

Lines changed: 10 additions & 28 deletions
Original file line numberDiff line numberDiff line change
@@ -1,32 +1,14 @@
1-
# Prerequisites
2-
*.d
3-
4-
# Compiled Object files
5-
*.slo
6-
*.lo
1+
# Compiled source #
2+
###################
3+
*.out
4+
*.dll
5+
*.exe
76
*.o
8-
*.obj
9-
10-
# Precompiled Headers
11-
*.gch
12-
*.pch
13-
14-
# Compiled Dynamic libraries
157
*.so
16-
*.dylib
17-
*.dll
18-
19-
# Fortran module files
20-
*.mod
21-
*.smod
228

23-
# Compiled Static libraries
24-
*.lai
25-
*.la
26-
*.a
27-
*.lib
9+
# CMake leftovers
10+
Makefile
11+
CMakeCache.txt
12+
cmake_*.cmake
13+
_debs
2814

29-
# Executables
30-
*.exe
31-
*.out
32-
*.app

CMakeLists.txt

Lines changed: 76 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,76 @@
1+
cmake_minimum_required(VERSION 3.14)
2+
3+
project(LazyExpression
4+
VERSION 0.0.1
5+
DESCRIPTION "Header-only library for variadic and recursive expression templates."
6+
HOMEPAGE_URL "https://github.com/tirimatangi/LazyExpression"
7+
LANGUAGES CXX)
8+
9+
# ---- Warning guard ----
10+
11+
# Protect dependents from this project's warnings if the guard isn't disabled
12+
set(LazyExpression_warning_guard SYSTEM)
13+
if(LazyExpression_INCLUDE_WITHOUT_SYSTEM)
14+
set(LazyExpression_warning_guard "")
15+
endif()
16+
17+
# ---- Declare library ----
18+
# Use release build by default.
19+
if (NOT CMAKE_BUILD_TYPE OR CMAKE_BUILD_TYPE STREQUAL "")
20+
set(CMAKE_BUILD_TYPE "Release" CACHE STRING "" FORCE)
21+
endif()
22+
23+
set(CMAKE_CXX_FLAGS_RELEASE "-O3 -DNDEBUG")
24+
set(CMAKE_CXX_FLAGS_DEBUG "-Wall -ftemplate-backtrace-limit=0 -DDEBUG -g")
25+
26+
if(${CMAKE_BUILD_TYPE} MATCHES "Release")
27+
message("CMAKE_CXX_FLAGS_RELEASE is ${CMAKE_CXX_FLAGS_RELEASE}")
28+
endif()
29+
30+
if(${CMAKE_BUILD_TYPE} MATCHES "Debug")
31+
message("CMAKE_CXX_FLAGS_DEBUG is ${CMAKE_CXX_FLAGS_DEBUG}")
32+
endif()
33+
34+
35+
add_library(LazyExpression INTERFACE)
36+
add_library(LazyExpression::LazyExpression ALIAS LazyExpression)
37+
38+
target_include_directories(LazyExpression
39+
${LazyExpression_warning_guard}
40+
INTERFACE
41+
"$<BUILD_INTERFACE:${PROJECT_SOURCE_DIR}/include>")
42+
43+
target_compile_features(LazyExpression INTERFACE cxx_std_17)
44+
45+
# ---- Install ----
46+
47+
include(CMakePackageConfigHelpers)
48+
include(GNUInstallDirs)
49+
50+
set(LazyExpression_directory "LazyExpression-${PROJECT_VERSION}")
51+
set(LazyExpression_include_directory
52+
"${CMAKE_INSTALL_INCLUDEDIR}/${LazyExpression_directory}")
53+
54+
install(DIRECTORY "${PROJECT_SOURCE_DIR}/include/"
55+
DESTINATION "${LazyExpression_include_directory}")
56+
57+
install(TARGETS LazyExpression
58+
EXPORT LazyExpressionTargets
59+
INCLUDES DESTINATION "${LazyExpression_include_directory}")
60+
61+
write_basic_package_version_file(
62+
LazyExpressionConfigVersion.cmake
63+
COMPATIBILITY SameMajorVersion
64+
ARCH_INDEPENDENT)
65+
66+
set(LazyExpression_install_cmakedir
67+
"${CMAKE_INSTALL_LIBDIR}/cmake/${LazyExpression_directory}")
68+
69+
install(FILES
70+
"${PROJECT_SOURCE_DIR}/cmake/LazyExpressionConfig.cmake"
71+
"${PROJECT_BINARY_DIR}/LazyExpressionConfigVersion.cmake"
72+
DESTINATION "${LazyExpression_install_cmakedir}")
73+
74+
install(EXPORT LazyExpressionTargets
75+
NAMESPACE LazyExpression::
76+
DESTINATION "${LazyExpression_install_cmakedir}")

LICENSE

Lines changed: 24 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,24 @@
1+
This is free and unencumbered software released into the public domain.
2+
3+
Anyone is free to copy, modify, publish, use, compile, sell, or
4+
distribute this software, either in source code form or as a compiled
5+
binary, for any purpose, commercial or non-commercial, and by any
6+
means.
7+
8+
In jurisdictions that recognize copyright laws, the author or authors
9+
of this software dedicate any and all copyright interest in the
10+
software to the public domain. We make this dedication for the benefit
11+
of the public at large and to the detriment of our heirs and
12+
successors. We intend this dedication to be an overt act of
13+
relinquishment in perpetuity of all present and future rights to this
14+
software under copyright law.
15+
16+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
17+
EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
18+
MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.
19+
IN NO EVENT SHALL THE AUTHORS BE LIABLE FOR ANY CLAIM, DAMAGES OR
20+
OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE,
21+
ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR
22+
OTHER DEALINGS IN THE SOFTWARE.
23+
24+
For more information, please refer to <https://unlicense.org>

0 commit comments

Comments
 (0)