Skip to content

Commit

Permalink
Make status printout less Makefile-specific. (#1180)
Browse files Browse the repository at this point in the history
The status message printed at the end of the CMake configuration step
now suggests the portable `cmake --build . --target TARGET` instead of
the Makefile-specific `make TARGET` and is printed for all build tools.
  • Loading branch information
olupton authored and alexsavulescu committed Apr 15, 2021
1 parent 9ac8a44 commit 7390759
Showing 1 changed file with 106 additions and 102 deletions.
208 changes: 106 additions & 102 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -623,115 +623,119 @@ endif()
message(STATUS "")
message(STATUS "Configured NEURON ${PROJECT_VERSION}")
message(STATUS "")
string(TOLOWER "${CMAKE_GENERATOR}" cmake_generator_tolower)
if(cmake_generator_tolower MATCHES "makefile")
message(STATUS "Some things you can do now:")
message(STATUS "--------------+--------------------------------------------------------------")
message(STATUS "Command | Description")
message(STATUS "--------------+--------------------------------------------------------------")
message(STATUS "make install | Will install NEURON to: ${CMAKE_INSTALL_PREFIX}")
message(STATUS " | Change the install location of NEURON using:")
message(STATUS " | cmake <src_path> -DCMAKE_INSTALL_PREFIX=<install_path>")
message(STATUS "make docs | Build full docs. Calls targets: doxygen, notebooks, sphinx")
message(STATUS "make uninstall| Removes files installed by make install (todo)")
message(STATUS "--------------+--------------------------------------------------------------")
message(STATUS " Build option | Status")
message(STATUS "--------------+--------------------------------------------------------------")
message(STATUS "C COMPILER | ${CMAKE_C_COMPILER}")
message(STATUS "CXX COMPILER | ${CMAKE_CXX_COMPILER}")
message(STATUS "BUILD_TYPE | ${CMAKE_BUILD_TYPE} (allowed: ${allowableBuildTypes})")
message(STATUS "COMPILE FLAGS | ${COMPILER_FLAGS}")
message(STATUS "Shared | ${NRN_ENABLE_SHARED}")
message(STATUS "Binary special| ${NRN_ENABLE_BINARY_SPECIAL}")
if(NRN_DYNAMIC_UNITS_USE_LEGACY)
message(STATUS "Default units | legacy units")
else()
message(STATUS "Default units | modern units (2019 nist constants)")
endif()
message(STATUS "MPI | ${NRN_ENABLE_MPI}")
if(NRN_ENABLE_MPI)
message(STATUS " INC | ${MPI_INCLUDE_PATH}")
message(STATUS " LIB | ${MPI_LIBRARY}")
message(STATUS " DYNAMIC | ${NRN_ENABLE_MPI_DYNAMIC}")
if(NRN_ENABLE_MPI_DYNAMIC)
list(LENGTH NRN_MPI_LIBNAME_LIST _num_mpi)
math(EXPR num_mpi "${_num_mpi} - 1")
foreach(val RANGE ${num_mpi})
list(GET NRN_MPI_LIBNAME_LIST ${val} libname)
list(GET NRN_MPI_INCLUDE_LIST ${val} include)
message(STATUS " LIBNAME | ${libname}")
message(STATUS " INC | ${include}")
endforeach(val)
endif()
endif()
message(STATUS "Python | ${NRN_ENABLE_PYTHON}")
if(NRN_ENABLE_PYTHON)
message(STATUS " EXE | ${NRN_DEFAULT_PYTHON_EXECUTABLE}")
message(STATUS " INC | ${NRN_DEFAULT_PYTHON_INCLUDE_DIRS}")
message(STATUS " LIB | ${NRN_DEFAULT_PYTHON_LIBRARIES}")
message(STATUS " MODULE | ${NRN_ENABLE_MODULE_INSTALL}")
message(STATUS " DYNAMIC | ${NRN_ENABLE_PYTHON_DYNAMIC}")
if(PYTHON_VERSION_MAJOR EQUAL 2)
set(PY2_WARNING TRUE)
endif()
if(NRN_ENABLE_PYTHON_DYNAMIC)
list(LENGTH NRN_PYTHON_EXE_LIST _num_pythons)
math(EXPR num_pythons "${_num_pythons} - 1")
foreach(val RANGE ${num_pythons})
list(GET NRN_PYTHON_EXE_LIST ${val} exe)
list(GET NRN_PYTHON_VER_LIST ${val} version)
if(version EQUAL 2)
set(PY2_WARNING TRUE)
endif()
list(GET NRN_PYTHON_INCLUDE_LIST ${val} include)
list(GET NRN_PYTHON_LIB_LIST ${val} lib)
message(STATUS " EXE | ${exe}")
message(STATUS " INC | ${include}")
message(STATUS " LIB | ${lib}")
message(STATUS " INSTALL C | ${exe} setup.py install ${NRN_MODULE_INSTALL_OPTIONS}")
endforeach(val)
endif()
endif()
if(READLINE_FOUND)
message(STATUS "Readline | ${Readline_LIBRARY}")
message(STATUS "You can now build NEURON using:")
if(${CMAKE_VERSION} VERSION_LESS "3.12")
message(STATUS " cmake --build . [--target TARGET] -- -j 8")
else()
message(STATUS " cmake --build . --parallel 8 [--target TARGET]")
endif()
message(STATUS "You might want to adjust the number of parallel build jobs for your system.")
message(STATUS "Some non-default targets you might want to build:")
message(STATUS "--------------+--------------------------------------------------------------")
message(STATUS " Target | Description")
message(STATUS "--------------+--------------------------------------------------------------")
message(STATUS "install | Will install NEURON to: ${CMAKE_INSTALL_PREFIX}")
message(STATUS " | Change the install location of NEURON using:")
message(STATUS " | cmake <src_path> -DCMAKE_INSTALL_PREFIX=<install_path>")
message(STATUS "docs | Build full docs. Calls targets: doxygen, notebooks, sphinx")
message(STATUS "uninstall | Removes files installed by make install (todo)")
message(STATUS "--------------+--------------------------------------------------------------")
message(STATUS " Build option | Status")
message(STATUS "--------------+--------------------------------------------------------------")
message(STATUS "C COMPILER | ${CMAKE_C_COMPILER}")
message(STATUS "CXX COMPILER | ${CMAKE_CXX_COMPILER}")
message(STATUS "BUILD_TYPE | ${CMAKE_BUILD_TYPE} (allowed: ${allowableBuildTypes})")
message(STATUS "COMPILE FLAGS | ${COMPILER_FLAGS}")
message(STATUS "Shared | ${NRN_ENABLE_SHARED}")
message(STATUS "Binary special| ${NRN_ENABLE_BINARY_SPECIAL}")
if(NRN_DYNAMIC_UNITS_USE_LEGACY)
message(STATUS "Default units | legacy units")
else()
message(STATUS "Default units | modern units (2019 nist constants)")
endif()
message(STATUS "MPI | ${NRN_ENABLE_MPI}")
if(NRN_ENABLE_MPI)
message(STATUS " INC | ${MPI_INCLUDE_PATH}")
message(STATUS " LIB | ${MPI_LIBRARY}")
message(STATUS " DYNAMIC | ${NRN_ENABLE_MPI_DYNAMIC}")
if(NRN_ENABLE_MPI_DYNAMIC)
list(LENGTH NRN_MPI_LIBNAME_LIST _num_mpi)
math(EXPR num_mpi "${_num_mpi} - 1")
foreach(val RANGE ${num_mpi})
list(GET NRN_MPI_LIBNAME_LIST ${val} libname)
list(GET NRN_MPI_INCLUDE_LIST ${val} include)
message(STATUS " LIBNAME | ${libname}")
message(STATUS " INC | ${include}")
endforeach(val)
endif()
if(CURSES_FOUND)
message(STATUS "Curses | ${CURSES_LIBRARIES}")
elseif(TERMCAP_FOUND)
message(STATUS "Termcap | ${TERMCAP_LIBRARIES}")
endif()
message(STATUS "Python | ${NRN_ENABLE_PYTHON}")
if(NRN_ENABLE_PYTHON)
message(STATUS " EXE | ${NRN_DEFAULT_PYTHON_EXECUTABLE}")
message(STATUS " INC | ${NRN_DEFAULT_PYTHON_INCLUDE_DIRS}")
message(STATUS " LIB | ${NRN_DEFAULT_PYTHON_LIBRARIES}")
message(STATUS " MODULE | ${NRN_ENABLE_MODULE_INSTALL}")
message(STATUS " DYNAMIC | ${NRN_ENABLE_PYTHON_DYNAMIC}")
if(PYTHON_VERSION_MAJOR EQUAL 2)
set(PY2_WARNING TRUE)
endif()
message(STATUS "RX3D | ${NRN_ENABLE_RX3D}")
if(${NRN_ENABLE_RX3D})
message(STATUS " OptLevel | ${NRN_RX3D_OPT_LEVEL}")
if(NRN_ENABLE_PYTHON_DYNAMIC)
list(LENGTH NRN_PYTHON_EXE_LIST _num_pythons)
math(EXPR num_pythons "${_num_pythons} - 1")
foreach(val RANGE ${num_pythons})
list(GET NRN_PYTHON_EXE_LIST ${val} exe)
list(GET NRN_PYTHON_VER_LIST ${val} version)
if(version EQUAL 2)
set(PY2_WARNING TRUE)
endif()
list(GET NRN_PYTHON_INCLUDE_LIST ${val} include)
list(GET NRN_PYTHON_LIB_LIST ${val} lib)
message(STATUS " EXE | ${exe}")
message(STATUS " INC | ${include}")
message(STATUS " LIB | ${lib}")
message(STATUS " INSTALL C | ${exe} setup.py install ${NRN_MODULE_INSTALL_OPTIONS}")
endforeach(val)
endif()
message(STATUS "Interviews | ${NRN_ENABLE_INTERVIEWS}")
if(NRN_ENABLE_INTERVIEWS)
message(STATUS " PATH | ${IV_DIR}")
message(STATUS " INC | ${IV_INCLUDE_DIR}")
message(STATUS " X11 (INC) | ${X11_INCLUDE_DIR}")
if(IV_ENABLE_X11_DYNAMIC)
message(STATUS " | IV_ENABLE_X11_DYNAMIC ${IV_ENABLE_X11_DYNAMIC}")
message(STATUS " | IV_ENABLE_SHARED ${IV_ENABLE_SHARED}")
endif()
endif()
if(READLINE_FOUND)
message(STATUS "Readline | ${Readline_LIBRARY}")
endif()
if(CURSES_FOUND)
message(STATUS "Curses | ${CURSES_LIBRARIES}")
elseif(TERMCAP_FOUND)
message(STATUS "Termcap | ${TERMCAP_LIBRARIES}")
endif()
message(STATUS "RX3D | ${NRN_ENABLE_RX3D}")
if(${NRN_ENABLE_RX3D})
message(STATUS " OptLevel | ${NRN_RX3D_OPT_LEVEL}")
endif()
message(STATUS "Interviews | ${NRN_ENABLE_INTERVIEWS}")
if(NRN_ENABLE_INTERVIEWS)
message(STATUS " PATH | ${IV_DIR}")
message(STATUS " INC | ${IV_INCLUDE_DIR}")
message(STATUS " X11 (INC) | ${X11_INCLUDE_DIR}")
if(IV_ENABLE_X11_DYNAMIC)
message(STATUS " | IV_ENABLE_X11_DYNAMIC ${IV_ENABLE_X11_DYNAMIC}")
message(STATUS " | IV_ENABLE_SHARED ${IV_ENABLE_SHARED}")
endif()
message(STATUS "CoreNEURON | ${NRN_ENABLE_CORENEURON}")
if(NRN_ENABLE_CORENEURON)
message(STATUS " PATH | ${CORENEURON_DIR}")
message(STATUS " LINK FLAGS | ${CORENEURON_LIB_LINK_FLAGS}")
if(NOT coreneuron_FOUND)
message(STATUS " Legacy Units| ${CORENRN_ENABLE_LEGACY_UNITS}")
endif()
endif()
message(STATUS "CoreNEURON | ${NRN_ENABLE_CORENEURON}")
if(NRN_ENABLE_CORENEURON)
message(STATUS " PATH | ${CORENEURON_DIR}")
message(STATUS " LINK FLAGS | ${CORENEURON_LIB_LINK_FLAGS}")
if(NOT coreneuron_FOUND)
message(STATUS " Legacy Units| ${CORENRN_ENABLE_LEGACY_UNITS}")
endif()
if(NRN_ENABLE_COVERAGE)
message(STATUS "Coverage | Enabled")
if (NRN_COVERAGE_FILES)
message(STATUS " Files | ${NRN_COVERAGE_FILES}")
endif()
endif()
if(NRN_ENABLE_COVERAGE)
message(STATUS "Coverage | Enabled")
if (NRN_COVERAGE_FILES)
message(STATUS " Files | ${NRN_COVERAGE_FILES}")
endif()
message(STATUS "--------------+--------------------------------------------------------------")
message(STATUS " See documentation : https://www.neuron.yale.edu/neuron/")
message(STATUS "--------------+--------------------------------------------------------------")
endif()
message(STATUS "--------------+--------------------------------------------------------------")
message(STATUS " See documentation : https://www.neuron.yale.edu/neuron/")
message(STATUS "--------------+--------------------------------------------------------------")
message(STATUS "")
if(PY2_WARNING)
message(WARNING "Python2 support will be dropped soon! We strongly advise migrating to Python3 as of now.")
Expand Down

0 comments on commit 7390759

Please sign in to comment.