Skip to content

Commit

Permalink
update name of install versioned paths option
Browse files Browse the repository at this point in the history
  • Loading branch information
justend29 committed Mar 12, 2024
1 parent a5fd480 commit fe75870
Show file tree
Hide file tree
Showing 4 changed files with 10 additions and 20 deletions.
2 changes: 1 addition & 1 deletion CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
cmake_minimum_required(VERSION 3.24)
project(
jgd-cmake-modules
VERSION 3.1.0
VERSION 3.2.0
DESCRIPTION "CMake library for standardized CMake projects for JGD"
HOMEPAGE_URL "https://jgd-solutions.github.io/jgd-cmake-modules/"
LANGUAGES NONE)
Expand Down
14 changes: 1 addition & 13 deletions jgd-cmake-modules/JcmAddOption.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,6 @@ jcm_add_option
.. code-block:: cmake

jcm_add_option(

[WITHOUT_NAME_PREFIX_CHECK]
NAME <option-name>
DESCRIPTION <description>
Expand Down Expand Up @@ -144,6 +143,7 @@ function(jcm_add_option)
ONE_VALUE_KEYWORDS "NAME" "TYPE" "DEFAULT" "DESCRIPTION" "CONDITION" "CONDITION_MET_DEFAULT"
MULTI_VALUE_KEYWORDS "ACCEPT_VALUES"
REQUIRES_ALL "NAME" "TYPE" "DEFAULT" "DESCRIPTION"
MUTUALLY_INCLUSIVE "CONDITION" "CONDITION_MET_DEFAULT"
ARGUMENTS "${ARGN}")

# Usage Guards
Expand All @@ -154,18 +154,6 @@ function(jcm_add_option)
"it names type '${ARGS_TYPE}'")
endif()

if(DEFINED ARGS_CONDITION AND NOT DEFINED ARGS_CONDITION_MET_DEFAULT)
message(FATAL_ERROR
"The argument 'CONDITION' must be accompanied by argument 'CONDITION_MET_DEFAULT' in "
"function ${CMAKE_CURRENT_FUNCTION}")
endif()

if(NOT DEFINED ARGS_CONDITION AND DEFINED ARGS_CONDITION_MET_DEFAULT)
message(AUTHOR_WARNING
"Argument 'CONDITION_MET_DEFAULT' has no effect when argument 'CONDITION' isn't provided in "
"function ${CMAKE_CURRENT_FUNCTION}")
endif()

# Option naming scheme
set(expected_option_prefix "${JCM_PROJECT_PREFIX_NAME}_")
if(NOT ARGS_WITHOUT_NAME_PREFIX_CHECK AND NOT ARGS_NAME MATCHES "^${expected_option_prefix}*")
Expand Down
12 changes: 7 additions & 5 deletions jgd-cmake-modules/JcmInstallConfigFilePackage.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -71,7 +71,7 @@ The following project options are created:
option to override this behaviour, such as generating install rules when the project is not
top-level.

<JCM_PROJECT_PREFIX_NAME>_INSTALL_VERSIONED
<JCM_PROJECT_PREFIX_NAME>_INSTALL_VERSIONED_PATHS
Boolean controlling whether the install rules produced by this function will install to versioned paths
or not. This does not affect the config-file package's version-file which is always installed.
The default value is :cmake:`ON`, meaning installation paths will include
Expand Down Expand Up @@ -123,7 +123,7 @@ Examples
#]=======================================================================]
function(jcm_install_config_file_package)
jcm_parse_arguments(
OPTIONS "CONFIGURE_PACKAGE_CONFIG_FILES" "INSTALL_LICENSES" "INSTALL_VERSIONED_DEFAULT_OFF"
OPTIONS "CONFIGURE_PACKAGE_CONFIG_FILES" "INSTALL_LICENSES" "INSTALL_VERSIONED_PATHS_DEFAULT_OFF"
MULTI_VALUE_KEYWORDS "TARGETS;CMAKE_MODULES"
REQUIRES_ANY "TARGETS;CMAKE_MODULES;INSTALL_LICENSES"
ARGUMENTS "${ARGN}")
Expand Down Expand Up @@ -156,11 +156,13 @@ function(jcm_install_config_file_package)
endif()

jcm_add_option(
NAME ${JCM_PROJECT_PREFIX_NAME}_INSTALL_VERSIONED
DESCRIPTION "Controls whether install destinations will use versioned paths"
TYPE BOOL
NAME ${JCM_PROJECT_PREFIX_NAME}_INSTALL_VERSIONED_PATHS
DESCRIPTION "Controls whether install destinations will use versioned paths"
CONDITION "${JCM_PROJECT_PREFIX_NAME}_ENABLE_INSTALL"
CONDITION_MET_DEFAULT ON
DEFAULT ON)
if(${${JCM_PROJECT_PREFIX_NAME}_INSTALL_VERSIONED})
if(${${JCM_PROJECT_PREFIX_NAME}_INSTALL_VERSIONED_PATHS})
set(install_cmake_dir "${JCM_INSTALL_CMAKE_DESTINATION}")
set(install_include_dir "${JCM_INSTALL_INCLUDE_DIR}")
set(install_doc_dir "${JCM_INSTALL_DOC_DIR}")
Expand Down
2 changes: 1 addition & 1 deletion vcpkg.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "jgd-cmake-modules",
"version": "3.1.0",
"version": "3.2.0",
"description": "CMake library for standardized CMake projects for JGD",
"homepage": "https://jgd-solutions.github.io/jgd-cmake-modules/",
"dependencies": []
Expand Down

0 comments on commit fe75870

Please sign in to comment.