Skip to content

Commit

Permalink
Working cmake a bit...in progress
Browse files Browse the repository at this point in the history
  • Loading branch information
drummerdoc committed Sep 10, 2013
1 parent 0acfc78 commit e4c6ecb
Show file tree
Hide file tree
Showing 4 changed files with 24 additions and 13 deletions.
10 changes: 7 additions & 3 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -1,8 +1,11 @@
# -*- mode: cmake -*-

# Require cmake 2.8 or higher
cmake_minimum_required(VERSION 2.8.2)

#set(CMAKE_DISABLE_IN_SOURCE_BUILD ON)
#set(CMAKE_DISABLE_SOURCE_CHANGES ON)


if ("${CMAKE_PATCH_VERSION}" GREATER 3)
set(ADJUST_POLICY "True")
endif()
Expand All @@ -16,10 +19,11 @@ endif()
enable_testing()

# Useful variables pointing to directories in the source tree
set(CCSE_ROOT_DIR "${CMAKE_CURRENT_SOURCE_DIR}")
#set(CCSE_ROOT_DIR "${CMAKE_CURRENT_SOURCE_DIR}")
set(CCSE_TOOLS_DIR "${CMAKE_CURRENT_SOURCE_DIR}/Tools")
set(CCSE_PERL_DIR "${CCSE_TOOLS_DIR}/C_scripts")
set(CCSE_INSTALL_DIR "${CMAKE_CURRENT_SOURCE_DIR}/install")
#set(CCSE_INSTALL_DIR "${CMAKE_CURRENT_SOURCE_DIR}/install")
set(CCSE_INSTALL_DIR "${CMAKE_INSTALL_PREFIX}")

# Set the module search path so find_package and include commands
# can locate files in <root source tree>/tools/cmake
Expand Down
4 changes: 2 additions & 2 deletions Src/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ set(CAMRDATADIR Extern/amrdata)
# Pick one place to put modules so everyone can see them
set(CMAKE_FORTRAN_MODULE_DIRECTORY ${CMAKE_CURRENT_BINARY_DIR}/${FBOXDIR} CACHE PATH "Folder for fortran module files")

set(CBOXLIB_INCLUDE_DIRS ${CMAKE_CURRENT_SOURCE_DIR}/${CBOXDIR} ${CMAKE_CURRENT_SOURCE_DIR}/${CBNDRYDIR} ${CMAKE_CURRENT_SOURCE_DIR}/${CAMRDIR} ${CMAKE_CURRENT_SOURCE_DIR}/${CMGDIR} ${CMAKE_CURRENT_SOURCE_DIR}/${CTMGDIR} ${CMAKE_CURRENT_SOURCE_DIR}/${CFMGDIR} ${CMAKE_CURRENT_SOURCE_DIR}/${CAMRDATADIR} ${BOXLIB_EXTRA_INCLUDE_PATH})
set(CBOXLIB_INCLUDE_DIRS ${CMAKE_CURRENT_SOURCE_DIR}/${CBOXDIR} ${CMAKE_CURRENT_SOURCE_DIR}/${CBNDRYDIR} ${CMAKE_CURRENT_SOURCE_DIR}/${CAMRDIR} ${CMAKE_CURRENT_SOURCE_DIR}/${CMGDIR} ${CMAKE_CURRENT_SOURCE_DIR}/${CTMGDIR} ${CMAKE_CURRENT_SOURCE_DIR}/${CFMGDIR} ${CMAKE_CURRENT_SOURCE_DIR}/${CAMRDATADIR} ${BOXLIB_EXTRA_CXX_INCLUDE_PATH})

include(PreprocessBoxLibFortran)

Expand All @@ -22,7 +22,7 @@ add_subdirectory(${CAMRDIR})
add_subdirectory(${CMGDIR})
add_subdirectory(${CTMGDIR})

set(FBOXLIB_INCLUDE_DIRS ${CMAKE_CURRENT_SOURCE_DIR}/${FBOXDIR} ${CMAKE_CURRENT_SOURCE_DIR}/${FMGDIR})
set(FBOXLIB_INCLUDE_DIRS ${CMAKE_CURRENT_SOURCE_DIR}/${FBOXDIR} ${CMAKE_CURRENT_SOURCE_DIR}/${FMGDIR} ${BOXLIB_EXTRA_Fortran_INCLUDE_PATH})

add_subdirectory(${FBOXDIR})
add_subdirectory(${FMGDIR})
Expand Down
8 changes: 3 additions & 5 deletions Src/LinearSolvers/C_TensorMG/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -16,10 +16,10 @@ include_directories(${CBOXLIB_INCLUDE_DIRS})

set(CXX_source_files DivVis.cpp MCCGSolver.cpp MCInterpBndryData.cpp MCLinOp.cpp MCMultiGrid.cpp)
set(FPP_source_files MCINTERPBNDRYDATA_${BL_SPACEDIM}D.F MCLO_${BL_SPACEDIM}D.F)
if(${BL_SPACEDIM} EQUAL 2)
if("${BL_SPACEDIM}" EQUAL 2)
list(APPEND FPP_source_files "DV_2D.F")
elseif(${BL_SPACEDIM} EQUAL 3)
list(APPEND FPP_source_files "DV_3D1.F DV_3D2.F DV_3D3.F")
elseif("${BL_SPACEDIM}" EQUAL 3)
list(APPEND FPP_source_files "DV_3D1.F" "DV_3D2.F" "DV_3D3.F")
endif()
set(F77_source_files)
set(F90_source_files)
Expand All @@ -29,8 +29,6 @@ set(FPP_header_files DivVis_F.H MCINTERPBNDRYDATA_F.H MCLO_F.H)
set(F77_header_files)
set(F90_header_files)



preprocess_boxlib_fortran(FPP_out_files ${FPP_source_files})

set(local_source_files ${FPP_out_files} ${F77_source_files} ${F90_source_files} ${CXX_source_files})
Expand Down
15 changes: 12 additions & 3 deletions Tools/CMake/CCSEOptions.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -93,17 +93,26 @@ set(BL_DEFINES "BL_NOLINEVALUES;BL_PARALLEL_IO;BL_SPACEDIM=${BL_SPACEDIM};BL_FOR

set(BOXLIB_EXTRA_LIBRARIES)
set(BOXLIB_EXTRA_LIBRARY_PATH)
set(BOXLIB_EXTRA_INCLUDE_PATH)
set(BOXLIB_EXTRA_C_INCLUDE_PATH)
set(BOXLIB_EXTRA_CXX_INCLUDE_PATH)
set(BOXLIB_EXTRA_Fortran_INCLUDE_PATH)

if (ENABLE_MPI)
list(APPEND BL_DEFINES BL_USE_MPI)
find_package(MPI REQUIRED)
list(APPEND BOXLIB_EXTRA_Fortran_INCLUDE_PATH "${MPI_Fortran_INCLUDE_PATH}")
list(APPEND BOXLIB_EXTRA_C_INCLUDE_PATH "${MPI_CXX_INCLUDE_PATH}")
list(APPEND BOXLIB_EXTRA_CXX_INCLUDE_PATH "${MPI_CXX_INCLUDE_PATH}")
list(APPEND CMAKE_CC_FLAGS "${MPI_C_FLAGS}")
list(APPEND CMAKE_CXX_FLAGS "${MPI_CXX_FLAGS}")
list(APPEND CMAKE_Fortran_FLAGS "${MPI_Fortran_FLAGS}")
endif()

if (ENABLE_OpenMP)
list(APPEND BL_DEFINES BL_USE_OMP)
find_package(OpenMP REQUIRED)
set(CMAKE_CC_FLAGS "${CMAKE_CC_FLAGS} ${OpenMP_C_FLAGS}")
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} ${OpenMP_CXX_FLAGS}")
list(APPEND CMAKE_CC_FLAGS "${OpenMP_C_FLAGS}")
list(APPEND CMAKE_CXX_FLAGS "${OpenMP_CXX_FLAGS}")
endif()

if (NOT BL_DEBUG)
Expand Down

0 comments on commit e4c6ecb

Please sign in to comment.