[CMake] SET_SOURCE_FILES_PROPERTIES question

John Biddiscombe biddisco at cscs.ch
Tue Feb 7 16:57:23 EST 2006


Bill,

Thanks. Works ok with extra source path on both
submitted as Bug *#2859

JB

*William A. Hoffman wrote:
> Try using CMAKE_CURRENT_SOURCE_DIR in both the SET and the SET_SOURCE_FILE_PROPERTIES.
> This does seem to be a bug, and you should report it.
>
> Here is an example that works:
> PROJECT(foo)
> SET(foosrc subprj/sublib.c)
> SET_SOURCE_FILES_PROPERTIES(
>   foo.cxx
>   ${CMAKE_CURRENT_SOURCE_DIR}/subprj/sublib.c WRAP_EXCLUDE )
>
> GET_SOURCE_FILE_PROPERTY(FOO ${CMAKE_CURRENT_SOURCE_DIR}/subprj/sublib.c WRAP_EXCLUDE)
> MESSAGE("${FOO}")
> GET_SOURCE_FILE_PROPERTY(FOO foo.cxx WRAP_EXCLUDE)
> MESSAGE("${FOO}")
> ADD_EXECUTABLE(foobar ${foosrc} foo.cxx)
>
> You can test with the GET_SOURCE_FILE_PROPERTY to make sure it is working.
>
> -Bill
>
> At 12:49 PM 2/3/2006, John Biddiscombe wrote:
>   
>> I always seem to have trouble with constructs like this...
>>
>> SET(vtkCSCSNetCDF_SRCS
>> vtkNetCDFReader.cxx
>> netcdfcpp/ncvalues.cpp
>> netcdfcpp/netcdf.cpp
>> )
>>
>> SET_SOURCE_FILES_PROPERTIES(
>> netcdfcpp/ncvalues
>> netcdfcpp/netcdf
>> WRAP_EXCLUDE
>> )
>>
>> if the couple of src files I want included are in sub directories, it seems to be impossible to get the WRAP_+EXCLUDE and ABSTRACT flags to be tagged to them.
>> With ot without full paths, with or without .cpp on the end of the filename, the WRAP_EXCLUDE just won't go on.
>>
>> What's the correct way to handle it
>> tried
>> netcdfcpp/ncvalues
>> netcdfcpp/ncvalues.cpp
>> {CMAKE_CURRENT_SOURCE_DIR}/netcdfcpp/ncvalues
>> {CMAKE_CURRENT_SOURCE_DIR}/netcdfcpp/ncvalues.cpp
>> ncvalues
>> ncvalues.cpp
>> but it just doesn't work. I'm sure I fixed this once before but can't remember if was it in my cmake source or not.
>>
>> can anyone help?
>>
>> thanks
>>
>> JB
>>
>>
>> -- 
>> John Biddiscombe,                            email:biddisco @ cscs.ch
>> http://www.cscs.ch/about/BJohn.php
>> CSCS, Swiss National Supercomputing Centre  | Tel:  +41 (91) 610.82.07
>> Via Cantonale, 6928 Manno, Switzerland      | Fax:  +41 (91) 610.82.82
>>
>>
>> _______________________________________________
>> CMake mailing list
>> CMake at cmake.org
>> http://www.cmake.org/mailman/listinfo/cmake
>>     
>
>   


-- 
John Biddiscombe,                            email:biddisco @ cscs.ch
http://www.cscs.ch/about/BJohn.php
CSCS, Swiss National Supercomputing Centre  | Tel:  +41 (91) 610.82.07
Via Cantonale, 6928 Manno, Switzerland      | Fax:  +41 (91) 610.82.82




More information about the CMake mailing list