|
|
|
@ -1,12 +1,13 @@
|
|
|
|
|
set(EXENAME odm) |
|
|
|
|
set(ACTIONLISTINC ${CMAKE_CURRENT_BINARY_DIR}/../include/actionlist.h) # Include actions files and define the actions classes list |
|
|
|
|
set(DATALISTINC ${CMAKE_CURRENT_BINARY_DIR}/../include/datalist.h) # Include data sources files and define the data sources classes list |
|
|
|
|
|
|
|
|
|
find_library(netcdf netcdf REQUIRED) |
|
|
|
|
find_package(OpenMP REQUIRED) |
|
|
|
|
set (CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} ${OpenMP_CXX_FLAGS}") |
|
|
|
|
|
|
|
|
|
file(GLOB srcs CONFIGURE_DEPENDS *.cpp) |
|
|
|
|
add_executable(${EXENAME} ${srcs} ${ACTIONLISTINC}) |
|
|
|
|
add_executable(${EXENAME} ${srcs} ${ACTIONLISTINC} ${SOURCELISTINC}) |
|
|
|
|
target_include_directories(${EXENAME} PRIVATE ../michlib/michlib ${CMAKE_CURRENT_BINARY_DIR}/../include) |
|
|
|
|
|
|
|
|
|
target_link_libraries(${EXENAME} ${linker_options} ${netcdf} OpenMP::OpenMP_CXX teos) |
|
|
|
@ -25,7 +26,7 @@ foreach(actfile ${actfiles})
|
|
|
|
|
string(REGEX MATCH "ADD ACTION CLASS: [^ ;\n]+" outstr "${outfull}") |
|
|
|
|
string(REGEX REPLACE ".+: " "" act "${outstr}") |
|
|
|
|
if(NOT (("${act}" EQUAL "") OR ("${act}" IN_LIST excluded))) |
|
|
|
|
message("Action: ${act} in file ${actfile}") |
|
|
|
|
message("Action: ${Yellow}${act}${ColorReset} in file ${actfile}") |
|
|
|
|
list(APPEND actlist ${act}) |
|
|
|
|
list(APPEND actfilelist ${actfile}) |
|
|
|
|
endif() |
|
|
|
@ -39,3 +40,28 @@ foreach(actfile ${actfilelist})
|
|
|
|
|
file(APPEND ${ACTIONLISTINC} "#include \"${actfile}\"\n") |
|
|
|
|
endforeach(actfile) |
|
|
|
|
# End generation of actions list |
|
|
|
|
|
|
|
|
|
# Begin generation of data sources list |
|
|
|
|
separate_arguments(excluded UNIX_COMMAND "${EXCLUDE_SOURCES}") |
|
|
|
|
file(GLOB sourcefiles RELATIVE ${CMAKE_CURRENT_SOURCE_DIR} CONFIGURE_DEPENDS ../sources/*.h ../sources-add/*.h) |
|
|
|
|
foreach(sourcefile ${sourcefiles}) |
|
|
|
|
string(REGEX REPLACE "(\.h$|.*/)" "" source "${sourcefile}") |
|
|
|
|
string(REGEX REPLACE "\.h$" ".cpp" sourcecpp "${sourcefile}") |
|
|
|
|
if(NOT (("${source}" EQUAL "") OR ("${source}" IN_LIST excluded))) |
|
|
|
|
message("Source: ${Cyan}${source}${ColorReset} in file ${sourcefile}") |
|
|
|
|
list(APPEND sourcelist ${source}) |
|
|
|
|
list(APPEND sourcefilelist ${sourcefile}) |
|
|
|
|
if(EXISTS ${CMAKE_CURRENT_SOURCE_DIR}/${sourcecpp} ) |
|
|
|
|
target_sources(${EXENAME} PRIVATE ${CMAKE_CURRENT_SOURCE_DIR}/${sourcecpp}) |
|
|
|
|
endif() |
|
|
|
|
endif() |
|
|
|
|
endforeach(sourcefile) |
|
|
|
|
|
|
|
|
|
list(TRANSFORM sourcelist APPEND "Data") |
|
|
|
|
string(REPLACE ";" "," sourceclist "${sourcelist}") |
|
|
|
|
file(WRITE ${DATALISTINC} "#define DATALIST ${sourceclist}\n") |
|
|
|
|
|
|
|
|
|
foreach(sourcefile ${sourcefilelist}) |
|
|
|
|
file(APPEND ${DATALISTINC} "#include \"${sourcefile}\"\n") |
|
|
|
|
endforeach(sourcefile) |
|
|
|
|
# End generation of sources list |
|
|
|
|