@@ -417,6 +417,19 @@ add_library(partmclib STATIC ${partmclib_SOURCES})
417
417
target_compile_definitions (partmclib PRIVATE PMC_USE_SUNDIALS="1" )
418
418
target_compile_definitions (partmclib PRIVATE PMC_USE_CAMP="1" )
419
419
add_dependencies (partmclib ${SUNDIALS_items} )
420
+
421
+ string (CONCAT
422
+ cmd
423
+ "import sys;"
424
+ "print(''.join([f'#define {line.split()[3]} {line.split()[5]}\\ n' for line in sys.stdin if 'parameter ::' in line]))"
425
+ )
426
+ include (CheckFunctionExists)
427
+ execute_process (
428
+ COMMAND ${PYTHON_EXECUTABLE} "-c" "${cmd} "
429
+ INPUT_FILE ${CMAKE_SOURCE_DIR} /gitmodules/partmc/src/aero_data.F90
430
+ OUTPUT_FILE ${CMAKE_BINARY_DIR} /include /aero_data_parameters.hpp
431
+ )
432
+
420
433
target_include_directories (partmclib PRIVATE
421
434
${SUNDIALS_SOURCE_DIR} /include
422
435
${CMAKE_BINARY_DIR} /include
@@ -443,10 +456,12 @@ add_subdirectory(gitmodules/pybind11)
443
456
pybind11_add_module(_PyPartMC ${PyPartMC_sources} )
444
457
add_dependencies (_PyPartMC partmclib)
445
458
set (PYPARTMC_INCLUDE_DIRS
459
+ "${CMAKE_BINARY_DIR} /include;"
446
460
"${CMAKE_SOURCE_DIR} /gitmodules/json/include;"
447
461
"${CMAKE_SOURCE_DIR} /gitmodules/pybind11_json/include;"
448
462
"${CMAKE_SOURCE_DIR} /gitmodules/span/include;"
449
463
"${CMAKE_SOURCE_DIR} /gitmodules/string_view-standalone/include;"
464
+ "${CMAKE_SOURCE_DIR} /gitmodules/optional/include;"
450
465
)
451
466
target_include_directories (_PyPartMC PRIVATE ${PYPARTMC_INCLUDE_DIRS} )
452
467
target_compile_definitions (_PyPartMC PRIVATE VERSION_INFO=${VERSION_INFO} )
@@ -492,6 +507,8 @@ foreach(file ${PyPartMC_headers})
492
507
unset (CMAKE_REQUIRED_INCLUDES)
493
508
if (NOT _header_self_contained_${file} )
494
509
message (SEND_ERROR "non-self-contained header: ${file} " )
510
+ file (READ "${CMAKE_BINARY_DIR} /CMakeFiles/CMakeError.log" tmp)
511
+ message (FATAL_ERROR ${tmp} )
495
512
endif ()
496
513
endforeach ()
497
514
0 commit comments