Merge pull request #300 from rolk/300_precomp

Further classify source files into languages

Needed, for instance, to properly assign derived properties to a subset
of the sources.  
  
This feature is used in the PCH module (UsePrecompHeaders.cmake)
This commit is contained in:
Bård Skaflestad 2013-08-02 09:53:28 -07:00
commit dc859e30ac

View File

@ -39,6 +39,16 @@ macro (opm_sources opm)
# names in the process
foreach (_file IN LISTS MAIN_SOURCE_FILES)
list (APPEND ${opm}_SOURCES ${PROJECT_SOURCE_DIR}/${_file})
# further classify into language if some other modules need to add props
if (_file MATCHES ".*\\.[cC][a-zA-Z]*$")
if (_file MATCHES ".*\\.c$")
list (APPEND ${opm}_C_SOURCES ${PROJECT_SOURCE_DIR}/${_file})
else (_file MATCHES ".*\\.c$")
list (APPEND ${opm}_CXX_SOURCES ${PROJECT_SOURCE_DIR}/${_file})
endif (_file MATCHES ".*\\.c$")
elseif (_file MATCHES ".*\\.[fF][a-zA-Z]*$")
list (APPEND ${opm}_Fortran_SOURCES ${PROJECT_SOURCE_DIR}/${_file})
endif (_file MATCHES ".*\\.[cC][a-zA-Z]*$")
endforeach (_file)
foreach (_file IN LISTS PUBLIC_HEADER_FILES)
list (APPEND ${opm}_HEADERS ${PROJECT_SOURCE_DIR}/${_file})