On 02.04.2014 17:36, Luis Felipe Dominguez Vega wrote:
Hello averyone, i am crash with my brain with this....
this is a little piece of my code...
set(PROG_SRC main.cpp version.cpp)
message(STATUS "TO CHECK: " ${PROG_SRC})
message(STATUS "TO CHECK: " ${PROG_SRC})
is equivalent to message(STATUS "TO CHECK: " "main.cpp" "version.cpp")
message() concatenates the parameters so your message is "TO CHECK:
main.cppversion.cpp".
To prevent the PROG_SRC content from being split when expanding you can
use quotes around the expansion:
message(STATUS "TO CHECK: ${PROG_SRC}")
I'm declared a function to check the style...
function(add_style_check_target TARGET_NAME SOURCES_LIST)
message(STATUS "TO CHECK2: " ${SOURCES_LIST})
endfunction(add_style_check_target)
When you pass ${PROG_SRC} the expansion will split at semicolon again so
your two list item become two arguments.
SOURCE_LIST only covers the first. You can either quote the expansion
again or use e.g. ${ARGN} to access a variable number of arguments past
the given list.
Nils
--
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://www.cmake.org/mailman/listinfo/cmake