[CMake] Clarification for quoting of parameters for "add_executable()"

SF Markus Elfring elfring at users.sourceforge.net
Wed Jan 12 16:21:47 EST 2011


> I hope that the involved technical details can be better resolved in a wider audience.

Now I would like to show a small script which demonstrates a specific detail in 
the wording of an error message that I did not expect in this way.

cmake_minimum_required(VERSION 2.6)
project(Bug11677)
set(MY_SOURCES "Alpha.cxx" "${Bug11677_SOURCE_DIR}/Zulu.cxx")
message(STATUS "=>${MY_SOURCES}<=")
add_executable(Bug11677 "${MY_SOURCES}")


Log result example for the build file generation try:

=>Alpha.cxx;/home/elfring/Projekte/CMake/Test/11677/source/Zulu.cxx<=
Configuring done
CMake Error at CMakeLists.txt:5 (add_executable):
   Cannot find source file "Zulu.cxx".  Tried extensions .c .C .c++ .cc .cpp
   .cxx .m .M .mm .h .hh .h++ .hm .hpp .hxx .in .txx


elfring at Sonne:~/Projekte/CMake/Test/11677/source> ls -l
insgesamt 12
-rw-r--r-- 1 elfring users 130 10. Jan 22:37 Alpha.cxx
-rw-r--r-- 1 elfring users 198 12. Jan 21:46 CMakeLists.txt
-rw-r--r-- 1 elfring users 130 10. Jan 22:37 Zulu.cxx


How do you think about this situation?

Regards,
Markus


More information about the CMake mailing list