From 166033ce1f6a386173855082c0771436203d56f1 Mon Sep 17 00:00:00 2001 From: Roland Kaufmann Date: Wed, 13 Mar 2013 13:55:56 +0100 Subject: [PATCH] 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. --- cmake/Modules/OpmFiles.cmake | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/cmake/Modules/OpmFiles.cmake b/cmake/Modules/OpmFiles.cmake index 90910a0c3..fd4e126e0 100644 --- a/cmake/Modules/OpmFiles.cmake +++ b/cmake/Modules/OpmFiles.cmake @@ -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})