mirror of
https://github.com/cpm-cmake/CPM.cmake.git
synced 2025-11-24 05:08:01 -05:00
Feature/add missing packageproject options (#524)
* Add missing packageproject options * Fix typos with codespell * Update test/style/CMakeLists.txt Co-authored-by: Lars Melchior <TheLartians@users.noreply.github.com> * fix-cmake-format --------- Co-authored-by: Lars Melchior <TheLartians@users.noreply.github.com>
This commit is contained in:
@@ -52,11 +52,16 @@ parse:
|
|||||||
kwargs:
|
kwargs:
|
||||||
NAME: 1
|
NAME: 1
|
||||||
VERSION: 1
|
VERSION: 1
|
||||||
|
NAMESPACE: 1
|
||||||
INCLUDE_DIR: 1
|
INCLUDE_DIR: 1
|
||||||
INCLUDE_DESTINATION: 1
|
INCLUDE_DESTINATION: 1
|
||||||
|
INCLUDE_HEADER_PATTERN: 1
|
||||||
BINARY_DIR: 1
|
BINARY_DIR: 1
|
||||||
COMPATIBILITY: 1
|
COMPATIBILITY: 1
|
||||||
VERSION_HEADER: 1
|
VERSION_HEADER: 1
|
||||||
|
EXPORT_HEADER: 1
|
||||||
|
DISABLE_VERSION_SUFFIX: 1
|
||||||
|
CPACK: 1
|
||||||
DEPENDENCIES: +
|
DEPENDENCIES: +
|
||||||
cpmusepackagelock:
|
cpmusepackagelock:
|
||||||
pargs: 1
|
pargs: 1
|
||||||
|
|||||||
@@ -32,13 +32,13 @@ function(ASSERT_DEFINED KEY)
|
|||||||
if(DEFINED ${KEY})
|
if(DEFINED ${KEY})
|
||||||
message(STATUS "test passed: '${KEY}' is defined")
|
message(STATUS "test passed: '${KEY}' is defined")
|
||||||
else()
|
else()
|
||||||
message(FATAL_ERROR "assertion failed: '${KEY}' is not defiend")
|
message(FATAL_ERROR "assertion failed: '${KEY}' is not defined")
|
||||||
endif()
|
endif()
|
||||||
endfunction()
|
endfunction()
|
||||||
|
|
||||||
function(ASSERT_NOT_DEFINED KEY)
|
function(ASSERT_NOT_DEFINED KEY)
|
||||||
if(DEFINED ${KEY})
|
if(DEFINED ${KEY})
|
||||||
message(FATAL_ERROR "assertion failed: '${KEY}' is defiend (${${KEY}})")
|
message(FATAL_ERROR "assertion failed: '${KEY}' is defined (${${KEY}})")
|
||||||
else()
|
else()
|
||||||
message(STATUS "test passed: '${KEY}' is not defined")
|
message(STATUS "test passed: '${KEY}' is not defined")
|
||||||
endif()
|
endif()
|
||||||
|
|||||||
@@ -9,8 +9,7 @@ include(../../cmake/CPM.cmake)
|
|||||||
CPMAddPackage(
|
CPMAddPackage(
|
||||||
NAME EnTT
|
NAME EnTT
|
||||||
VERSION 3.1.1
|
VERSION 3.1.1
|
||||||
GITHUB_REPOSITORY skypjack/entt
|
GITHUB_REPOSITORY skypjack/entt # EnTT's CMakeLists screws with configuration options
|
||||||
# EnTT's CMakeLists screws with configuration options
|
|
||||||
DOWNLOAD_ONLY True
|
DOWNLOAD_ONLY True
|
||||||
)
|
)
|
||||||
|
|
||||||
|
|||||||
@@ -56,7 +56,7 @@ int main(int argc, char **argv) {
|
|||||||
int len = atoi(line + 11);
|
int len = atoi(line + 11);
|
||||||
linenoiseHistorySetMaxLen(len);
|
linenoiseHistorySetMaxLen(len);
|
||||||
} else if (line[0] == '/') {
|
} else if (line[0] == '/') {
|
||||||
printf("Unreconized command: %s\n", line);
|
printf("Unrecognized command: %s\n", line);
|
||||||
}
|
}
|
||||||
free(line);
|
free(line);
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -9,7 +9,7 @@ include(../../cmake/CPM.cmake)
|
|||||||
CPMAddPackage("gh:gabime/spdlog@1.8.2")
|
CPMAddPackage("gh:gabime/spdlog@1.8.2")
|
||||||
|
|
||||||
# spdlog uses fmt and bundles that dependency. If you want to use fmt in your project as well, you
|
# spdlog uses fmt and bundles that dependency. If you want to use fmt in your project as well, you
|
||||||
# can let spdlog re-use fmt from CPM.cmake like this:
|
# can let spdlog reuse fmt from CPM.cmake like this:
|
||||||
#
|
#
|
||||||
# cmake-format: off
|
# cmake-format: off
|
||||||
#
|
#
|
||||||
|
|||||||
@@ -12,7 +12,7 @@ To run all tests from the repo root execute:
|
|||||||
$ ruby test/integration/runner.rb
|
$ ruby test/integration/runner.rb
|
||||||
```
|
```
|
||||||
|
|
||||||
The runner will run all tests and generate a report of the exeuction.
|
The runner will run all tests and generate a report of the execution.
|
||||||
|
|
||||||
The current working directory doesn't matter. If you are in `<repo-root>/test/integration`, you can run simply `$ ruby runner.rb`.
|
The current working directory doesn't matter. If you are in `<repo-root>/test/integration`, you can run simply `$ ruby runner.rb`.
|
||||||
|
|
||||||
@@ -34,7 +34,7 @@ Writing tests makes use of the custom integration test framework in `lib.rb`. It
|
|||||||
* There should be no dependency between the test scripts. Each should be executable individually and the order in which multiple ones are executed mustn't matter.
|
* There should be no dependency between the test scripts. Each should be executable individually and the order in which multiple ones are executed mustn't matter.
|
||||||
* The class should contain methods, also prefixed with `test_` which will be executed by the framework. In most cases there would be a single test method per class.
|
* The class should contain methods, also prefixed with `test_` which will be executed by the framework. In most cases there would be a single test method per class.
|
||||||
* In case there are multiple test methods, they will be executed in the order in which they are defined.
|
* In case there are multiple test methods, they will be executed in the order in which they are defined.
|
||||||
* The test methods should contain assertions which check for the expected state of things at varous points of the test's execution.
|
* The test methods should contain assertions which check for the expected state of things at various points of the test's execution.
|
||||||
|
|
||||||
### More
|
### More
|
||||||
|
|
||||||
|
|||||||
@@ -143,7 +143,7 @@ class Project
|
|||||||
end
|
end
|
||||||
|
|
||||||
class IntegrationTest < Test::Unit::TestCase
|
class IntegrationTest < Test::Unit::TestCase
|
||||||
self.test_order = :defined # run tests in order of defintion (as opposed to alphabetical)
|
self.test_order = :defined # run tests in order of definition (as opposed to alphabetical)
|
||||||
|
|
||||||
def cleanup
|
def cleanup
|
||||||
# Clear cpm-related env vars which may have been set by the test
|
# Clear cpm-related env vars which may have been set by the test
|
||||||
|
|||||||
@@ -14,7 +14,7 @@ class MyTest < IntegrationTest
|
|||||||
end
|
end
|
||||||
```
|
```
|
||||||
|
|
||||||
Now we have our test case class, and the single test method that we will require. Let's focus on the method's contents. The integration test framework provides us with a helper class, `Project`, which can be used for this scenario. A project has an assoiciated pair of source and binary directories in the temporary directory and it provides methods to work with them.
|
Now we have our test case class, and the single test method that we will require. Let's focus on the method's contents. The integration test framework provides us with a helper class, `Project`, which can be used for this scenario. A project has an associated pair of source and binary directories in the temporary directory and it provides methods to work with them.
|
||||||
|
|
||||||
We start by creating the project:
|
We start by creating the project:
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user