MantisBT - CMake
View Issue Details
0002859CMakeCMakepublic2006-02-07 16:552016-06-06 16:35
John Biddiscombe 
Brad King 
lowminoralways
closedfixed 
 
 
0002859: SET_SOURCE_FILE_PROPERTIES faulty with sub dirs
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.
No tags attached.
related to 0010086closed Brad King SET_SOURCE_FILES_PROPERTIES faulty with sub dirs (still) 
Issue History
2010-12-11 10:03Kovarththanan RajaratnamRelationship addedrelated to 0010086
2016-06-06 16:35Brad KingResolutionopen => fixed

Notes
(0003698)
Bill Hoffman   
2006-02-07 17:12   
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)
This may be related to the bug where . is in the path.
There is a problem with the GetOrCreateSource file function.
(0005156)
Bill Hoffman   
2006-10-04 13:42   
Is this fixed now?
(0005230)
John Biddiscombe   
2006-10-05 06:34   
I think it is working. I haven't had amny problems for a while