X-Git-Url: http://mmka.chem.univ.gda.pl/gitweb/?a=blobdiff_plain;f=source%2Funres%2Fsrc_MIN%2FCMakeLists.txt;h=a6c2db0a5430befab8085093b03be0ac5354272b;hb=656ee3d88bc976ae9f7830160a393e72ee33aa48;hp=c57587a51cd9cec79ff93011fba261474def64f7;hpb=15afd189c18562cd9993b64625be751eb8eac634;p=unres.git diff --git a/source/unres/src_MIN/CMakeLists.txt b/source/unres/src_MIN/CMakeLists.txt index c57587a..a6c2db0 100644 --- a/source/unres/src_MIN/CMakeLists.txt +++ b/source/unres/src_MIN/CMakeLists.txt @@ -160,12 +160,35 @@ set_property(SOURCE ${UNRES_MIN_PP_SRC} PROPERTY COMPILE_DEFINITIONS ${CPPFLAGS} #======================================== set(UNRES_BIN "unres_min_${Fortran_COMPILER_NAME}.exe") -#set(UNRES_CINFO_DIR "${CMAKE_CURRENT_BINARY_DIR}" ) +#======================================== +# cinfo.f workaround for Cmake +#======================================== +# get the current date +TODAY(DATE) +# generate cinfo.f +FILE(WRITE ${CMAKE_CURRENT_BINARY_DIR}/cinfo.f +"C CMake generated file + subroutine cinfo + include 'COMMON.IOUNITS' + write(iout,*)'++++ Compile info ++++' + write(iout,*)'Version ${UNRES_MAJOR}.${UNRES_MINOR} build ${UNRES_PATCH}' + write(iout,*)'Compiled ${DATE}' + write(iout,*)'Compiled by $ENV{USER}@$ENV{HOST}' + write(iout,*)'OS name: ${CMAKE_SYSTEM_NAME}' + write(iout,*)'OS release: ${CMAKE_SYSTEM}' + write(iout,*)'FC: ${CMAKE_Fortran_COMPILER}' + write(iout,*)'Version MINI energy and minimization only' + write(iout,*)'++++ End of compile info ++++' + return + end +") +# add include path +set_property(SOURCE ${CMAKE_CURRENT_BINARY_DIR}/cinfo.f PROPERTY COMPILE_FLAGS "${FFLAGS0} -I${CMAKE_CURRENT_SOURCE_DIR}") #========================================= # Set full unres MIN sources #========================================= -set(UNRES_MIN_SRCS ${UNRES_MIN_SRC0} ${UNRES_MIN_SRC1} ${UNRES_MIN_SRC2} ${UNRES_MIN_SRC3} cinfo.f ) +set(UNRES_MIN_SRCS ${UNRES_MIN_SRC0} ${UNRES_MIN_SRC1} ${UNRES_MIN_SRC2} ${UNRES_MIN_SRC3} ${CMAKE_CURRENT_BINARY_DIR}/cinfo.f ) #========================================= # Build the binary