[CMake] unable to include a source file for all sub directories

ankit jain ankitguddu at gmail.com
Fri May 15 02:16:43 EDT 2009


Hi all,

My problem is like this...
My source tree structure is:
Main_folder
.. Ident.c
..folder1
........f11.c
........f12.c
..folder2
......f21.c
......f22.c
..folder3
....f31.c
....f32.c

Now iam building a library for main_folder as:

foreach(fname ${folder1_srcs}
list(APPEND main_folder_srcs folder1/${fanme})
endforeach(fname)
foreach(fname ${folder2_srcs}
list(APPEND main_folder_srcs folder2/${fanme})
endforeach(fname)
foreach(fname ${folder3_srcs}
list(APPEND main_folder_srcs folder2/${fanme})
endforeach(fname)

list(APPEND main_folders_srcs Ident.c)
add_library(mylib SHARED ${main_folder_srcs})

Now I am able to get all the source files from all the folders. but the
problem is that all folder source files uses one variable v1 of this Ident.c
file..

So the error iam getting while building the library is :
unresolved external symbol: v1  (iam working on windows VC++)

I am not getting why the sub directories are not able tio extract that
variable v1 from the Ident.c file
Is my way of including the file is wrong..

Please tell what should i do so that the sudirectories files are able to
acccess that varaible v1 from file Ident.c which is outside it as mentioned
in above tree structure...


Regards-
Ankit Jain
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://www.cmake.org/pipermail/cmake/attachments/20090515/38574fa3/attachment.htm>


More information about the CMake mailing list