From 5483ab9d71550716305024c76a0cd56e15320055 Mon Sep 17 00:00:00 2001 From: Simon Gene Gottlieb Date: Mon, 11 Mar 2024 09:04:05 +0100 Subject: [PATCH 01/12] feature: add URI to use shorthand syntax with additional options This allows to combine the shorthand syntax with URI and additional arguments: ``` CPMAddPackage(URI "gh:nlohmann/json@3.9.1" OPTIONS "JSON_BUildTests OFF") ``` This is much shorter than the longer syntax way of writing: ``` CPMAddPackage( NAME nlohmann_json VERSION 3.9.1 GITHUB_REPOSITORY nlohmann/json OPTIONS "JSON_BuildTests OFF" ) ``` --- cmake/CPM.cmake | 26 +++++++++++++++++--------- 1 file changed, 17 insertions(+), 9 deletions(-) diff --git a/cmake/CPM.cmake b/cmake/CPM.cmake index addc20ff..2cc43320 100644 --- a/cmake/CPM.cmake +++ b/cmake/CPM.cmake @@ -594,14 +594,6 @@ endfunction() function(CPMAddPackage) cpm_set_policies() - list(LENGTH ARGN argnLength) - if(argnLength EQUAL 1) - cpm_parse_add_package_single_arg("${ARGN}" ARGN) - - # The shorthand syntax implies EXCLUDE_FROM_ALL and SYSTEM - set(ARGN "${ARGN};EXCLUDE_FROM_ALL;YES;SYSTEM;YES;") - endif() - set(oneValueArgs NAME FORCE @@ -624,10 +616,26 @@ function(CPMAddPackage) set(multiValueArgs URL OPTIONS DOWNLOAD_COMMAND PATCHES) + list(LENGTH ARGN argnLength) + + # Parse single shorthand argument + if(argnLength EQUAL 1) + cpm_parse_add_package_single_arg("${ARGN}" ARGN) + + # The shorthand syntax implies EXCLUDE_FROM_ALL and SYSTEM + set(ARGN "${ARGN};EXCLUDE_FROM_ALL;YES;SYSTEM;YES;") + + # Parse URI shorthand argument + elseif(argnLength GREATER 1 AND "${ARGV0}" STREQUAL "URI") + list(REMOVE_AT ARGN 0 1) # remove "URI gh:<...>@version#tag" + cpm_parse_add_package_single_arg("${ARGV1}" ARGV0) + + set(ARGN "${ARGV0};${ARGN}") + endif() + cmake_parse_arguments(CPM_ARGS "" "${oneValueArgs}" "${multiValueArgs}" "${ARGN}") # Set default values for arguments - if(NOT DEFINED CPM_ARGS_VERSION) if(DEFINED CPM_ARGS_GIT_TAG) cpm_get_version_from_git_tag("${CPM_ARGS_GIT_TAG}" CPM_ARGS_VERSION) From 0d48d18678027ad17978641ace2f411a48370ce0 Mon Sep 17 00:00:00 2001 From: Simon Gene Gottlieb Date: Mon, 11 Mar 2024 09:28:18 +0100 Subject: [PATCH 02/12] fix: use shorthand syntax in examples --- README.md | 15 ++++----------- 1 file changed, 4 insertions(+), 11 deletions(-) diff --git a/README.md b/README.md index 18e8510c..fc59da0d 100644 --- a/README.md +++ b/README.md @@ -411,12 +411,8 @@ CPMAddPackage("gh:jbeder/yaml-cpp#yaml-cpp-0.6.3@0.6.3") ### [nlohmann/json](https://github.com/nlohmann/json) ```cmake -CPMAddPackage( - NAME nlohmann_json - VERSION 3.9.1 - GITHUB_REPOSITORY nlohmann/json - OPTIONS - "JSON_BuildTests OFF" +CPMAddPackage("gh:nlohmann/json@3.9.1" + OPTIONS "JSON_BuildTests OFF" ) ``` @@ -446,8 +442,7 @@ For a working example of using CPM to download and configure the Boost C++ Libra ```cmake # the install option has to be explicitly set to allow installation CPMAddPackage( - GITHUB_REPOSITORY jarro2783/cxxopts - VERSION 2.2.1 + URI "gh:jarro2783/cxxopts@2.2.1" OPTIONS "CXXOPTS_BUILD_EXAMPLES NO" "CXXOPTS_BUILD_TESTS NO" "CXXOPTS_ENABLE_INSTALL YES" ) ``` @@ -456,9 +451,7 @@ CPMAddPackage( ```cmake CPMAddPackage( - NAME benchmark - GITHUB_REPOSITORY google/benchmark - VERSION 1.5.2 + URI "gh:google/benchmark@1.5.2" OPTIONS "BENCHMARK_ENABLE_TESTING Off" ) From 360f5bbc1530355694f37c5a478934484fae48d0 Mon Sep 17 00:00:00 2001 From: Simon Gene Gottlieb Date: Tue, 26 Mar 2024 11:25:45 +0100 Subject: [PATCH 03/12] test: add test for shorthand syntax with options --- README.md | 3 ++- test/integration/test_simple.rb | 30 ++++++++++++++++++++++++++++++ 2 files changed, 32 insertions(+), 1 deletion(-) diff --git a/README.md b/README.md index fc59da0d..43a37074 100644 --- a/README.md +++ b/README.md @@ -411,7 +411,8 @@ CPMAddPackage("gh:jbeder/yaml-cpp#yaml-cpp-0.6.3@0.6.3") ### [nlohmann/json](https://github.com/nlohmann/json) ```cmake -CPMAddPackage("gh:nlohmann/json@3.9.1" +CPMAddPackage( + URI "gh:nlohmann/json@3.9.1" OPTIONS "JSON_BuildTests OFF" ) ``` diff --git a/test/integration/test_simple.rb b/test/integration/test_simple.rb index 33fe3785..d7acd6e2 100644 --- a/test/integration/test_simple.rb +++ b/test/integration/test_simple.rb @@ -83,9 +83,39 @@ def test_update_single_package # ...and notably no test for adder, which must be disabled from the option override from above assert_equal ['simple', 'using-adder'], exes } + update_with_option_off_and_build_with_uri_shorthand_syntax = -> { + prj.create_lists_from_default_template package: <<~PACK + CPMAddPackage( + URI gh:cpm-cmake/testpack-adder@1.0.0 + OPTIONS "ADDER_BUILD_TESTS OFF" + ) + PACK + assert_success prj.configure + assert_success prj.build + + exe_dir = File.join(prj.bin_dir, 'bin') + assert File.directory? exe_dir + + exes = Dir[exe_dir + '/**/*'].filter { + # on multi-configuration generators (like Visual Studio) the executables will be in bin/ + # also filter-out other artifacts like .pdb or .dsym + !File.directory?(_1) && File.stat(_1).executable? + }.map { + # remove .exe extension if any (there will be one on Windows) + File.basename(_1, '.exe') + }.sort + + # we should end up with two executables + # * simple - the simple example from adder + # * using-adder - for this project + # ...and notably no test for adder, which must be disabled from the option override from above + assert_equal ['simple', 'using-adder'], exes + + } create_with_commit_sha.() update_to_version_1.() update_with_option_off_and_build.() + update_with_option_off_and_build_with_uri_shorthand_syntax.() end end From dcc898272b00b99dc5325bec09411bb30703757b Mon Sep 17 00:00:00 2001 From: Simon Gene Gottlieb Date: Tue, 26 Mar 2024 11:36:55 +0100 Subject: [PATCH 04/12] doc: extend README mentioning shorthand syntax with options --- README.md | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) diff --git a/README.md b/README.md index 43a37074..9d25bb4c 100644 --- a/README.md +++ b/README.md @@ -65,6 +65,7 @@ Afterwards, any targets defined in the dependency can be used directly. ```cmake CPMAddPackage( + URI # shorthand including repo, name, version and tag (see shorthand syntax) NAME # The unique name of the dependency (should be the exported target's name) VERSION # The minimum version of the dependency (optional, defaults to 0) PATCHES # Patch files to be applied sequentially using patch and PATCH_OPTIONS (optional) @@ -88,7 +89,7 @@ If an additional optional parameter `SYSTEM` is set to a truthy value, the SYSTE See the [add_subdirectory ](https://cmake.org/cmake/help/latest/command/add_subdirectory.html?highlight=add_subdirectory) and [SYSTEM](https://cmake.org/cmake/help/latest/prop_tgt/SYSTEM.html#prop_tgt:SYSTEM) target property for details. -A single-argument compact syntax is also supported: +A shorthand syntax is also supported: ```cmake # A git package from a given uri with a version @@ -112,6 +113,13 @@ CPMAddPackage("https://example.com/my-package-1.2.3.zip#MD5=68e20f674a48be38d60e CPMAddPackage("https://example.com/my-package.zip@1.2.3") ``` +Additionally, the shorthand syntax can be used with the long version, using the `URI` specifier. +```cmake +CPMAddPackage(URI "gh:nlohmann/json@3.9.1" + OPTIONS "JSON_BuildTests OFF" +) +``` + After calling `CPMAddPackage`, the following variables are defined in the local scope, where `` is the name of the dependency. - `_SOURCE_DIR` is the path to the source of the dependency. From 1f3dd9387802623f0ac27fc16f102f59234de1e2 Mon Sep 17 00:00:00 2001 From: Simon Gene Gottlieb Date: Mon, 23 Dec 2024 11:47:34 +0100 Subject: [PATCH 05/12] feat: URI keyword also sets EXCLUDE_FROM AND SYSTEM --- cmake/CPM.cmake | 2 +- test/integration/test_simple.rb | 30 ++++++++++++++++++++++++++++++ 2 files changed, 31 insertions(+), 1 deletion(-) diff --git a/cmake/CPM.cmake b/cmake/CPM.cmake index 2cc43320..bee6131c 100644 --- a/cmake/CPM.cmake +++ b/cmake/CPM.cmake @@ -630,7 +630,7 @@ function(CPMAddPackage) list(REMOVE_AT ARGN 0 1) # remove "URI gh:<...>@version#tag" cpm_parse_add_package_single_arg("${ARGV1}" ARGV0) - set(ARGN "${ARGV0};${ARGN}") + set(ARGN "${ARGV0};EXCLUDE_FROM_ALL;YES;SYSTEM;YES;${ARGN}") endif() cmake_parse_arguments(CPM_ARGS "" "${oneValueArgs}" "${multiValueArgs}" "${ARGN}") diff --git a/test/integration/test_simple.rb b/test/integration/test_simple.rb index d7acd6e2..14bed174 100644 --- a/test/integration/test_simple.rb +++ b/test/integration/test_simple.rb @@ -110,12 +110,42 @@ def test_update_single_package # * using-adder - for this project # ...and notably no test for adder, which must be disabled from the option override from above assert_equal ['simple', 'using-adder'], exes + } + update_with_option_on_and_build_with_uri_shorthand_syntax_and_exclude_from_override = -> { + prj.create_lists_from_default_template package: <<~PACK + CPMAddPackage( + URI gh:cpm-cmake/testpack-adder@1.0.0 + OPTIONS "ADDER_BUILD_TESTS ON" + EXCLUDE_FROM_ALL NO + ) + PACK + assert_success prj.configure + assert_success prj.build + + exe_dir = File.join(prj.bin_dir, 'bin') + assert File.directory? exe_dir + exes = Dir[exe_dir + '/**/*'].filter { + # on multi-configuration generators (like Visual Studio) the executables will be in bin/ + # also filter-out other artifacts like .pdb or .dsym + !File.directory?(_1) && File.stat(_1).executable? + }.map { + # remove .exe extension if any (there will be one on Windows) + File.basename(_1, '.exe') + }.sort + + # we should end up with two executables + # * simple - the simple example from adder + # * using-adder - for this project + # ...and notably no test for adder, which must be disabled from the option override from above + assert_equal ['simple', 'test-adding', 'using-adder'], exes } + create_with_commit_sha.() update_to_version_1.() update_with_option_off_and_build.() update_with_option_off_and_build_with_uri_shorthand_syntax.() + update_with_option_on_and_build_with_uri_shorthand_syntax_and_exclude_from_override.() end end From 1f0511553227343876a6dc51e01043c88225d9db Mon Sep 17 00:00:00 2001 From: Simon Gene Gottlieb Date: Mon, 23 Dec 2024 11:56:00 +0100 Subject: [PATCH 06/12] doc: more explicit about the behavior of URI --- README.md | 2 ++ 1 file changed, 2 insertions(+) diff --git a/README.md b/README.md index 9d25bb4c..5e4efd56 100644 --- a/README.md +++ b/README.md @@ -75,6 +75,8 @@ CPMAddPackage( ) ``` +`URI` automatically sets `EXCLUDE_FROM_ALL YES` and `SYSTEM YES`. If this is not desired, `EXCLUDE_FROM_ALL NO` and `SYSTEM NO` have to be set. + The origin may be specified by a `GIT_REPOSITORY`, but other sources, such as direct URLs, are [also supported](https://cmake.org/cmake/help/v3.11/module/ExternalProject.html#external-project-definition). If `GIT_TAG` hasn't been explicitly specified it defaults to `v(VERSION)`, a common convention for git projects. On the other hand, if `VERSION` hasn't been explicitly specified, CPM can automatically identify the version from the git tag in some common cases. From e1ae7c20c1d126ffe198f3d55db5728a229d24f6 Mon Sep 17 00:00:00 2001 From: Simon Gene Gottlieb Date: Mon, 28 Apr 2025 10:06:25 +0200 Subject: [PATCH 07/12] doc: adjust README accordingly to PR-Review --- README.md | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/README.md b/README.md index 5e4efd56..d79d424a 100644 --- a/README.md +++ b/README.md @@ -65,7 +65,6 @@ Afterwards, any targets defined in the dependency can be used directly. ```cmake CPMAddPackage( - URI # shorthand including repo, name, version and tag (see shorthand syntax) NAME # The unique name of the dependency (should be the exported target's name) VERSION # The minimum version of the dependency (optional, defaults to 0) PATCHES # Patch files to be applied sequentially using patch and PATCH_OPTIONS (optional) @@ -115,9 +114,10 @@ CPMAddPackage("https://example.com/my-package-1.2.3.zip#MD5=68e20f674a48be38d60e CPMAddPackage("https://example.com/my-package.zip@1.2.3") ``` -Additionally, the shorthand syntax can be used with the long version, using the `URI` specifier. +Additionally, if needed, extra arguments can be provided by using the shorthand syntax with the `URI` specifier. ```cmake -CPMAddPackage(URI "gh:nlohmann/json@3.9.1" +CPMAddPackage( + URI "gh:nlohmann/json@3.9.1" OPTIONS "JSON_BuildTests OFF" ) ``` From e372127716819ff46754db7ce97ca5d60add218f Mon Sep 17 00:00:00 2001 From: Simon Gene Gottlieb Date: Mon, 28 Apr 2025 10:18:51 +0200 Subject: [PATCH 08/12] test: fix inline documentation of test_simple --- test/integration/test_simple.rb | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/test/integration/test_simple.rb b/test/integration/test_simple.rb index 14bed174..59225f4f 100644 --- a/test/integration/test_simple.rb +++ b/test/integration/test_simple.rb @@ -134,10 +134,12 @@ def test_update_single_package File.basename(_1, '.exe') }.sort - # we should end up with two executables + # we should end up with three executables # * simple - the simple example from adder + # * test-adding - test for adder # * using-adder - for this project - # ...and notably no test for adder, which must be disabled from the option override from above + # ...in contrast to update_with_option_off_and_build_with_uri_shorthand_syntax with + # expect adder not to be disabled, since we set `EXCLUDE_FROM_ALL NO`. assert_equal ['simple', 'test-adding', 'using-adder'], exes } From ee09aa1ff977a62ff64db668458160944174ae79 Mon Sep 17 00:00:00 2001 From: Lars Melchior Date: Sat, 3 May 2025 18:07:39 +0200 Subject: [PATCH 09/12] move URI comment --- README.md | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/README.md b/README.md index d79d424a..ab8fbcfa 100644 --- a/README.md +++ b/README.md @@ -74,8 +74,6 @@ CPMAddPackage( ) ``` -`URI` automatically sets `EXCLUDE_FROM_ALL YES` and `SYSTEM YES`. If this is not desired, `EXCLUDE_FROM_ALL NO` and `SYSTEM NO` have to be set. - The origin may be specified by a `GIT_REPOSITORY`, but other sources, such as direct URLs, are [also supported](https://cmake.org/cmake/help/v3.11/module/ExternalProject.html#external-project-definition). If `GIT_TAG` hasn't been explicitly specified it defaults to `v(VERSION)`, a common convention for git projects. On the other hand, if `VERSION` hasn't been explicitly specified, CPM can automatically identify the version from the git tag in some common cases. @@ -114,7 +112,8 @@ CPMAddPackage("https://example.com/my-package-1.2.3.zip#MD5=68e20f674a48be38d60e CPMAddPackage("https://example.com/my-package.zip@1.2.3") ``` -Additionally, if needed, extra arguments can be provided by using the shorthand syntax with the `URI` specifier. +Additionally, if needed, extra arguments can be provided while using single argument syntax by using the shorthand syntax with the `URI` specifier. + ```cmake CPMAddPackage( URI "gh:nlohmann/json@3.9.1" @@ -122,6 +121,8 @@ CPMAddPackage( ) ``` +`URI` automatically sets `EXCLUDE_FROM_ALL YES` and `SYSTEM YES`. If this is not desired, `EXCLUDE_FROM_ALL NO` and `SYSTEM NO` have to be set. + After calling `CPMAddPackage`, the following variables are defined in the local scope, where `` is the name of the dependency. - `_SOURCE_DIR` is the path to the source of the dependency. From 89bab9a3d29d697d76b8d87e92a578a5168ab197 Mon Sep 17 00:00:00 2001 From: Lars Melchior Date: Sat, 3 May 2025 18:55:21 +0200 Subject: [PATCH 10/12] added new test for shorthand syntax --- test/integration/test_shorthand_syntax.rb | 86 +++++++++++++++++++++++ 1 file changed, 86 insertions(+) create mode 100644 test/integration/test_shorthand_syntax.rb diff --git a/test/integration/test_shorthand_syntax.rb b/test/integration/test_shorthand_syntax.rb new file mode 100644 index 00000000..c41bbd6e --- /dev/null +++ b/test/integration/test_shorthand_syntax.rb @@ -0,0 +1,86 @@ +require_relative './lib' + +class TestShorthandSyntax < IntegrationTest + + def get_project_binaries prj + exe_dir = File.join(prj.bin_dir, 'bin') + assert File.directory? exe_dir + return Dir[exe_dir + '/**/*'].filter { + # on multi-configuration generators (like Visual Studio) the executables will be in bin/ + # also filter-out other artifacts like .pdb or .dsym + !File.directory?(_1) && File.stat(_1).executable? + }.map { + # remove .exe extension if any (there will be one on Windows) + File.basename(_1, '.exe') + }.sort + end + + def test_create_with_commit_sha + prj = make_project from_template: 'using-adder' + prj.create_lists_from_default_template package: + 'CPMAddPackage("gh:cpm-cmake/testpack-adder#cad1cd4b4cdf957c5b59e30bc9a1dd200dbfc716")' + assert_success prj.configure + + cache = prj.read_cache + assert_equal 1, cache.packages.size + assert_equal '0', cache.packages['testpack-adder'].ver + + assert_success prj.build + exes = get_project_binaries prj + # No adder projects were built as EXCLUDE_FROM_ALL is implicitly set + assert_equal ['using-adder'], exes + end + + def test_create_with_version + prj = make_project from_template: 'using-adder' + prj.create_lists_from_default_template package: + 'CPMAddPackage("gh:cpm-cmake/testpack-adder@1.0.0")' + assert_success prj.configure + + cache = prj.read_cache + assert_equal 1, cache.packages.size + assert_equal '1.0.0', cache.packages['testpack-adder'].ver + + assert_success prj.build + exes = get_project_binaries prj + assert_equal ['using-adder'], exes + end + + def test_create_with_all + prj = make_project from_template: 'using-adder' + prj.create_lists_from_default_template package: + 'CPMAddPackage( + URI "gh:cpm-cmake/testpack-adder@1.0.0" + EXCLUDE_FROM_ALL false + )' + assert_success prj.configure + + cache = prj.read_cache + assert_equal cache.packages.size, 1 + assert_equal cache.packages['testpack-adder'].ver, '1.0.0' + + assert_success prj.build + exes = get_project_binaries prj + assert_equal exes, ['simple', 'test-adding', 'using-adder'] + end + + def test_create_with_tests_but_without_examples + prj = make_project from_template: 'using-adder' + prj.create_lists_from_default_template package: + 'CPMAddPackage( + URI "gh:cpm-cmake/testpack-adder@1.0.0" + OPTIONS "ADDER_BUILD_EXAMPLES OFF" "ADDER_BUILD_TESTS TRUE" + EXCLUDE_FROM_ALL false + )' + assert_success prj.configure + + cache = prj.read_cache + assert_equal cache.packages.size, 1 + assert_equal cache.packages['testpack-adder'].ver, '1.0.0' + + assert_success prj.build + exes = get_project_binaries prj + assert_equal exes, ['test-adding', 'using-adder'] + end + +end From 29062cf4c120e9ab1c346d8e4221cca88e33765a Mon Sep 17 00:00:00 2001 From: Lars Melchior Date: Sat, 3 May 2025 18:55:54 +0200 Subject: [PATCH 11/12] reset simple test --- test/integration/test_simple.rb | 62 --------------------------------- 1 file changed, 62 deletions(-) diff --git a/test/integration/test_simple.rb b/test/integration/test_simple.rb index 59225f4f..33fe3785 100644 --- a/test/integration/test_simple.rb +++ b/test/integration/test_simple.rb @@ -83,71 +83,9 @@ def test_update_single_package # ...and notably no test for adder, which must be disabled from the option override from above assert_equal ['simple', 'using-adder'], exes } - update_with_option_off_and_build_with_uri_shorthand_syntax = -> { - prj.create_lists_from_default_template package: <<~PACK - CPMAddPackage( - URI gh:cpm-cmake/testpack-adder@1.0.0 - OPTIONS "ADDER_BUILD_TESTS OFF" - ) - PACK - assert_success prj.configure - assert_success prj.build - - exe_dir = File.join(prj.bin_dir, 'bin') - assert File.directory? exe_dir - - exes = Dir[exe_dir + '/**/*'].filter { - # on multi-configuration generators (like Visual Studio) the executables will be in bin/ - # also filter-out other artifacts like .pdb or .dsym - !File.directory?(_1) && File.stat(_1).executable? - }.map { - # remove .exe extension if any (there will be one on Windows) - File.basename(_1, '.exe') - }.sort - - # we should end up with two executables - # * simple - the simple example from adder - # * using-adder - for this project - # ...and notably no test for adder, which must be disabled from the option override from above - assert_equal ['simple', 'using-adder'], exes - } - update_with_option_on_and_build_with_uri_shorthand_syntax_and_exclude_from_override = -> { - prj.create_lists_from_default_template package: <<~PACK - CPMAddPackage( - URI gh:cpm-cmake/testpack-adder@1.0.0 - OPTIONS "ADDER_BUILD_TESTS ON" - EXCLUDE_FROM_ALL NO - ) - PACK - assert_success prj.configure - assert_success prj.build - - exe_dir = File.join(prj.bin_dir, 'bin') - assert File.directory? exe_dir - - exes = Dir[exe_dir + '/**/*'].filter { - # on multi-configuration generators (like Visual Studio) the executables will be in bin/ - # also filter-out other artifacts like .pdb or .dsym - !File.directory?(_1) && File.stat(_1).executable? - }.map { - # remove .exe extension if any (there will be one on Windows) - File.basename(_1, '.exe') - }.sort - - # we should end up with three executables - # * simple - the simple example from adder - # * test-adding - test for adder - # * using-adder - for this project - # ...in contrast to update_with_option_off_and_build_with_uri_shorthand_syntax with - # expect adder not to be disabled, since we set `EXCLUDE_FROM_ALL NO`. - assert_equal ['simple', 'test-adding', 'using-adder'], exes - } - create_with_commit_sha.() update_to_version_1.() update_with_option_off_and_build.() - update_with_option_off_and_build_with_uri_shorthand_syntax.() - update_with_option_on_and_build_with_uri_shorthand_syntax_and_exclude_from_override.() end end From 3012a10465f6f61452255a47c7b8be5927f73387 Mon Sep 17 00:00:00 2001 From: Lars Melchior Date: Sat, 3 May 2025 19:00:37 +0200 Subject: [PATCH 12/12] add that URI must be the first argument --- README.md | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/README.md b/README.md index ab8fbcfa..13e31ed2 100644 --- a/README.md +++ b/README.md @@ -121,7 +121,9 @@ CPMAddPackage( ) ``` -`URI` automatically sets `EXCLUDE_FROM_ALL YES` and `SYSTEM YES`. If this is not desired, `EXCLUDE_FROM_ALL NO` and `SYSTEM NO` have to be set. +The `URI` argument must be the first argument to `CPMAddPackage`. +`URI` automatically sets `EXCLUDE_FROM_ALL YES` and `SYSTEM YES`. +If this is not desired, `EXCLUDE_FROM_ALL NO` and `SYSTEM NO` can be set afterwards. After calling `CPMAddPackage`, the following variables are defined in the local scope, where `` is the name of the dependency.