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=ddb6896345489cb4be036d4c6710c7a28181cc8c;hpb=9ca323cc00e0e6282438fd81316525f1d17122ce;p=unres.git diff --git a/source/unres/src_MIN/CMakeLists.txt b/source/unres/src_MIN/CMakeLists.txt index ddb6896..a6c2db0 100644 --- a/source/unres/src_MIN/CMakeLists.txt +++ b/source/unres/src_MIN/CMakeLists.txt @@ -118,7 +118,7 @@ if (Fortran_COMPILER_NAME STREQUAL "ifort") set(FFLAGS2 "-w -g -00 ") set(FFLAGS3 "-g -w -ipo " ) elseif (Fortran_COMPILER_NAME STREQUAL "gfortran") - set(FFLAGS0 " " ) + set(FFLAGS0 "-O" ) set(FFLAGS1 "-g -C" ) set(FFLAGS2 "-g -O0 ") set(FFLAGS3 "-O3" ) @@ -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