Hi CMake ML,

I have a small issue concerning the way generator expressions are resolved when calling another process.

Suppose I have this

set(ALL_DEPENDENCIES_FILES)
foreach(_device IN LISTS ALL_DEVICES)
  list(APPEND ALL_DEPENDENCIES_FILES $<TARGET_FILE:${_device}>)
endforeach()

that creates a list containing generator expressions for locating a target, and then I use this list as an argument to execute process:

add_custom_command(
 TARGET my_target
 POST_BUILD
 COMMAND ${CMAKE_COMMAND}
   -DAPPFOLDER=$<TARGET_FILE_DIR:my_target>/../..
   -DBOOST_FOLDER="${BOOST_LIB_PATH}"
   -DQT_BIN_DIR="${QT_BIN_PATH}"
   -DQML_DIR="${CMAKE_SOURCE_DIR}"
   -DDEPLOY_LIB_DIR="${CMAKE_RUNTIME_OUTPUT_DIRECTORY}"
   -DALL_DEPENDENCIES="${ALL_DEPENDENCIES_FILES}"
   -P ${CMAKE_SOURCE_DIR}/cmake/osx_bundle.cmake)

when I trace the content of ALL_DEPENDENCIES_FILES at the location where the add_custom_command happens, I have this:

message(STATUS "ALL_DEPENDENCIES_FILES CALL '${ALL_DEPENDENCIES_FILES}'") gives

ALL_DEPENDENCIES_FILES CALL '$<TARGET_FILE:mock_emotiv>;$<TARGET_FILE:eeg_lsl>'

which indicates that this is a proper list, where each element is separated by ";".

However, inside the called script osx_bundle.cmake, I see the target location resolved but separated with a space:

message(STATUS "ALL_DEPENDENCIES: '${ALL_DEPENDENCIES}'") gives:

ALL_DEPENDENCIES: '/Users/raffi/Code/my_target/build_make/bin/libmock_emotiv.dylib /Users/raffi/Code/my_target/build_make/bin/libeeg_lsl.dylib'

Why does the list loose its type when passing to the second cmake script through 'add_custom_command' ?

Thanks!
Raffi

--

Powered by www.kitware.com

Please keep messages on-topic and check the CMake FAQ at: 
http://www.cmake.org/Wiki/CMake_FAQ

Kitware offers various services to support the CMake community. For more 
information on each offering, please visit:

CMake Support: http://cmake.org/cmake/help/support.html
CMake Consulting: http://cmake.org/cmake/help/consulting.html
CMake Training Courses: http://cmake.org/cmake/help/training.html

Visit other Kitware open-source projects at 
http://www.kitware.com/opensource/opensource.html

Follow this link to subscribe/unsubscribe:
http://public.kitware.com/mailman/listinfo/cmake-developers

Reply via email to