diff --git a/CMakeLists.txt b/CMakeLists.txt index f44bb99217a..b8de549f4ed 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -22,73 +22,6 @@ include_directories(${NetCDF_C_INCLUDE_DIRS} ${NetCDF_Fortran_INCLUDE_DIRS}) # TODO: Some of the below should be done in the relevant directories, not in # this top level CMakeLists. -# ------------------------------------------------------------------------ -# Build mct -# ------------------------------------------------------------------------ -if (EXISTS ${SRC_ROOT}/libraries/mct) - set(MCT_ROOT "${SRC_ROOT}/libraries/mct") -else() - set(MCT_ROOT "${SRC_ROOT}/externals/mct") -endif() - -if (USE_MPI_SERIAL) - set(ENABLE_MPI_SERIAL "--enable-mpiserial") -else() - set(ENABLE_MPI_SERIAL "") -endif() - -ExternalProject_add(mct_project - PREFIX ${CMAKE_CURRENT_BINARY_DIR} - SOURCE_DIR ${MCT_ROOT} - BINARY_DIR ${CMAKE_CURRENT_BINARY_DIR}/mct - CONFIGURE_COMMAND ${MCT_ROOT}/configure ${ENABLE_MPI_SERIAL} --enable-debugging --prefix=${CMAKE_CURRENT_BINARY_DIR} CC=${CMAKE_C_COMPILER} FC=${CMAKE_Fortran_COMPILER} CFLAGS=${CFLAGS} FCFLAGS=${FFLAGS} SRCDIR=${MCT_ROOT} DEBUG="-g" - BUILD_COMMAND $(MAKE) SRCDIR=${MCT_ROOT} - # Leave things in rather than "installing", because we have - # no need to move things around inside of the CMake binary directory. Also, - # mpi-serial doesn't install properly in the out-of-source build - INSTALL_COMMAND : - ) -# This copy_makefiles step is needed because mct currently doesn't support an -# out-of-source build. I am replicating what is done for the CIME system build. -ExternalProject_add_step(mct_project copy_makefiles - DEPENDEES configure - DEPENDERS build - WORKING_DIRECTORY - COMMAND cp -p /Makefile . - COMMAND mkdir -p mct - COMMAND cp -p /mct/Makefile mct/ - COMMAND mkdir -p mpeu - COMMAND cp -p /mpeu/Makefile mpeu/ - ) -if (USE_MPI_SERIAL) - ExternalProject_add_step(mct_project copy_mpi_serial_files - DEPENDEES configure - DEPENDERS build - WORKING_DIRECTORY - COMMAND mkdir -p mpi-serial - COMMAND cp -p /mpi-serial/Makefile mpi-serial/ - COMMAND cp /mpi-serial/mpif.h mpi-serial/ - COMMAND cp /mpi-serial/mpi.h mpi-serial/ - ) -endif() - -# Tell cmake to look for libraries & mod files here, because this is where we built libraries -include_directories(${CMAKE_CURRENT_BINARY_DIR}/mct/mct) -include_directories(${CMAKE_CURRENT_BINARY_DIR}/mct/mpeu) -link_directories(${CMAKE_CURRENT_BINARY_DIR}/mct/mct) -link_directories(${CMAKE_CURRENT_BINARY_DIR}/mct/mpeu) -if (USE_MPI_SERIAL) - # We need to list the mpi-serial include directory before system-level - # directories so that we're sure to use mpi-serial's mpif.h instead of - # an mpif.h from a system path. - include_directories(BEFORE ${CMAKE_CURRENT_BINARY_DIR}/mct/mpi-serial) - link_directories(BEFORE ${CMAKE_CURRENT_BINARY_DIR}/mct/mpi-serial) -endif() - -# ------------------------------------------------------------------------ -# Done MCT build -# ------------------------------------------------------------------------ - # Now a bunch of includes for share code. # csm_share (we don't build it here because it seems to be built differently