Further classify source files into languages
Other modules (notably the precompiled header one) may set properties directly on the source file; we need to separate them into categories for which language they belong to.
This commit is contained in:
parent
900a21adb3
commit
944935b0a3
@ -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})
|
||||
|
Loading…
Reference in New Issue
Block a user