I was looking at the cmake build process and I have a few comments about some common cmake standards that should be adopted, especially since cmake_minimum_required() is set to 3.22:
Also, feel free to copy the test-suite from spglib to enable github actions across multiple compiler families
Hope these tips are helpful
I was looking at the cmake build process and I have a few comments about some common cmake standards that should be adopted, especially since
cmake_minimum_required()is set to3.22:FetchContentwithFETCHCONTENT_SOURCE_DIR_<uppercaseName>pointing to the submodule if necessary. This allows for a native switch betweenfind_package,FetchContentandsubmodulesources.FIND_PACKAGE_ARGSwas only introduced in3.24, but it can be easily back-ported.[===[block command and messages instead of multiplemessage()FindPackageunless it is a wrapper that checks forfind_package(CONFIG)and the cmake bundledFindPackagemodules. The bundled modules will always have precedence and it is best to first check with the ones maintained on cmake which can have better support.CP2K_TESTS,CP2K_INSTALLandCP2K_SHARED_LIBS, with defaults based onPROJECT_IS_TOP_LEVEL. This will make it more friendly to use withFetchContentALIASlibraries/executables, and propagation of variables likecp2k_VERSION. This is to make the project equivalent if it's imported viafind_packageor viaFetchContent.if(${cp2k_build_options_up} STREQUAL "FULL")bundle cmake presetsAlso, feel free to copy the test-suite from
spglibto enable github actions across multiple compiler familiesHope these tips are helpful