Commit 06d99937 authored by Lynn Garren's avatar Lynn Garren
Browse files

deal with more warnings

parent 50310921
......@@ -18,9 +18,19 @@ namespace Genfun {
const unsigned int ButcherTableau::nSteps() const{
return _A.size();
}
// don't generate warnings about intentional shadowing
#if defined __GNUC__
#if __GNUC__ > 3 && __GNUC_MINOR__ > 5
#pragma GCC diagnostic push
#pragma GCC diagnostic ignored "-Wshadow"
#endif
#endif
#ifdef __clang__
#pragma clang diagnostic push
#pragma clang diagnostic ignored "-Wshadow"
#endif
double & ButcherTableau::A(unsigned int i, unsigned int j) {
if (i>=_A.size()) {
......@@ -42,6 +52,15 @@ namespace Genfun {
return _A[i][j];
}
#if defined __GNUC__
#if __GNUC__ > 3 && __GNUC_MINOR__ > 5
#pragma GCC diagnostic pop
#endif
#endif
#ifdef __clang__
#pragma clang diagnostic pop
#endif
double & ButcherTableau::b(unsigned int i){
if (i>=_b.size()) _b.resize(i+1);
return _b[i];
......
......@@ -27,7 +27,18 @@ namespace Genfun {
return _A.size();
}
// don't generate warnings about intentional shadowing
#if defined __GNUC__
#if __GNUC__ > 3 && __GNUC_MINOR__ > 5
#pragma GCC diagnostic push
#pragma GCC diagnostic ignored "-Wshadow"
#endif
#endif
#ifdef __clang__
#pragma clang diagnostic push
#pragma clang diagnostic ignored "-Wshadow"
#endif
double & ExtendedButcherTableau::A(unsigned int i, unsigned int j) {
......@@ -49,7 +60,16 @@ namespace Genfun {
}
return _A[i][j];
}
#if defined __GNUC__
#if __GNUC__ > 3 && __GNUC_MINOR__ > 5
#pragma GCC diagnostic pop
#endif
#endif
#ifdef __clang__
#pragma clang diagnostic pop
#endif
double & ExtendedButcherTableau::b(unsigned int i){
if (i>=_b.size()) _b.resize(i+1);
return _b[i];
......
......@@ -166,8 +166,8 @@ int anonymousRestore2(const std::vector<double> & v) {
output << "First four of k are: "
<< k[0] << ", " << k[1] << ", " << k[2] << ", " << k[3] << "\n";
#endif
for (int m=0; m<25; m++) {
if ( v[m] != k[m] ) {
for (int m1=0; m1<25; m1++) {
if ( v[m1] != k[m1] ) {
std::cout << "???? Incorrect restored value for anonymous engine"
<< E::engineName() << "\n";
#ifdef CLEAN_OUTPUT
......
......@@ -152,8 +152,8 @@ int vectorRestore2(E & f, const std::vector<double> & v) {
output << "First four of k are: "
<< k[0] << ", " << k[1] << ", " << k[2] << ", " << k[3] << "\n";
#endif
for (int m=0; m<25; m++) {
if ( v[m] != k[m] ) {
for (int m1=0; m1<25; m1++) {
if ( v[m1] != k[m1] ) {
std::cout << "???? Incorrect copy restored value for engine: "
<< E::engineName() << "\n";
#ifdef CLEAN_OUTPUT
......
......@@ -311,17 +311,17 @@ bool gaussianTest ( HepRandom & dist, double mu,
3.87E-7 // 5.0 sigma and up
};
for (int m = 0; m < 11; m++) {
double expect = table[m]*nNumbers;
double sig = std::sqrt ( table[m] * (1.0-table[m]) * nNumbers );
for (int m1 = 0; m1 < 11; m1++) {
double expect = table[m1]*nNumbers;
double sig = std::sqrt ( table[m1] * (1.0-table[m1]) * nNumbers );
cout.precision(oldprecision);
cout << "Between " << m/2.0 << " sigma and "
<< m/2.0+.5 << " sigma (should be about " << expect << "):\n "
cout << "Between " << m1/2.0 << " sigma and "
<< m1/2.0+.5 << " sigma (should be about " << expect << "):\n "
<< " "
<< ncounts[m] << " negative and " << counts[m] << " positive " << "\n";
<< ncounts[m1] << " negative and " << counts[m1] << " positive " << "\n";
cout.precision(5);
double negSigs = std::abs ( ncounts[m] - expect ) / sig;
double posSigs = std::abs ( counts[m] - expect ) / sig;
double negSigs = std::abs ( ncounts[m1] - expect ) / sig;
double posSigs = std::abs ( counts[m1] - expect ) / sig;
cout << " These represent " <<
negSigs << " and " << posSigs << " sigma from expectations\n";
if ( negSigs > REJECT || posSigs > REJECT ) {
......
......@@ -53,7 +53,7 @@ void init()
void layout()
{
float m=3.0;
float m1=3.0;
const int size=5;
double vect[size];
......@@ -70,7 +70,7 @@ void layout()
cout << " Wigner2(1,0.2,1) : " << RandBreitWigner::shootM2(1,0.2,1) << endl;
cout << " IntFlat [0,99[ : " << RandFlat::shootInt(99) << endl;
cout << " IntFlat [-99,37[ : " << RandFlat::shootInt(-99,37) << endl;
cout << " Poisson (m=3.0) : " << RandPoisson::shoot(m) << endl;
cout << " Poisson (m=3.0) : " << RandPoisson::shoot(m1) << endl;
cout << " Binomial(n=1,p=0.5) : " << RandBinomial::shoot() << endl;
cout << " Binomial(n=-5,p=0.3): " << RandBinomial::shoot(-5,0.3) << endl;
cout << " ChiSqr (a=1) : " << RandChiSquare::shoot() << endl;
......@@ -89,7 +89,7 @@ void layout()
void dist_layout()
{
float m=3.0;
float m1=3.0;
const int size=5;
double vect[size];
......@@ -132,7 +132,7 @@ void dist_layout()
cout << " Wigner2(1,0.2,1) : " << aBreitObj.fireM2(1,0.2,1) << endl;
cout << " IntFlat [0,99[ : " << aFlatObj.fireInt(99) << endl;
cout << " IntFlat [-99,37[ : " << aFlatObj.fireInt(-99,37) << endl;
cout << " Poisson (m=3.0) : " << aPoissonObj.fire(m) << endl;
cout << " Poisson (m=3.0) : " << aPoissonObj.fire(m1) << endl;
cout << " Binomial(n=1,p=0.5) : " << aBinomialObj.fire() << endl;
cout << " Binomial(n=-5,p=0.3): " << aBinomialObj.fire(-5,0.3) << endl;
cout << " ChiSqr (a=1) : " << aChiSquareObj.fire() << endl;
......@@ -153,7 +153,7 @@ void dist_layout()
void user_layout()
{
float m=3.0;
float m1=3.0;
const int size=5;
double vect[size];
char sel;
......@@ -240,7 +240,7 @@ void user_layout()
cout << " Wigner2(1,0.2,1) : " << RandBreitWigner::shootM2(anEngine,1,0.2,1) << endl;
cout << " IntFlat [0,99[ : " << RandFlat::shootInt(anEngine,99) << endl;
cout << " IntFlat [-99,37[ : " << RandFlat::shootInt(anEngine,-99,37) << endl;
cout << " Poisson (m=3.0) : " << RandPoisson::shoot(anEngine,m) << endl;
cout << " Poisson (m=3.0) : " << RandPoisson::shoot(anEngine,m1) << endl;
cout << " Binomial(n=1,p=0.5) : " << RandBinomial::shoot(anEngine) << endl;
cout << " Binomial(n=-5,p=0.3): " << RandBinomial::shoot(anEngine,-5,0.3) << endl;
cout << " ChiSqr (a=1) : " << RandChiSquare::shoot(anEngine) << endl;
......
......@@ -30,6 +30,13 @@
//
// ======================================================================
// don't generate unnecessary warnings
#if defined __GNUC__
#if __GNUC__ > 3 && __GNUC_MINOR__ > 5
#pragma GCC diagnostic push
#pragma GCC diagnostic ignored "-Wdelete-non-virtual-dtor"
#endif
#endif
#ifdef __clang__
#pragma clang diagnostic push
#pragma clang diagnostic ignored "-Wdelete-non-virtual-dtor"
......@@ -1479,6 +1486,15 @@ do_nothing_deleter::operator () ( void const * ) const
} // namespace CLHEP
#if defined __GNUC__
#if __GNUC__ > 3 && __GNUC_MINOR__ > 5
#pragma GCC diagnostic pop
#endif
#endif
#ifdef __clang__
#pragma clang diagnostic pop
#endif
#endif // CLHEP_MEMORY_H
......@@ -1655,8 +1671,4 @@ public: // actually private, but avoids compiler template friendship issues
}
}; // enable_shared_from_this2<>
#ifdef __clang__
#pragma clang diagnostic pop
#endif
#endif // 0
......@@ -47,8 +47,8 @@ macro(clhep_build_library package)
# Install the libraries
INSTALL (TARGETS ${package} ${package}S
RUNTIME DESTINATION bin
LIBRARY DESTINATION lib${LIBSUFFIX}
ARCHIVE DESTINATION lib${LIBSUFFIX}
LIBRARY DESTINATION lib${LIB_SUFFIX}
ARCHIVE DESTINATION lib${LIB_SUFFIX}
)
endmacro(clhep_build_library)
......@@ -78,22 +78,22 @@ macro(clhep_build_libclhep )
INSTALL(TARGETS CLHEP CLHEPS
EXPORT CLHEPLibraryDepends
RUNTIME DESTINATION bin
LIBRARY DESTINATION lib${LIBSUFFIX}
ARCHIVE DESTINATION lib${LIBSUFFIX}
LIBRARY DESTINATION lib${LIB_SUFFIX}
ARCHIVE DESTINATION lib${LIB_SUFFIX}
)
if( ${CMAKE_SYSTEM_NAME} MATCHES "Windows" )
# copy
file(WRITE ${CMAKE_CURRENT_BINARY_DIR}/clhep_static_symlink
"execute_process(COMMAND \"${CMAKE_COMMAND}\" -E copy ${CMAKE_STATIC_LIBRARY_PREFIX}CLHEP-${VERSION}${CMAKE_STATIC_LIBRARY_SUFFIX} ${CMAKE_STATIC_LIBRARY_PREFIX}CLHEP${CMAKE_STATIC_LIBRARY_SUFFIX} WORKING_DIRECTORY \"$ENV{DESTDIR}${CMAKE_INSTALL_PREFIX}/lib${LIBSUFFIX}\" )" )
"execute_process(COMMAND \"${CMAKE_COMMAND}\" -E copy ${CMAKE_STATIC_LIBRARY_PREFIX}CLHEP-${VERSION}${CMAKE_STATIC_LIBRARY_SUFFIX} ${CMAKE_STATIC_LIBRARY_PREFIX}CLHEP${CMAKE_STATIC_LIBRARY_SUFFIX} WORKING_DIRECTORY \"$ENV{DESTDIR}${CMAKE_INSTALL_PREFIX}/lib${LIB_SUFFIX}\" )" )
file(WRITE ${CMAKE_CURRENT_BINARY_DIR}/clhep_shared_symlink
"execute_process(COMMAND \"${CMAKE_COMMAND}\" -E copy ${CMAKE_SHARED_LIBRARY_PREFIX}CLHEP-${VERSION}${CMAKE_SHARED_LIBRARY_SUFFIX} ${CMAKE_SHARED_LIBRARY_PREFIX}CLHEP${CMAKE_SHARED_LIBRARY_SUFFIX} WORKING_DIRECTORY \"$ENV{DESTDIR}${CMAKE_INSTALL_PREFIX}/bin\" )" )
else()
# create the symbolic links
file(WRITE ${CMAKE_CURRENT_BINARY_DIR}/clhep_static_symlink
"execute_process(COMMAND \"${CMAKE_COMMAND}\" -E create_symlink ${CMAKE_STATIC_LIBRARY_PREFIX}CLHEP-${VERSION}${CMAKE_STATIC_LIBRARY_SUFFIX} ${CMAKE_STATIC_LIBRARY_PREFIX}CLHEP${CMAKE_STATIC_LIBRARY_SUFFIX} WORKING_DIRECTORY \"$ENV{DESTDIR}${CMAKE_INSTALL_PREFIX}/lib${LIBSUFFIX}\" )" )
"execute_process(COMMAND \"${CMAKE_COMMAND}\" -E create_symlink ${CMAKE_STATIC_LIBRARY_PREFIX}CLHEP-${VERSION}${CMAKE_STATIC_LIBRARY_SUFFIX} ${CMAKE_STATIC_LIBRARY_PREFIX}CLHEP${CMAKE_STATIC_LIBRARY_SUFFIX} WORKING_DIRECTORY \"$ENV{DESTDIR}${CMAKE_INSTALL_PREFIX}/lib${LIB_SUFFIX}\" )" )
file(WRITE ${CMAKE_CURRENT_BINARY_DIR}/clhep_shared_symlink
"execute_process(COMMAND \"${CMAKE_COMMAND}\" -E create_symlink ${CMAKE_SHARED_LIBRARY_PREFIX}CLHEP-${VERSION}${CMAKE_SHARED_LIBRARY_SUFFIX} ${CMAKE_SHARED_LIBRARY_PREFIX}CLHEP${CMAKE_SHARED_LIBRARY_SUFFIX} WORKING_DIRECTORY \"$ENV{DESTDIR}${CMAKE_INSTALL_PREFIX}/lib${LIBSUFFIX}\" )" )
"execute_process(COMMAND \"${CMAKE_COMMAND}\" -E create_symlink ${CMAKE_SHARED_LIBRARY_PREFIX}CLHEP-${VERSION}${CMAKE_SHARED_LIBRARY_SUFFIX} ${CMAKE_SHARED_LIBRARY_PREFIX}CLHEP${CMAKE_SHARED_LIBRARY_SUFFIX} WORKING_DIRECTORY \"$ENV{DESTDIR}${CMAKE_INSTALL_PREFIX}/lib${LIB_SUFFIX}\" )" )
endif()
INSTALL(SCRIPT ${CMAKE_CURRENT_BINARY_DIR}/clhep_static_symlink )
......
......@@ -63,7 +63,7 @@ export(TARGETS CLHEP CLHEPS
#
set(CLHEP_PKGCONFIG_PREFIX ${PROJECT_BINARY_DIR})
set(CLHEP_PKGCONFIG_INCLUDEDIR ${CLHEP_INCLUDE_DIR})
set(CLHEP_PKGCONFIG_LIBDIR ${PROJECT_BINARY_DIR}/lib${LIBSUFFIX})
set(CLHEP_PKGCONFIG_LIBDIR ${PROJECT_BINARY_DIR}/lib${LIB_SUFFIX})
configure_file(${PROJECT_SOURCE_DIR}/cmake/Templates/clhep.pc.in
${PROJECT_BINARY_DIR}/clhep.pc
......@@ -84,7 +84,7 @@ set(CLHEP_DEFINITIONS )
# We use a relative path from the directory where the CLHEPConfig.cmake
# file is installed to the actual include dir.
file(RELATIVE_PATH _relincpath
${CMAKE_INSTALL_PREFIX}/lib${LIBSUFFIX}/CLHEP-${VERSION}
${CMAKE_INSTALL_PREFIX}/lib${LIB_SUFFIX}/CLHEP-${VERSION}
${CMAKE_INSTALL_PREFIX}/include
)
set(CLHEP_INCLUDE_DIR "\${_thisdir}/${_relincpath}")
......@@ -111,7 +111,7 @@ configure_file(${PROJECT_SOURCE_DIR}/cmake/Templates/CLHEPConfig.cmake.in
# If you later use GNUInstallDirs.cmake, this would need more work to
# ensure accurate calculation of the relative path.
set(CLHEP_PKGCONFIG_PREFIX "\${pcfiledir}/../..")
set(CLHEP_PKGCONFIG_LIBDIR "\${prefix}/lib${LIBSUFFIX}")
set(CLHEP_PKGCONFIG_LIBDIR "\${prefix}/lib${LIB_SUFFIX}")
set(CLHEP_PKGCONFIG_INCLUDEDIR "\${prefix}/include")
configure_file(${PROJECT_SOURCE_DIR}/cmake/Templates/clhep.pc.in
......@@ -129,16 +129,16 @@ configure_file(${PROJECT_SOURCE_DIR}/cmake/Templates/clhep.pc.in
install(FILES
${PROJECT_BINARY_DIR}/InstallTreeFiles/CLHEPConfigVersion.cmake
${PROJECT_BINARY_DIR}/InstallTreeFiles/CLHEPConfig.cmake
DESTINATION lib${LIBSUFFIX}/CLHEP-${VERSION}
DESTINATION lib${LIB_SUFFIX}/CLHEP-${VERSION}
)
install(EXPORT CLHEPLibraryDepends DESTINATION lib${LIBSUFFIX}/CLHEP-${VERSION})
install(EXPORT CLHEPLibraryDepends DESTINATION lib${LIB_SUFFIX}/CLHEP-${VERSION})
# Install the pkg-config file. The choice of 'lib${LIBSUFFIX}/pkgconfig' for the
# Install the pkg-config file. The choice of 'lib${LIB_SUFFIX}/pkgconfig' for the
# installation seems fairly standard.
install(FILES
${PROJECT_BINARY_DIR}/InstallTreeFiles/clhep.pc
DESTINATION lib${LIBSUFFIX}/pkgconfig
DESTINATION lib${LIB_SUFFIX}/pkgconfig
)
# - And we should be done...
......
......@@ -91,12 +91,20 @@ macro( clhep_set_compiler_flags )
set(CMAKE_BUILD_TYPE RelWithDebInfo CACHE STRING "" FORCE)
endif()
message(STATUS "cmake build type is ${CMAKE_BUILD_TYPE}")
if( CMAKE_COMPILER_IS_GNUCC )
#message(STATUS "cmake compilers ${CMAKE_CXX_COMPILER} ${CMAKE_C_COMPILER}")
get_filename_component(clhep_cxx_compiler ${CMAKE_CXX_COMPILER} NAME)
get_filename_component(clhep_c_compiler ${CMAKE_C_COMPILER} NAME)
#message(STATUS "using compilers ${clhep_cxx_compiler} ${clhep_c_compiler}")
if( ${clhep_c_compiler} STREQUAL "clang" )
set(CMAKE_C_FLAGS "-O -pedantic -Wall ${CMAKE_C_FLAGS}")
elseif( CMAKE_COMPILER_IS_GNUCC )
set(CMAKE_C_FLAGS "-O -ansi -pedantic -Wall -D_GNU_SOURCE ${CMAKE_C_FLAGS}")
endif(CMAKE_COMPILER_IS_GNUCC)
if(CMAKE_COMPILER_IS_GNUCXX)
endif()
if( ${clhep_cxx_compiler} STREQUAL "clang++" )
set(CMAKE_CXX_FLAGS "-O -pedantic -Wall ${CMAKE_CXX_FLAGS}")
elseif(CMAKE_COMPILER_IS_GNUCXX)
set(CMAKE_CXX_FLAGS "-O -ansi -pedantic -Wall -D_GNU_SOURCE ${CMAKE_CXX_FLAGS}")
endif(CMAKE_COMPILER_IS_GNUCXX)
endif()
if( ${CMAKE_SYSTEM_NAME} MATCHES "Windows" )
##message( STATUS "system is Windows" )
##message( STATUS "CMAKE_BASE_NAME is ${CMAKE_BASE_NAME}" )
......@@ -108,7 +116,7 @@ macro( clhep_set_compiler_flags )
endif()
endif()
clhep_autoconf_variables()
message( STATUS "compiling with ${CMAKE_BASE_NAME} ${CMAKE_CXX_FLAGS} ${CXXFLAGS}")
message( STATUS "compiling with ${clhep_cxx_compiler} ${CMAKE_CXX_FLAGS} ${CXXFLAGS}")
endmacro( clhep_set_compiler_flags )
macro( clhep_package_config_no_lib )
......@@ -127,7 +135,7 @@ endmacro( clhep_package_config_no_lib )
macro( clhep_package_config )
set( ${PACKAGE}_CPPFLAGS "-I${includedir}" )
set( ${PACKAGE}_LDFLAGS "-L\${exec_prefix}/lib${LIBSUFFIX}" )
set( ${PACKAGE}_LDFLAGS "-L\${exec_prefix}/lib${LIB_SUFFIX}" )
set( ${PACKAGE}_LIBS "-lCLHEP-${PACKAGE}-${VERSION}" )
if( ${PACKAGE}_DEPS )
foreach ( dep ${${PACKAGE}_DEPS} )
......@@ -159,82 +167,87 @@ macro( clhep_config )
endmacro( clhep_config )
macro( _clhep_lib_suffix_64 )
if( APPLE )
#message(STATUS "checking LIB_SUFFIX ${LIB_SUFFIX} against ${CMAKE_SYSTEM_PROCESSOR} and ${CMAKE_OSX_ARCHITECTURES}")
# On Mac, we use NAME-ARCH, but ARCH is 'Universal' if more than
# one arch is built for. Note that falling back to use
# CMAKE_SYSTEM_PROCESSOR may *not* be 100% reliable.
list(LENGTH CMAKE_OSX_ARCHITECTURES _number_of_arches)
if(NOT _number_of_arches)
# - Default
if (${CMAKE_SYSTEM_PROCESSOR} STREQUAL "x86_64")
set(LIBSUFFIX ${LIB_SUFFIX})
else()
set(LIBSUFFIX "")
endif()
elseif(_number_of_arches GREATER 1)
# - Universal
set(LIBSUFFIX ${LIB_SUFFIX})
else()
# - Use what the user specified
if (${CMAKE_OSX_ARCHITECTURES} STREQUAL "x86_64")
set(LIBSUFFIX ${LIB_SUFFIX})
else()
set(LIBSUFFIX "")
endif()
endif()
elseif( ${CMAKE_SYSTEM_NAME} MATCHES "Windows" )
message(STATUS "checking LIB_SUFFIX ${LIB_SUFFIX} against ${CMAKE_SYSTEM_PROCESSOR} ")
if (${CMAKE_SYSTEM_PROCESSOR} STREQUAL "x86")
set(LIBSUFFIX ${LIB_SUFFIX})
if( APPLE )
#message(STATUS "checking LIB_SUFFIX ${LIB_SUFFIX} against ${CMAKE_SYSTEM_PROCESSOR} and ${CMAKE_OSX_ARCHITECTURES}")
# On Mac, we use NAME-ARCH, but ARCH is 'Universal' if more than
# one arch is built for. Note that falling back to use
# CMAKE_SYSTEM_PROCESSOR may *not* be 100% reliable.
list(LENGTH CMAKE_OSX_ARCHITECTURES _number_of_arches)
if(NOT _number_of_arches)
# - Default
if (${CMAKE_SYSTEM_PROCESSOR} STREQUAL "x86_64")
# building for 64bit
else()
set(LIBSUFFIX "")
message(STATUS "WARNING: LIB_SUFFIX ${LIB_SUFFIX} inappropriate for this build")
set(LIB_SUFFIX "")
endif()
elseif(_number_of_arches GREATER 1)
# - Universal
else()
message(STATUS "checking LIB_SUFFIX ${LIB_SUFFIX} against ${CMAKE_SYSTEM_PROCESSOR} ")
if (${CMAKE_SYSTEM_PROCESSOR} STREQUAL "x86_64")
set(LIBSUFFIX ${LIB_SUFFIX})
# - Use what the user specified
if (${CMAKE_OSX_ARCHITECTURES} STREQUAL "x86_64")
# building for 64bit
else()
set(LIBSUFFIX "")
message(STATUS "WARNING: LIB_SUFFIX ${LIB_SUFFIX} inappropriate for this build")
set(LIB_SUFFIX "")
endif()
endif()
elseif( ${CMAKE_SYSTEM_NAME} MATCHES "Windows" )
#message(STATUS "checking LIB_SUFFIX ${LIB_SUFFIX} against ${CMAKE_SYSTEM_PROCESSOR} ")
if (${CMAKE_SYSTEM_PROCESSOR} STREQUAL "x86")
# building for 64bit
else()
message(STATUS "WARNING: LIB_SUFFIX ${LIB_SUFFIX} inappropriate for this build")
set(LIB_SUFFIX "")
endif()
else()
#message(STATUS "checking LIB_SUFFIX ${LIB_SUFFIX} against ${CMAKE_SYSTEM_PROCESSOR} ")
if (${CMAKE_SYSTEM_PROCESSOR} STREQUAL "x86_64")
# building for 64bit
else()
message(STATUS "WARNING: LIB_SUFFIX ${LIB_SUFFIX} inappropriate for this build")
set(LIB_SUFFIX "")
endif()
endif()
endmacro( _clhep_lib_suffix_64 )
macro( _clhep_lib_suffix_32 )
if( APPLE )
#message(STATUS "checking LIB_SUFFIX ${LIB_SUFFIX} against ${CMAKE_SYSTEM_PROCESSOR} and ${CMAKE_OSX_ARCHITECTURES}")
# On Mac, we use NAME-ARCH, but ARCH is 'Universal' if more than
# one arch is built for. Note that falling back to use
# CMAKE_SYSTEM_PROCESSOR may *not* be 100% reliable.
list(LENGTH CMAKE_OSX_ARCHITECTURES _number_of_arches)
if(NOT _number_of_arches)
# - Default
if (${CMAKE_SYSTEM_PROCESSOR} STREQUAL "i386")
set(LIBSUFFIX ${LIB_SUFFIX})
else()
set(LIBSUFFIX "")
endif()
elseif(_number_of_arches GREATER 1)
# - Universal
set(LIBSUFFIX ${LIB_SUFFIX})
if( APPLE )
#message(STATUS "checking LIB_SUFFIX ${LIB_SUFFIX} against ${CMAKE_SYSTEM_PROCESSOR} and ${CMAKE_OSX_ARCHITECTURES}")
# On Mac, we use NAME-ARCH, but ARCH is 'Universal' if more than
# one arch is built for. Note that falling back to use
# CMAKE_SYSTEM_PROCESSOR may *not* be 100% reliable.
list(LENGTH CMAKE_OSX_ARCHITECTURES _number_of_arches)
if(NOT _number_of_arches)
# - Default
if (${CMAKE_SYSTEM_PROCESSOR} STREQUAL "i386")
# building for 32bit
else()
# - Use what the user specified
if (${CMAKE_OSX_ARCHITECTURES} STREQUAL "i386")
set(LIBSUFFIX ${LIB_SUFFIX})
else()
set(LIBSUFFIX "")
endif()
message(STATUS "WARNING: LIB_SUFFIX ${LIB_SUFFIX} inappropriate for this build")
set(LIB_SUFFIX "")
endif()
elseif(_number_of_arches GREATER 1)
# - Universal
else()
message(STATUS "checking LIB_SUFFIX ${LIB_SUFFIX} against ${CMAKE_SYSTEM_PROCESSOR} ")
if (${CMAKE_SYSTEM_PROCESSOR} STREQUAL "i686")
set(LIBSUFFIX ${LIB_SUFFIX})
elseif (${CMAKE_SYSTEM_PROCESSOR} STREQUAL "i386")
set(LIBSUFFIX ${LIB_SUFFIX})
# - Use what the user specified
if (${CMAKE_OSX_ARCHITECTURES} STREQUAL "i386")
# building for 32bit
else()
set(LIBSUFFIX "")
message(STATUS "WARNING: LIB_SUFFIX ${LIB_SUFFIX} inappropriate for this build")
set(LIB_SUFFIX "")
endif()
endif()
else()
#message(STATUS "checking LIB_SUFFIX ${LIB_SUFFIX} against ${CMAKE_SYSTEM_PROCESSOR} ")
if (${CMAKE_SYSTEM_PROCESSOR} STREQUAL "i686")
# building for 32bit
elseif (${CMAKE_SYSTEM_PROCESSOR} STREQUAL "i386")
# building for 32bit
else()
message(STATUS "WARNING: LIB_SUFFIX ${LIB_SUFFIX} inappropriate for this build")
set(LIB_SUFFIX "")
endif()
endif()
endmacro( _clhep_lib_suffix_32 )
macro( clhep_lib_suffix )
......@@ -243,9 +256,7 @@ macro( clhep_lib_suffix )
_clhep_lib_suffix_64()
elseif( ${LIB_SUFFIX} STREQUAL "32" )
_clhep_lib_suffix_32()
else()
set(LIBSUFFIX "")
endif()
endif()
message(STATUS "libraries will be installed in $ENV{DESTDIR}${CMAKE_INSTALL_PREFIX}/lib${LIBSUFFIX}")
message(STATUS "libraries will be installed in $ENV{DESTDIR}${CMAKE_INSTALL_PREFIX}/lib${LIB_SUFFIX}")
endmacro( clhep_lib_suffix )
Markdown is supported
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