Skip to content

Commit

Permalink
Rename INCLUDE_DIR : REPLACE_IGNITION_INCLUDE_PATH
Browse files Browse the repository at this point in the history
Signed-off-by: Steve Peters <[email protected]>
  • Loading branch information
scpeters committed Nov 11, 2021
1 parent 5b0dc63 commit 6c2ffe5
Show file tree
Hide file tree
Showing 3 changed files with 9 additions and 8 deletions.
11 changes: 6 additions & 5 deletions cmake/IgnConfigureProject.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -6,10 +6,11 @@
#
# Sets up an ignition library project.
#
# INCLUDE_DIR: Optional. Specify include folder names. Defaults to
# ignition/${IGN_DESIGNATION}
# NO_IGNITION_PREFIX: Optional. Don't use ignition as prefix in
# cmake project name.
# REPLACE_IGNITION_INCLUDE_PATH: Optional. Specify include folder
# names to replace the default value of
# ignition/${IGN_DESIGNATION}
# VERSION_SUFFIX: Optional. Specify a prerelease version suffix.
#
#===============================================================================
Expand All @@ -34,7 +35,7 @@ macro(ign_configure_project)
#------------------------------------
# Define the expected arguments
set(options NO_IGNITION_PREFIX)
set(oneValueArgs INCLUDE_DIR VERSION_SUFFIX)
set(oneValueArgs REPLACE_IGNITION_INCLUDE_PATH VERSION_SUFFIX)
set(multiValueArgs) # We are not using multiValueArgs yet

#------------------------------------
Expand Down Expand Up @@ -84,8 +85,8 @@ macro(ign_configure_project)
set(PROJECT_EXPORT_NAME ${PROJECT_NAME_LOWER})
set(PROJECT_LIBRARY_TARGET_NAME ${PROJECT_NAME_LOWER})

if(ign_configure_project_INCLUDE_DIR)
set(PROJECT_INCLUDE_DIR ${ign_configure_project_INCLUDE_DIR})
if(ign_configure_project_REPLACE_IGNITION_INCLUDE_PATH)
set(PROJECT_INCLUDE_DIR ${ign_configure_project_REPLACE_IGNITION_INCLUDE_PATH})
else()
set(PROJECT_INCLUDE_DIR ignition/${IGN_DESIGNATION})
endif()
Expand Down
4 changes: 2 additions & 2 deletions examples/no_ignition_prefix/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,8 @@ cmake_minimum_required(VERSION 3.10.2 FATAL_ERROR)
project(no_ignition_prefix VERSION 0.1.0)
find_package(ignition-cmake2 REQUIRED)
ign_configure_project(
INCLUDE_DIR no_ign
NO_IGNITION_PREFIX)
NO_IGNITION_PREFIX
REPLACE_IGNITION_INCLUDE_PATH no_ign)
ign_configure_build(QUIT_IF_BUILD_ERRORS)
ign_create_packages()
ign_create_docs()
2 changes: 1 addition & 1 deletion examples/no_ignition_prefix/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ make package_source

## Configuring include directory names

This package uses the `INCLUDE_DIR` option in `ign_configure_project`
This package uses the `REPLACE_IGNITION_INCLUDE_PATH` option in `ign_configure_project`
to allow a custom include path of `no_ign`, which doesn't start with `ignition/`.
To confirm, build the package and observe that `AlmostEmpty.cc`
compiles successfully while including `no_ign/Export.hh`:
Expand Down

0 comments on commit 6c2ffe5

Please sign in to comment.