CMake build system functions properly for spectral solver

This commit is contained in:
zhangc43 2016-03-03 16:45:15 -05:00
parent 57c8213d9b
commit 9cb9de9c8a
1 changed files with 4 additions and 3 deletions

View File

@ -387,7 +387,7 @@ if (Fortran_COMPILER_NAME MATCHES "ifort.*")
set (CMAKE_EXE_LINKER_FLAGS_RELEASE "${CMAKE_EXE_LINKER_FLAGS_RELEASE} ${LINK_OPTIONS_ifort}" )
set (CMAKE_EXE_LINKER_FLAGS_RELEASE "${CMAKE_EXE_LINKER_FLAGS_RELEASE} ${OPTIMIZATION_ifort}" )
set (CMAKE_EXE_LINKER_FLAGS_RELEASE "${CMAKE_EXE_LINKER_FLAGS_RELEASE} ${STANDARD_CHECK_ifort}")
#set (CMAKE_EXE_LINKER_FLAGS_RELEASE "${CMAKE_EXE_LINKER_FLAGS_RELEASE} ${PETSC_EXTERNAL_LIB}" )
set (CMAKE_EXE_LINKER_FLAGS_RELEASE "${CMAKE_EXE_LINKER_FLAGS_RELEASE} ${PETSC_EXTERNAL_LIB}" )
# for DEBUG
set (CMAKE_Fortran_FLAGS_DEBUG "${CMAKE_Fortran_FLAGS_DEBUG} ${CMAKE_Fortran_FLAGS_RELEASE}")
@ -427,15 +427,16 @@ set (CMAKE_Fortran_FLAGS_DEBUG "${CMAKE_Fortran_FLAGS_DEBUG} ${DAMASK_I
set (CMAKE_LINKER "${PETSC_LINKER}")
if (CMAKE_BUILD_TYPE STREQUAL "RELEASE")
set (CMAKE_Fortran_LINK_EXECUTABLE
"${CMAKE_LINKER} ${CMAKE_EXE_LINKER_FLAGS_RELEASE} -o <TARGET> ${DAMASK_EXE} ${PETSC_EXTERNAL_LIB}")
"${CMAKE_LINKER} ${CMAKE_EXE_LINKER_FLAGS_RELEASE} <OBJECTS> -o <TARGET> <LINK_LIBRARIES> ${PETSC_EXTERNAL_LIB}")
else(CMAKE_BUILD_TYPE STREQUAL "RELEASE")
set (CMAKE_Fortran_LINK_EXECUTABLE
"${CMAKE_LINKER} ${CMAKE_EXE_LINKER_FLAGS_DEBUG} <OBJECTS> -o <TARGET> ${PETSC_EXTERNAL_LIB}")
"${CMAKE_LINKER} ${CMAKE_EXE_LINKER_FLAGS_DEBUG} <OBJECTS> -o <TARGET> <LINK_LIBRARIES> ${PETSC_EXTERNAL_LIB}")
endif(CMAKE_BUILD_TYPE STREQUAL "RELEASE")
message("***COMPILE FLAGS:\n${CMAKE_Fortran_FLAGS_RELEASE}\n")
message("***LINK FLAGS:\n${CMAKE_EXE_LINKER_FLAGS_RELEASE}\n")
##
# ADD CODE DIRECTORY
add_subdirectory(code)