Commit d5dd4f16 authored by Chris Cantwell's avatar Chris Cantwell
Browse files

Merge branch 'fix/osx-port-fixes' into 'master'

Add various fixes to support OS X MacPorts portfile

See merge request !377
parents 4afe5a87 31393cb0
......@@ -28,16 +28,18 @@ ENDIF(COMMAND cmake_policy)
# Find the modules included with Nektar
SET(CMAKE_MODULE_PATH ${CMAKE_SOURCE_DIR}/cmake ${CMAKE_MODULE_PATH})
IF( NOT NEKTAR_PASSED_FIRST_CONFIGURE )
SET(CMAKE_INSTALL_PREFIX ${CMAKE_BINARY_DIR}/dist CACHE PATH "" FORCE)
IF (CMAKE_INSTALL_PREFIX_INITIALIZED_TO_DEFAULT)
SET(CMAKE_INSTALL_PREFIX ${CMAKE_BINARY_DIR}/dist CACHE PATH "" FORCE)
ENDIF()
ENDIF()
# Attempt to retrieve git branch and SHA1 hash
INCLUDE(GetGitRevisionDescription)
get_git_head_revision(GIT_REFSPEC GIT_SHA1)
SET(LIB_DIR "lib")
IF( CMAKE_SYSTEM_PROCESSOR STREQUAL "x86_64" )
SET(LIB_DIR "lib64")
SET(LIB_DIR "lib/nektar++")
IF( CMAKE_SYSTEM_PROCESSOR STREQUAL "x86_64" AND NOT APPLE )
SET(LIB_DIR "lib64/nektar++")
ENDIF()
SET(CMAKE_INCLUDE_SYSTEM_FLAG_CXX "-isystem ")
......@@ -170,7 +172,7 @@ INCLUDE (NektarCommon)
SET(TPURL http://www.nektar.info/thirdparty)
SET(TPSRC ${CMAKE_SOURCE_DIR}/ThirdParty)
SET(TPBUILD ${CMAKE_BINARY_DIR}/ThirdParty)
SET(TPDIST ${CMAKE_INSTALL_PREFIX})
SET(TPDIST ${CMAKE_BINARY_DIR}/ThirdParty/dist)
IF (NOT EXISTS ${TPSRC})
FILE(MAKE_DIRECTORY ${TPSRC})
ENDIF ()
......@@ -319,13 +321,25 @@ INSTALL(FILES ${CMAKE_BINARY_DIR}/Nektar++Config.cmake
${CMAKE_SOURCE_DIR}/cmake/FindMKL.cmake
${CMAKE_SOURCE_DIR}/cmake/FindMetis.cmake
${CMAKE_SOURCE_DIR}/cmake/FindScotch.cmake
${CMAKE_SOURCE_DIR}/cmake/FindFFTW.cmake
${CMAKE_SOURCE_DIR}/cmake/FindFFTW.cmake
${CMAKE_SOURCE_DIR}/cmake/FindWin32Lapack.cmake
${CMAKE_SOURCE_DIR}/cmake/FindTinyXml.cmake
${CMAKE_SOURCE_DIR}/cmake/FindGSMPI.cmake
${CMAKE_SOURCE_DIR}/cmake/FindXXT.cmake
${CMAKE_SOURCE_DIR}/cmake/FindSMV.cmake
DESTINATION ${CMAKE_INSTALL_PREFIX})
DESTINATION ${CMAKE_INSTALL_PREFIX})
# Install ThirdParty headers to subdirectory of ${NEKTAR_INCLUDE_DIR}
INSTALL(DIRECTORY ${TPDIST}/include/
DESTINATION ${NEKTAR_INCLUDE_DIR}/ThirdParty
COMPONENT ThirdParty
)
# Install ThirdParty libraries into ${NEKTAR_LIB_DIR}
INSTALL(DIRECTORY ${TPDIST}/lib/
DESTINATION ${NEKTAR_LIB_DIR}
COMPONENT ThirdParty
)
SET(NEKTAR_PASSED_FIRST_CONFIGURE ON CACHE BOOL INTERNAL)
MARK_AS_ADVANCED(NEKTAR_PASSED_FIRST_CONFIGURE)
......
......@@ -35,9 +35,9 @@ SET(NEKTAR++_LIBRARY_DIRS "${NEKTAR++_ROOT_DIR}/@NEKTAR_LIB_DIR@")
SET(NEKTAR++_DEFINITIONS "")
SET(NEKTAR++_LIBRARIES SolverUtils MultiRegions LocalRegions SpatialDomains StdRegions LibUtilities)
SET(NEKTAR++_TP_INCLUDE_DIRS "")
SET(NEKTAR++_TP_INCLUDE_DIRS "${NEKTAR++_ROOT_DIR}/@NEKTAR_INCLUDE_DIR@/ThirdParty")
SET(NEKTAR++_TP_LIBRARIES "")
SET(NEKTAR++_TP_LIBRARY_DIRS "@CMAKE_SOURCE_DIR@/ThirdParty/dist/lib/")
SET(NEKTAR++_TP_LIBRARY_DIRS "")
# add Nektar++_ROOT_DIR to the cmake search path, so Nektars custom FindXXX modules can be used
SET(CMAKE_MODULE_PATH ${NEKTAR++_ROOT_DIR} ${CMAKE_MODULE_PATH})
......
......@@ -6,8 +6,6 @@ ENDMACRO()
MACRO(SET_COMMON_PROPERTIES name)
SET_TARGET_PROPERTIES(${name} PROPERTIES VERSION ${NEKTAR_VERSION})
SET_TARGET_PROPERTIES(${name} PROPERTIES DEBUG_POSTFIX -g)
SET_TARGET_PROPERTIES(${name} PROPERTIES MINSIZEREL_POSTFIX -ms)
SET_TARGET_PROPERTIES(${name} PROPERTIES RELWITHDEBINFO_POSTFIX -rg)
......@@ -142,7 +140,8 @@ MACRO(ADD_NEKTAR_LIBRARY name component type)
ADD_LIBRARY(${name} ${type} ${ARGN})
SET_PROPERTY(TARGET ${name} PROPERTY FOLDER ${component})
SET_PROPERTY(TARGET ${name} PROPERTY VERSION ${NEKTAR_VERSION})
SET_COMMON_PROPERTIES(${name})
# Set properties for building shared libraries
......
......@@ -7,6 +7,10 @@
\hangindent=1.5cm
Displays extra info.
\lstinline[style=BashInputStyle]{--version}\\
\hangindent=1.5cm
Displays software version, and source control information if applicable.
\lstinline[style=BashInputStyle]{--help}\\
\hangindent=1.5cm
Displays help information about the available command-line options for the executable.
......
......@@ -38,6 +38,7 @@
#endif
#include <LibUtilities/BasicUtils/SessionReader.h>
#include <LibUtilities/BasicConst/GitRevision.h>
#include <iostream>
#include <fstream>
......@@ -59,6 +60,10 @@ using namespace std;
#include <boost/program_options.hpp>
#include <boost/format.hpp>
#ifndef NEKTAR_VERSION
#define NEKTAR_VERSION "Unknown"
#endif
namespace po = boost::program_options;
namespace io = boost::iostreams;
......@@ -327,6 +332,7 @@ namespace Nektar
po::options_description desc("Allowed options");
desc.add_options()
("verbose,v", "be verbose")
("version,V", "print version information")
("help,h", "print this help message")
("solverinfo,I", po::value<vector<std::string> >(),
"override a SOLVERINFO property")
......@@ -396,7 +402,36 @@ namespace Nektar
// Help message
if (m_cmdLineOptions.count("help"))
{
cout << desc << endl;
cout << desc;
exit(0);
}
// Version information
if (m_cmdLineOptions.count("version"))
{
cout << "Nektar++ version " << NEKTAR_VERSION;
if (NekConstants::kGitSha1 != "GITDIR-NOTFOUND")
{
string sha1(NekConstants::kGitSha1);
string branch(NekConstants::kGitBranch);
boost::replace_all(branch, "refs/heads/", "");
cout << " (git changeset " << sha1.substr(0, 8) << ", ";
if (branch == "")
{
cout << "detached head";
}
else
{
cout << "head " << branch;
}
cout << ")";
}
cout << endl;
exit(0);
}
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment