[cmake-developers] [CMake 0013462]: set_target_properties include_directories should accept multiple parameters
Mantis Bug Tracker
mantis at public.kitware.com
Tue Aug 7 20:50:47 EDT 2012
The following issue has been SUBMITTED.
======================================================================
http://public.kitware.com/Bug/view.php?id=13462
======================================================================
Reported By: Benjamin kay
Assigned To:
======================================================================
Project: CMake
Issue ID: 13462
Category: CMake
Reproducibility: always
Severity: minor
Priority: normal
Status: new
======================================================================
Date Submitted: 2012-08-07 20:50 EDT
Last Modified: 2012-08-07 20:50 EDT
======================================================================
Summary: set_target_properties include_directories should
accept multiple parameters
Description:
The set_target_properties command can be used to set properties on a library or
executable. One of the properties that can be set is INCLUDE_DIRECTORIES, which
is discussed on the mailing list:
http://www.cmake.org/pipermail/cmake/2009-June/030429.html
The ability to set INCLUDE_DIRECTORIES on a specific target without setting it
on an entire directory (i.e. with the include_directories command) is useful;
see related bugs 0008189 and 0001968. Unfortunately, it appears that only one
include directory can be set in this way. Take a simple test project:
project(TESTPROJECT)
add_executable(test test.c)
set_target_properties(test PROPERTIES INCLUDE_DIRECTORIES /var /tmp)
Obviously there's no need to include anything from /var or /tmp -- they're just
there to illustrate the following error that occurs when running cmake:
CMake Error at CMakeLists.txt:3 (set_target_properties):
set_target_properties called with incorrect number of arguments.
The following alternative syntax appears to work, but running make with
VERBOSE=1 reveals that only the last directory included (/tmp in this case) is
actually included. /var is not included.
project(TESTPROJECT)
add_executable(test test.c)
set_target_properties(test PROPERTIES INCLUDE_DIRECTORIES /var
INCLUDE_DIRECTORIES /tmp)
Other variations such as the following also fail (incorrect number of
arguments):
project(TESTPROJECT)
add_executable(test test.c)
set(LIST_OF_DIRECTORIES /var)
list(APPEND LIST_OF_DIRECTORIES /tmp)
set_target_properties(test PROPERTIES INCLUDE_DIRECTORIES
${LIST_OF_DIRECTORIES})
For set_target_properties(target PROPERTIES INCLUDE_DIRECTORIES ...) to be truly
useful, it should be able to accept multiple parameters.
Additional Information:
The version of CMake installed on my system is actually 2.8.9-rc3, not 2.8.8.
======================================================================
Issue History
Date Modified Username Field Change
======================================================================
2012-08-07 20:50 Benjamin kay New Issue
======================================================================
More information about the cmake-developers
mailing list