Complete the cmake platform checks and remove unnecessary defines.

This commit is contained in:
Benoit Jacob 2007-05-31 07:21:34 +00:00
parent 658eccd43b
commit 8f202dc67f
4 changed files with 42 additions and 43 deletions

View File

@ -0,0 +1,17 @@
INCLUDE(CheckCXXSourceCompiles)
MACRO (CHECK_LONG_DOUBLE _RESULT)
SET(_CHECK_LONG_DOUBLE_SOURCE_CODE "
int main(int argc, char *argv[])
{
long double ld = static_cast<long double>(0);
return 0;
}
")
CHECK_CXX_SOURCE_COMPILES("${_CHECK_LONG_DOUBLE_SOURCE_CODE}" ${_RESULT})
ENDMACRO (CHECK_LONG_DOUBLE)

18
cmake/CheckLongLong.cmake Normal file
View File

@ -0,0 +1,18 @@
INCLUDE(CheckCXXSourceCompiles)
MACRO (CHECK_LONG_LONG _RESULT)
SET(_CHECK_LONG_LONG_SOURCE_CODE "
int main(int argc, char *argv[])
{
long long ll = static_cast<long long>(0);
long long int lli = static_cast<long long int>(0);
return 0;
}
")
CHECK_CXX_SOURCE_COMPILES("${_CHECK_LONG_LONG_SOURCE_CODE}" ${_RESULT})
ENDMACRO (CHECK_LONG_LONG)

View File

@ -4,6 +4,8 @@ INCLUDE (CheckComplexMath1)
INCLUDE (CheckComplexMath2)
INCLUDE (CheckIeeeMath)
INCLUDE (CheckSysvMath)
INCLUDE (CheckLongDouble)
INCLUDE (CheckLongLong)
# the following are directories where stuff will be installed to
set(INCLUDE_INSTALL_DIR
@ -14,12 +16,15 @@ set(INCLUDE_INSTALL_DIR
FILE(GLOB tvmet_header_SRCS "*.h")
CHECK_INCLUDE_FILES (dlfcn.h TVMET_HAVE_DLFCN_H)
CHECK_INCLUDE_FILES (sys/time.h TVMET_HAVE_SYS_TIME_H)
CHECK_INCLUDE_FILES (unistd.h TVMET_HAVE_UNISTD_H)
CHECK_COMPLEX (TVMET_HAVE_COMPLEX)
CHECK_COMPLEX_MATH1 (TVMET_HAVE_COMPLEX_MATH1)
CHECK_COMPLEX_MATH2 (TVMET_HAVE_COMPLEX_MATH2)
CHECK_IEEE_MATH (TVMET_HAVE_IEEE_MATH)
CHECK_SYSV_MATH (TVMET_HAVE_SYSV_MATH)
CHECK_LONG_DOUBLE (TVMET_HAVE_LONG_DOUBLE)
CHECK_LONG_DOUBLE (TVMET_HAVE_LONG_LONG)
CONFIGURE_FILE(${CMAKE_CURRENT_SOURCE_DIR}/config.h.cmake
${INCLUDE_INSTALL_DIR}/config.h)

View File

@ -10,64 +10,23 @@
/* define if the compiler has more complex math functions */
#cmakedefine TVMET_HAVE_COMPLEX_MATH2
/* Define to 1 if you have the <dlfcn.h> header file. */
#cmakedefine TVMET_HAVE_DLFCN_H 1
/* Define to 1 if you have the `floor' function. */
#cmakedefine TVMET_HAVE_FLOOR 1
/* Define if the compiler supports IEEE math library */
#cmakedefine TVMET_HAVE_IEEE_MATH
/* Define to 1 if you have the <inttypes.h> header file. */
#cmakedefine TVMET_HAVE_INTTYPES_H 1
/* Define to 1 if you have the `dl' library (-ldl). */
#cmakedefine TVMET_HAVE_LIBDL 1
/* Define to 1 if long double works and has more range or precision than
double. */
/* Define to 1 if the long double type */
#cmakedefine TVMET_HAVE_LONG_DOUBLE 1
/* Define if the compiler supports the long_long type */
#cmakedefine TVMET_HAVE_LONG_LONG
/* Define to 1 if you have the <memory.h> header file. */
#cmakedefine TVMET_HAVE_MEMORY_H 1
/* Define to 1 if you have the `pow' function. */
#cmakedefine TVMET_HAVE_POW 1
/* Define to 1 if you have the `rint' function. */
#cmakedefine TVMET_HAVE_RINT 1
/* Define to 1 if you have the `sqrt' function. */
#cmakedefine TVMET_HAVE_SQRT 1
/* Define if the compiler supports SYSV math library */
#cmakedefine TVMET_HAVE_SYSV_MATH
/* Define to 1 if you have the <sys/stat.h> header file. */
#cmakedefine TVMET_HAVE_SYS_STAT_H 1
/* Define to 1 if you have the <sys/time.h> header file. */
#cmakedefine TVMET_HAVE_SYS_TIME_H 1
/* Define to 1 if you have the <sys/types.h> header file. */
#cmakedefine TVMET_HAVE_SYS_TYPES_H 1
/* Define if the compiler recognizes typename */
// ALWAYS ON -- so remove this define in the future.
#define TVMET_HAVE_TYPENAME
/* Define to 1 if you have the <unistd.h> header file. */
#cmakedefine TVMET_HAVE_UNISTD_H 1
/* Define to 1 if you have the ANSI C header files. */
#cmakedefine TVMET_STDC_HEADERS 1
/* Define to 1 if your <sys/time.h> declares `struct tm'. */
#cmakedefine TVMET_TM_IN_SYS_TIME 1
/* _INCLUDE_TVMET_CONFIG_H */
#endif