Skip to content

Commit 2e6c0ce

Browse files
committed
Add 'cmake/' from commit '3cdc566792531119681c4bb3f5b2708403581c1b'
git-subtree-dir: cmake git-subtree-mainline: cd5a7ae git-subtree-split: 3cdc566
2 parents cd5a7ae + 3cdc566 commit 2e6c0ce

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

45 files changed

+3525
-0
lines changed

cmake/.github/CODE_OF_CONDUCT.md

Lines changed: 76 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,76 @@
1+
# Contributor Covenant Code of Conduct
2+
3+
## Our Pledge
4+
5+
In the interest of fostering an open and welcoming environment, we as
6+
contributors and maintainers pledge to making participation in our project and
7+
our community a harassment-free experience for everyone, regardless of age, body
8+
size, disability, ethnicity, sex characteristics, gender identity and expression,
9+
level of experience, education, socio-economic status, nationality, personal
10+
appearance, race, religion, or sexual identity and orientation.
11+
12+
## Our Standards
13+
14+
Examples of behavior that contributes to creating a positive environment
15+
include:
16+
17+
* Using welcoming and inclusive language
18+
* Being respectful of differing viewpoints and experiences
19+
* Gracefully accepting constructive criticism
20+
* Focusing on what is best for the community
21+
* Showing empathy towards other community members
22+
23+
Examples of unacceptable behavior by participants include:
24+
25+
* The use of sexualized language or imagery and unwelcome sexual attention or
26+
advances
27+
* Trolling, insulting/derogatory comments, and personal or political attacks
28+
* Public or private harassment
29+
* Publishing others' private information, such as a physical or electronic
30+
address, without explicit permission
31+
* Other conduct which could reasonably be considered inappropriate in a
32+
professional setting
33+
34+
## Our Responsibilities
35+
36+
Project maintainers are responsible for clarifying the standards of acceptable
37+
behavior and are expected to take appropriate and fair corrective action in
38+
response to any instances of unacceptable behavior.
39+
40+
Project maintainers have the right and responsibility to remove, edit, or
41+
reject comments, commits, code, wiki edits, issues, and other contributions
42+
that are not aligned to this Code of Conduct, or to ban temporarily or
43+
permanently any contributor for other behaviors that they deem inappropriate,
44+
threatening, offensive, or harmful.
45+
46+
## Scope
47+
48+
This Code of Conduct applies both within project spaces and in public spaces
49+
when an individual is representing the project or its community. Examples of
50+
representing a project or community include using an official project e-mail
51+
address, posting via an official social media account, or acting as an appointed
52+
representative at an online or offline event. Representation of a project may be
53+
further defined and clarified by project maintainers.
54+
55+
## Enforcement
56+
57+
Instances of abusive, harassing, or otherwise unacceptable behavior may be
58+
reported by contacting the project team at <[email protected]>. All
59+
complaints will be reviewed and investigated and will result in a response that
60+
is deemed necessary and appropriate to the circumstances. The project team is
61+
obligated to maintain confidentiality with regard to the reporter of an incident.
62+
Further details of specific enforcement policies may be posted separately.
63+
64+
Project maintainers who do not follow or enforce the Code of Conduct in good
65+
faith may face temporary or permanent repercussions as determined by other
66+
members of the project's leadership.
67+
68+
## Attribution
69+
70+
This Code of Conduct is adapted from the [Contributor Covenant][homepage], version 1.4,
71+
available at https://www.contributor-covenant.org/version/1/4/code-of-conduct.html
72+
73+
[homepage]: https://www.contributor-covenant.org
74+
75+
For answers to common questions about this code of conduct, see
76+
https://www.contributor-covenant.org/faq

cmake/.github/CONTRIBUTING.md

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
# Contributing
2+
3+
When contributing to this repository, please first discuss the change you wish to make via issue,
4+
email, or any other method with the owners of this repository before making a change.
5+
6+
Please note we have a [Code of Conduct](/.github/CODE_OF_CONDUCT), please follow it in all your interactions with the project.
7+
8+
## Pull Request Process
9+
10+
1. ...
11+
2. ...
12+

cmake/.github/ISSUE_TEMPLATE.md

Whitespace-only changes.

cmake/.github/PULL_REQUEST_TEMPLATE.md

Whitespace-only changes.

cmake/.gitignore

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
CMakeCache.txt
2+
CMakeFiles
3+
CMakeScripts
4+
Testing
5+
Makefile
6+
cmake_install.cmake
7+
install_manifest.txt
8+
compile_commands.json
9+
CTestTestfile.cmake

cmake/AUTHORS

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
2+
Vicente Eduardo Ferrer Garcia <[email protected]>

cmake/CMakeDebug.cmake

Lines changed: 74 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,74 @@
1+
#
2+
# CMake Debug Utilities by Parra Studios
3+
# CMake debugging utilities and inspection facilities.
4+
#
5+
# Copyright (C) 2016 - 2019 Vicente Eduardo Ferrer Garcia <[email protected]>
6+
#
7+
# Licensed under the Apache License, Version 2.0 (the "License");
8+
# you may not use this file except in compliance with the License.
9+
# You may obtain a copy of the License at
10+
#
11+
# http://www.apache.org/licenses/LICENSE-2.0
12+
#
13+
# Unless required by applicable law or agreed to in writing, software
14+
# distributed under the License is distributed on an "AS IS" BASIS,
15+
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
16+
# See the License for the specific language governing permissions and
17+
# limitations under the License.
18+
#
19+
20+
if(CMAKE_DEBUG_FOUND)
21+
return()
22+
endif()
23+
24+
set(CMAKE_DEBUG_FOUND YES)
25+
26+
execute_process(
27+
COMMAND ${CMAKE_COMMAND} --help-property-list OUTPUT_VARIABLE CMAKE_PROPERTY_LIST
28+
)
29+
30+
string(REGEX REPLACE ";" "\\\\;" CMAKE_PROPERTY_LIST "${CMAKE_PROPERTY_LIST}")
31+
string(REGEX REPLACE "\n" ";" CMAKE_PROPERTY_LIST "${CMAKE_PROPERTY_LIST}")
32+
33+
list(REMOVE_DUPLICATES CMAKE_PROPERTY_LIST)
34+
35+
function(cmake_debug_properties_print)
36+
message(STATUS "CMake Property List:")
37+
38+
foreach(property ${CMAKE_PROPERTY_LIST})
39+
message(STATUS "- ${property}")
40+
endforeach()
41+
endfunction()
42+
43+
function(cmake_debug_properties_target_print target)
44+
if(NOT TARGET ${target})
45+
message(STATUS "CMakeDebug: Invalid target ${target}")
46+
return()
47+
endif()
48+
49+
string(TOUPPER "${CMAKE_BUILD_TYPE}" BUILD_TYPE_NAME)
50+
51+
foreach(property ${CMAKE_PROPERTY_LIST})
52+
string(REPLACE "<CONFIG>" "${BUILD_TYPE_NAME}" property ${property})
53+
54+
string(FIND "${property}" "LOCATION" POSITION)
55+
56+
if(${POSITION} EQUAL -1)
57+
get_property(valid
58+
TARGET ${target}
59+
PROPERTY ${property}
60+
SET
61+
)
62+
63+
if(valid)
64+
get_target_property(value ${target} ${property})
65+
66+
if(NOT "${value}" STREQUAL "value-NOTFOUND")
67+
message(STATUS "${property} = ${value}")
68+
endif()
69+
endif()
70+
endif()
71+
72+
endforeach()
73+
74+
endfunction()

cmake/COPYRIGHT

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
Copyright (C) 2016 - 2019 Vicente Eduardo Ferrer Garcia <[email protected]>
2+
3+
All Rights Reserved.
4+
This work is protected by copyright laws and international treaties.
Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
int main(int argc, char * argv[])
2+
{
3+
char buffer[2];
4+
5+
(void)argv;
6+
7+
return buffer[argc] = 0;
8+
}
Lines changed: 40 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,40 @@
1+
#
2+
# Compiler checker for stack smashing flags by Parra Studios
3+
# Tests if a defined stack smashing security flag is available.
4+
#
5+
# Copyright (C) 2016 - 2019 Vicente Eduardo Ferrer Garcia <[email protected]>
6+
#
7+
# Licensed under the Apache License, Version 2.0 (the "License");
8+
# you may not use this file except in compliance with the License.
9+
# You may obtain a copy of the License at
10+
#
11+
# http://www.apache.org/licenses/LICENSE-2.0
12+
#
13+
# Unless required by applicable law or agreed to in writing, software
14+
# distributed under the License is distributed on an "AS IS" BASIS,
15+
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
16+
# See the License for the specific language governing permissions and
17+
# limitations under the License.
18+
#
19+
20+
include(CheckCSourceCompiles)
21+
22+
# Define current stack smashing program path
23+
get_filename_component(stack_smashing_program_path ${CMAKE_CURRENT_LIST_FILE} PATH)
24+
25+
# Read source file
26+
file(READ ${stack_smashing_program_path}/CheckCCompilerFlagStackSmashing.c stack_smashing_program)
27+
28+
macro(check_c_compiler_flag_stack_smashing _flag _result)
29+
# Store current definitions
30+
set(required_definitions "${CMAKE_REQUIRED_DEFINITIONS}")
31+
32+
# Use the defined flag
33+
set(CMAKE_REQUIRED_DEFINITIONS "${_flag}")
34+
35+
# Compile stack smashing program
36+
check_c_source_compiles("${stack_smashing_program}" ${_result})
37+
38+
# Restore previous required definitions
39+
set(CMAKE_REQUIRED_DEFINITIONS ${required_definitions})
40+
endmacro()

0 commit comments

Comments
 (0)