[CMake] Add subdir and library in CmakeList.txt
William A. Hoffman
billlist at nycap.rr.com
Fri Sep 23 20:30:29 EDT 2005
In cmake 2.2.1 you can use the ADD_SUBDIRECTORY command that will add
the sub directory immediately. I would have to see more of your cmakelist
files to understand the problem you are having here. If File1.c is in
the current directory, then SUBDIRS should not affect it at all.
-Bill
At 06:16 PM 9/23/2005, Jonick, Kathy-P57450 wrote:
>File1.c is location in the current directory. But it is looking in the
>directory listed in the SUBDIRS command. I wanted it to build those
>directories, then create the library in the current directory.
>
>Thanks!
>
>Kathy
>
>-----Original Message-----
>From: William A. Hoffman [mailto:billlist at nycap.rr.com]
>Sent: Friday, September 23, 2005 12:09 PM
>To: Jonick, Kathy-P57450; cmake at cmake.org
>Subject: Re: [CMake] Add subdir and library in CmakeList.txt
>
>
>>
>>Is it possible to include a SUBDIR list as well as a library in one
>CMakeList.txt file?
>>
>>I want to be able to build a library in the current directory, as well
>as call the CMakeList.txt file in 2 subdirectories. My CMakeList.txt
>file looks like:
>>SUBDIRS(dir1 dir2)
>>
>>SET(SOURCES <file list> )
>>
>>ADD_LIBRARY(libname SHARED ${SOURCES})
>>
>>But when I run cmake, I get messages looking for the files listed in
>the subdirectories, rather than the current directory:
>>CMake Error: can not find file
>>/home/cmake_demo/current_dir/dir1/file1.c
>>
>>Tried .c .C .c++ .cc .cpp .cxx .m .M .mm .h .h++ .hm .hpp .hxx .in .txx
>>
>>Is this possible? If not, how do I build the library in current dir?
>How do I say I also want to build subdirectories? I tried using the
>PREORDER flag in the SUBDIRS statement since I want to build those
>first, that that didn't seem to help at all.
>
>This is certainly possible. Where is file1.c added? Could the error
>be in one of the sub dirs?
>
>-Bill
>
>_______________________________________________
>CMake mailing list
>CMake at cmake.org
>http://www.cmake.org/mailman/listinfo/cmake
More information about the CMake
mailing list