ecl_platform_detection.cmake
Go to the documentation of this file.
00001 ###############################################################################
00002 # Platform Detection
00003 ###############################################################################
00004 
00005 #ifdef DOXYGEN_SHOULD_SKIP_THIS
00006 
00007 ###############################
00008 # Distro
00009 ###############################
00010 # Checks the linux distro and 
00011 # sets the following variables
00012 #
00013 # - DISTRO_NAME
00014 # - DISTRO_VERSION
00015 # - DISTRO_VERSION_STRING
00016 #
00017 # If no recognised distro is found, it will 
00018 # return each variable with a -UNKNOWN appended 
00019 # (e.g. DISTRO_NAME = DISTRO_NAME-UNKNOWN)
00020 # 
00021 macro(ecl_detect_distro)
00022     if(EXISTS "/etc/issue")
00023         file(READ "/etc/issue" ETC_ISSUE)
00024         string(REGEX MATCH "9.10" DISTRO_KARMIC ${ETC_ISSUE})
00025         string(REGEX MATCH "10.04" DISTRO_LUCID ${ETC_ISSUE})
00026         string(REGEX MATCH "10.10" DISTRO_MAVERICK ${ETC_ISSUE})
00027         string(REGEX MATCH "11.04" DISTRO_NATTY ${ETC_ISSUE})
00028         string(REGEX MATCH "11.10" DISTRO_ONEIRIC ${ETC_ISSUE})
00029         string(REGEX MATCH "12.04" DISTRO_PRECISE ${ETC_ISSUE})
00030     endif()
00031     if(DISTRO_KARMIC)
00032         set(DISTRO_NAME "Ubuntu")
00033         set(DISTRO_VERSION "9.10")
00034         set(DISTRO_VERSION_STRING "karmic")
00035     elseif(DISTRO_LUCID)
00036         set(DISTRO_NAME "Ubuntu")
00037         set(DISTRO_VERSION "10.04")
00038         set(DISTRO_VERSION_STRING "lucid")
00039     elseif(DISTRO_MAVERICK)
00040         set(DISTRO_NAME "Ubuntu")
00041         set(DISTRO_VERSION "10.10")
00042         set(DISTRO_VERSION_STRING "maverick")
00043     elseif(DISTRO_NATTY)
00044         set(DISTRO_NAME "Ubuntu")
00045         set(DISTRO_VERSION "11.04")
00046         set(DISTRO_VERSION_STRING "natty")
00047     elseif(DISTRO_ONEIRIC)
00048         set(DISTRO_NAME "Ubuntu")
00049         set(DISTRO_VERSION "11.10")
00050         set(DISTRO_VERSION_STRING "oneiric")
00051     elseif(DISTRO_PRECISE)
00052         set(DISTRO_NAME "Ubuntu")
00053         set(DISTRO_VERSION "12.04")
00054         set(DISTRO_VERSION_STRING "precise")
00055     else()
00056         set(DISTRO_NAME DISTRO_NAME-UNKNOWN)
00057         set(DISTRO_VERSION DISTRO_VERSION-UNKNOWN)
00058         set(DISTRO_VERSION_STRING DISTRO_VERSION_STRING-UNKNOWN)
00059     endif()
00060 endmacro()
00061 
00062 ###############################
00063 # Detect Posix
00064 ###############################
00065 # This is as yet quite incomplete, but it suffices for what the 
00066 # ecl currrently does. If it detects posix, it sets
00067 # 
00068 #  - PLATFORM_IS_POSIX
00069 #
00070 # It also configures the following variables to true
00071 # for public consumption if found (these are close to equivalent
00072 # to their c macro counterparts):
00073 #
00074 #  - POSIX_HAS_CLOCK_GETTIME
00075 #  - POSIX_HAS_CLOCK_NANOSLEEP
00076 #  - POSIX_HAS_TIMERS
00077 #  - POSIX_HAS_PRIORITY_SCHEDULING
00078 #  - POSIX_HAS_TIMEOUTS
00079 #  - POSIX_HAS_SEMAPHORES
00080 #  - POSIX_HAS_SHARED_MEMORY_OBJECTS
00081 #  - POSIX_HAS_CLOCK_MONOTONIC
00082 #  - POSIX_HAS_CPUTIME
00083 #
00084 macro(ecl_detect_posix)
00085 
00086     # Need some standard cmake modules
00087     include(CheckSymbolExists)
00088     include(CheckLibraryExists)
00089 
00090     check_symbol_exists(_POSIX_VERSION unistd.h PLATFORM_IS_POSIX)
00091 
00092     if(PLATFORM_IS_POSIX)
00093         check_library_exists(rt clock_nanosleep "" POSIX_HAS_CLOCK_NANOSLEEP)
00094         check_library_exists(rt clock_gettime "" POSIX_HAS_CLOCK_GETTIME)
00095         check_library_exists(pthread pthread_mutex_timedlock "" POSIX_HAS_MUTEX_TIMEDLOCK)
00096         check_library_exists(pthread nanosleep "" POSIX_HAS_NANOSLEEP)
00097         check_library_exists(rt shm_open "" POSIX_HAS_SHM_OPEN)
00098         check_library_exists(pthread sched_setscheduler "" POSIX_HAS_SCHED_SETSCHEDULER)
00099         check_library_exists(pthread sem_timedwait "" POSIX_HAS_SEM_TIMEDWAIT)
00100         check_library_exists(pthread sem_init "" POSIX_HAS_SEM_INIT)
00101         check_symbol_exists(CLOCK_MONOTONIC time.h POSIX_HAS_CLOCK_MONOTONIC)
00102         check_symbol_exists(CLOCK_PROCESS_CPUTIME_ID time.h POSIX_HAS_CPUTIME)
00103     endif()
00104     
00105     if(POSIX_HAS_CLOCK_GETTIME)
00106         set(POSIX_HAS_MONOTONIC_CLOCK TRUE)
00107     endif()
00108     if(POSIX_HAS_CLOCK_NANOSLEEP)
00109         set(POSIX_HAS_CLOCK_SELECTION TRUE)
00110     endif()
00111     if(POSIX_HAS_NANOSLEEP)
00112         set(POSIX_HAS_TIMERS TRUE)
00113     endif()
00114     if(POSIX_HAS_SCHED_SETSCHEDULER)
00115         set(POSIX_HAS_PRIORITY_SCHEDULING TRUE)
00116     endif()
00117     if(POSIX_HAS_SEM_TIMEDWAIT AND POSIX_HAS_MUTEX_TIMEDLOCK)
00118         set(POSIX_HAS_TIMEOUTS TRUE)
00119     endif()
00120     if(POSIX_HAS_SEM_INIT)
00121         set(POSIX_HAS_SEMAPHORES TRUE)
00122     endif()
00123     if(POSIX_HAS_SHM_OPEN)
00124         set(POSIX_HAS_SHARED_MEMORY_OBJECTS TRUE)
00125     endif()
00126 endmacro()
00127 
00128 ###############################
00129 # Detect Threads
00130 ###############################
00131 # If present, sets the variables to 1
00132 #
00133 #  - PLATFORM_HAS_POSIX_THREADS
00134 #  - PLATFORM_HAS_WIN32_THREADS
00135 #
00136 macro(ecl_detect_threads)
00137     include(FindThreads)
00138     if(CMAKE_USE_PTHREADS_INIT) 
00139       set(PLATFORM_HAS_POSIX_THREADS 1)
00140     elseif(CMAKE_USE_WIN32_THREADS_INIT)
00141       set(PLATFORM_HAS_WIN32_THREADS 1)
00142     endif(CMAKE_USE_PTHREADS_INIT)
00143 endmacro()
00144 
00145 ###############################
00146 # Detect Timers
00147 ###############################
00148 # This is very rough, if the right env found, sets the variables to 1
00149 # 
00150 #  - PLATFORM_HAS_WIN_TIMERS
00151 #  - PLATFORM_HAS_MACH_TIMERS
00152 #  - PLATFORM_HAS_RT_TIMERS
00153 #  - PLATFORM_HAS_POSIX_TIMERS
00154 #
00155 macro(ecl_detect_timers)
00156   if(WIN32)
00157     set(PLATFORM_HAS_WIN_TIMERS 1)
00158   elseif(APPLE)
00159     set(PLATFORM_HAS_MACH_TIMERS 1) # Should we check for this?
00160   elseif(POSIX_HAS_CLOCK_GETTIME AND POSIX_HAS_CLOCK_NANOSLEEP) # Found by ecl_detect_posix 
00161     set(PLATFORM_HAS_RT_TIMERS TRUE)
00162   elseif ( POSIX_HAS_TIMERS ) 
00163     set(PLATFORM_HAS_POSIX_TIMERS 1) 
00164   endif()
00165 endmacro()
00166 
00167 ###############################
00168 # Detect Sizes
00169 ###############################
00170 # Configures the variables:
00171 # 
00172 #  - PLATFORM_SIZE_OF_CHAR
00173 #  - PLATFORM_SIZE_OF_SHORT
00174 #  - PLATFORM_SIZE_OF_INT
00175 #  - PLATFORM_SIZE_OF_LONG
00176 #  - PLATFORM_SIZE_OF_LONG_LONG
00177 #  - PLATFORM_SIZE_OF_FLOAT
00178 #  - PLATFORM_SIZE_OF_DOUBLE
00179 #  - PLATFORM_SIZE_OF_LONG_DOUBLE
00180 #  - PLATFORM_IS_32_BIT
00181 #  - PLATFORM_IS_64_BIT
00182 macro(ecl_detect_sizes)
00183     include(CheckTypeSize)
00184     
00185     CHECK_TYPE_SIZE (char PLATFORM_SIZE_OF_CHAR)
00186     CHECK_TYPE_SIZE (short PLATFORM_SIZE_OF_SHORT)
00187     CHECK_TYPE_SIZE (int PLATFORM_SIZE_OF_INT)
00188     CHECK_TYPE_SIZE (long PLATFORM_SIZE_OF_LONG)
00189     CHECK_TYPE_SIZE ("long long" PLATFORM_SIZE_OF_LONG_LONG)
00190     CHECK_TYPE_SIZE (float PLATFORM_SIZE_OF_FLOAT)
00191     CHECK_TYPE_SIZE (double PLATFORM_SIZE_OF_DOUBLE)
00192     CHECK_TYPE_SIZE ("long double" PLATFORM_SIZE_OF_LONG_DOUBLE)
00193     
00194     if( CMAKE_SIZEOF_VOID_P EQUAL 4 )
00195       set(PLATFORM_IS_32_BIT 1)
00196     elseif( CMAKE_SIZEOF_VOID_P EQUAL 8 ) 
00197       set(PLATFORM_IS_64_BIT 1)
00198     endif( CMAKE_SIZEOF_VOID_P EQUAL 4 )
00199 endmacro()
00200 
00201 ###############################
00202 # Detect Char Type
00203 ###############################
00204 # Configures (or not) the variables:
00205 # 
00206 #  - PLATFORM_CHAR_IS_SIGNED
00207 #  - PLATFORM_CHAR_IS_UNSIGNED
00208 #
00209 # This is bad because it fails when cross compiling. It is possible
00210 # to do it without try_run though. Use try_compile on the classes
00211 # set up like in ecl/concepts/containers so that it will fail to
00212 # compile if a private constructor is called. Not necessary for
00213 # us right now though. 
00214 # 
00215 macro(ecl_detect_char_type)
00216   rosbuild_find_ros_package(ecl_build)
00217   set(ECL_CMAKE_TESTS_PATH ${ecl_build_PACKAGE_PATH}/cmake/tests)
00218   try_run(IS_SIGNED_RAN_SUCCESS
00219           IS_SIGNED_COMPILED_SUCCESS 
00220               "${CMAKE_BINARY_DIR}"
00221               "${ECL_CMAKE_TESTS_PATH}/is_char_signed.cpp"
00222               RUN_OUTPUT_VARIABLE IS_SIGNED_OUTPUT
00223               )
00224    if(IS_SIGNED_OUTPUT STREQUAL "signed")
00225      set(PLATFORM_CHAR_IS_SIGNED TRUE)
00226    else()
00227      set(PLATFORM_CHAR_IS_UNSIGNED TRUE)
00228    endif()
00229 endmacro()
00230 
00231 ###############################
00232 # Detect Endianness
00233 ###############################
00234 # Configures the variables:
00235 # 
00236 #  - PLATFORM_IS_BIG_ENDIAN
00237 #  - PLATFORM_IS_LITTLE_ENDIAN
00238 #
00239 macro(ecl_detect_endianness)
00240     include(TestBigEndian)
00241     TEST_BIG_ENDIAN(PLATFORM_IS_BIG_ENDIAN)
00242     if(NOT PLATFORM_IS_BIG_ENDIAN)
00243       set(PLATFORM_IS_LITTLE_ENDIAN 1)
00244     endif()
00245 endmacro()
00246 
00247 ###############################
00248 # Set Platform Specific Flags
00249 ###############################
00250 # This is rather dependant on having used the ecl toolchain/platform
00251 # cmake scripts to configure the following variables:
00252 #
00253 #  - PLATFORM_ARCH/PLATFORM_CPU/PLATFORM_TUNE/PLATFORM_OTHER_CFLAGS
00254 # 
00255 # It parses these and adds them in the correct way to CMAKE_CXX_FLAGS.
00256 #
00257 macro(ecl_set_platform_cflags)
00258     set(PLATFORM_ARCH "unspecified" CACHE STRING "Architecture type to pass (e.g. to gcc via -march)." )
00259     set(PLATFORM_CPU "unspecified" CACHE STRING "Cpu type to pass (e.g. to gcc via -mcpu)." )
00260     set(PLATFORM_TUNE "unspecified" CACHE STRING "Cpu type to tune (e.g. to gcc via -mtune)." )
00261     
00262     # Reason for having abstracted arch,cpu and tunes are so that 
00263     # different compiler flags for different platforms can be used here.
00264     IF ( NOT ROS_COMPILE_FLAGS ) # Don't add anything here if ros has already handled it
00265       if( CMAKE_COMPILER_IS_GNUCXX ) # # Generic GnuCXX, also includes MinGW
00266         if(NOT PLATFORM_ARCH STREQUAL "unspecified") # System Architecture
00267           set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -march=${PLATFORM_ARCH}") # This gets used for all builds
00268           set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -march=${PLATFORM_ARCH}") # This gets used for all builds
00269         endif(NOT PLATFORM_ARCH STREQUAL "unspecified")
00270         if(NOT PLATFORM_CPU STREQUAL "unspecified") # System CPU
00271           set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -mcpu=${PLATFORM_CPU}")
00272           set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -mcpu=${PLATFORM_CPU}")
00273         endif(NOT PLATFORM_CPU STREQUAL "unspecified")
00274         if(NOT PLATFORM_TUNE STREQUAL "unspecified") # System CPU Tuner
00275           set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -mtune=${PLATFORM_TUNE}")
00276           set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -mtune=${PLATFORM_TUNE}")
00277         endif(NOT PLATFORM_TUNE STREQUAL "unspecified")
00278         if(DEFINED PLATFORM_OTHER_CFLAGS)
00279           set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} ${PLATFORM_OTHER_CFLAGS}")
00280           set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} ${PLATFORM_OTHER_CFLAGS}")
00281         endif(DEFINED PLATFORM_OTHER_CFLAGS)
00282       endif()
00283     endif()
00284     
00285     string(STRIP "${CMAKE_C_FLAGS}" CMAKE_C_FLAGS)
00286     string(STRIP "${CMAKE_CXX_FLAGS}" CMAKE_CXX_FLAGS)
00287 endmacro()
00288 
00289 ###############################
00290 # Compiler Version
00291 ###############################
00292 # Configures the variables:
00293 # 
00294 #  - COMPILER_VERSION
00295 #  - COMPILER_MAJOR_VERSION
00296 #  - COMPILER_MINOR_VERSION
00297 #  - COMPILER_PATCH_VERSION
00298 #
00299 macro(ecl_detect_compiler_version)
00300     if(${MSVC})
00301       set(COMPILER_VERSION ${MSVC})
00302     else()
00303       execute_process(
00304         COMMAND ${CMAKE_CXX_COMPILER} --version
00305         OUTPUT_VARIABLE COMPILER_VERSION_STRING
00306         )
00307       string(REGEX REPLACE ".* ([0-9])\\.([0-9])\\.([0-9]).*" "\\1.\\2.\\3"
00308                          COMPILER_VERSION ${COMPILER_VERSION_STRING})
00309       string(REGEX REPLACE ".* ([0-9])\\.[0-9]\\.[0-9].*" "\\1"
00310                          COMPILER_MAJOR_VERSION ${COMPILER_VERSION_STRING})
00311       string(REGEX REPLACE ".* [0-9]\\.([0-9])\\.[0-9].*" "\\1"
00312                          COMPILER_MINOR_VERSION ${COMPILER_VERSION_STRING})
00313       string(REGEX REPLACE ".* [0-9]\\.[0-9]\\.([0-9]).*" "\\1"
00314                          COMPILER_PATCH_VERSION ${COMPILER_VERSION_STRING})
00315     endif()
00316 endmacro()
00317 
00318 ###############################
00319 # Check CXX Flags
00320 ###############################
00321 #
00322 # This is a more general version of CheckCXXCompilerFlags.
00323 # Why they made that one good only for compiler flags I dont know.
00324 # Anyway, this one lets you also check for linker flags.
00325 #
00326 # Usage:
00327 #   ecl_check_cxx_flags("-Wl,--as-needed" LINK_AS_NEEDED)
00328 #   if(${LINK_AS_NEEDED})
00329 #     set(${_flag} "-Wl,--as-needed")
00330 #   else()
00331 #     set(${_flag} "")
00332 #   endif()
00333 #
00334 macro(ecl_check_cxx_flags _flag _result)
00335     include(CheckCXXSourceCompiles)
00336     set(ORIGINAL_CMAKE_REQUIRED_FLAGS "${CMAKE_REQUIRED_FLAGS}")
00337     set(CMAKE_REQUIRED_FLAGS "${_flag}")
00338     CHECK_CXX_SOURCE_COMPILES("int main() { return 0;}" ${_result}
00339       # Some compilers do not fail with a bad flag
00340       FAIL_REGEX "unrecognized .*option"                     # GNU
00341       FAIL_REGEX "ignoring unknown option"                   # MSVC
00342       FAIL_REGEX "[Uu]nknown option"                         # HP
00343       FAIL_REGEX "[Ww]arning: [Oo]ption"                     # SunPro
00344       FAIL_REGEX "command option .* is not recognized"       # XL
00345       )
00346     set(CMAKE_REQUIRED_FLAGS "${ORIGINAL_CMAKE_REQUIRED_FLAGS}")
00347 endmacro()
00348 
00349 ###############################
00350 # Compiler - link as needed
00351 ###############################
00352 #
00353 # This returns the result of a suitable flag for the compiler in _flag.
00354 #
00355 # ecl_link_as_needed(ECL_LINK_AS_NEEDED_FLAG)
00356 # set(ROS_LINK_FLAGS "${ROS_LINK_FLAGS} ${ECL_LINK_AS_NEEDED_FLAG}")
00357 #
00358 macro(ecl_link_as_needed _flag)
00359     if(APPLE) # Apple gnu
00360         ecl_check_cxx_flags("-Wl,-mark_dead_strippable_dylib" DEAD_STRIPPABLE)
00361         if(${DEAD_STRIPPABLE})
00362             set(${_flag} "-Wl,-mark_dead_strippable_dylib")
00363         else()
00364             set(${_flag} "")
00365         endif()
00366     elseif(CMAKE_COMPILER_IS_GNUCXX) # Linux gnu
00367         ecl_check_cxx_flags("-Wl,--as-needed" link_as_needed)
00368         if(${link_as_needed})
00369             set(${_flag} "-Wl,--as-needed")
00370         else()
00371             set(${_flag} "")
00372         endif()
00373     endif()
00374 endmacro()
00375 
00376 ###############################
00377 # Compiler - no as needed
00378 ###############################
00379 #
00380 # This returns the result of a suitable flag for the compiler in _flag.
00381 #
00382 # ecl_link_no_as_needed(ECL_LINK_NO_AS_NEEDED_FLAG)
00383 # set(ROS_LINK_FLAGS "${ROS_LINK_FLAGS} ${ECL_LINK_NO_AS_NEEDED_FLAG}")
00384 #
00385 macro(ecl_link_no_as_needed _flag)
00386     if(CMAKE_COMPILER_IS_GNUCXX)
00387         ecl_check_cxx_flags("-Wl,--no-as-needed" link_as_no_needed)
00388         if(${link_as_no_needed})
00389             set(${_flag} "-Wl,--no-as-needed")
00390         else()
00391             set(${_flag} "")
00392         endif()
00393     endif()
00394 endmacro()
00395 
00396 ###############################
00397 # Platform Detection
00398 ###############################
00399 #
00400 # The one to bind them all (detect macros)
00401 #
00402 macro(ecl_detect_platform)
00403     ecl_detect_distro()
00404     ecl_detect_posix()
00405     ecl_detect_threads()
00406     ecl_detect_timers()
00407     ecl_detect_sizes()
00408     ecl_detect_endianness()
00409     #ecl_detect_char_type() # has a try_run test, bad for cross compiling
00410     ecl_detect_compiler_version()
00411     if(NOT PLATFORM_IS_POSIX)
00412         if(WIN32)
00413             set(PLATFORM_IS_WIN32 1)
00414         endif()
00415     endif()
00416     if(APPLE) 
00417         set(PLATFORM_IS_APPLE 1)
00418     endif()
00419 endmacro()
00420 
00421 ###############################
00422 # Platform Summary
00423 ###############################
00424 #
00425 # Summarise platform statistics
00426 #
00427 macro(ecl_summary_platform)
00428     message("-------------------------------------------------------------------")
00429     message("Platform Summary")
00430     message("-------------------------------------------------------------------")
00431     message("")
00432     # System
00433     if(PLATFORM_IS_APPLE)
00434         message("System type.....................macosx")
00435     elseif(PLATFORM_IS_POSIX)
00436         message("System type.....................posix")
00437     elseif(PLATFORM_IS_WIN32)
00438         message("System type.....................win32")
00439     endif()
00440     message("Operating System................${CMAKE_SYSTEM}")
00441     if ( NOT DISTRO_NAME STREQUAL "DISTRO_NAME-UNKNOWN")
00442         message("Distro Name.....................${DISTRO_NAME}")
00443     endif()
00444     if ( NOT DISTRO_VERSION_STRING STREQUAL "DISTRO_VERSION_STRING-UNKNOWN")
00445         message(" - version string...............${DISTRO_VERSION_STRING}")
00446     endif()
00447     if ( NOT DISTRO_VERSION STREQUAL "DISTRO_VERSION-UNKNOWN")
00448         message(" - version......................${DISTRO_VERSION}")
00449     endif()
00450     # Cpu Specifics
00451     if(DEFINED PLATFORM_ARCH)
00452         message("Architecture....................${PLATFORM_ARCH}")
00453     endif(DEFINED PLATFORM_ARCH)
00454     if(DEFINED PLATFORM_CPU)
00455         message("Cpu type........................${PLATFORM_CPU}")
00456     endif(DEFINED PLATFORM_CPU)
00457     if(DEFINED PLATFORM_TUNE)
00458         message("Tuned cpu type..................${PLATFORM_TUNE}")
00459     endif(DEFINED PLATFORM_TUNE)
00460     if(DEFINED PLATFORM_OTHER_CFLAGS)
00461         message("Cpu specific cflags.............${PLATFORM_OTHER_CFLAGS}")
00462     endif(DEFINED PLATFORM_OTHER_CFLAGS)
00463     # Timers
00464     if(PLATFORM_HAS_RT_TIMERS)
00465         message("Timer model.....................real-time")
00466     elseif(PLATFORM_HAS_MACH_TIMERS)
00467         message("Timer model.....................macosx")
00468     elseif(PLATFORM_HAS_POSIX_TIMERS)
00469         message("Timer model.....................posix")
00470     elseif(PLATFORM_HAS_WIN_TIMERS)
00471         message("Timer model.....................winmm")
00472     else()
00473         message("Timer model.....................unspecified")
00474     endif()
00475     # Threads
00476     if(CMAKE_USE_PTHREADS_INIT)
00477         message("Thread model....................posix")
00478     elseif(CMAKE_USE_WIN32_THREADS_INIT)
00479         message("Thread model....................win32")
00480     else(CMAKE_USE_PTHREADS_INIT)
00481         message("Thread model....................none")
00482     endif(CMAKE_USE_PTHREADS_INIT)
00483     # Type sizes
00484     message("Size of char....................${PLATFORM_SIZE_OF_CHAR}")
00485     message("Size of short...................${PLATFORM_SIZE_OF_SHORT}")
00486     message("Size of int.....................${PLATFORM_SIZE_OF_INT}")
00487     message("Size of long....................${PLATFORM_SIZE_OF_LONG}")
00488     message("Size of long long...............${PLATFORM_SIZE_OF_LONG_LONG}")
00489     message("Size of float...................${PLATFORM_SIZE_OF_FLOAT}")
00490     message("Size of double..................${PLATFORM_SIZE_OF_DOUBLE}")
00491     message("Size of long double.............${PLATFORM_SIZE_OF_LONG_DOUBLE}")
00492     if(PLATFORM_IS_32_BIT)
00493         message("Size of pointer.................32-bit")
00494     elseif(PLATFORM_IS_64_BIT)
00495         message("Size of pointer.................64-bit")
00496     endif(PLATFORM_IS_32_BIT)
00497     
00498     if(PLATFORM_IS_BIG_ENDIAN)
00499         message("Endianness......................big-endian")
00500     else(PLATFORM_IS_BIG_ENDIAN)
00501         message("Endianness......................little-endian")
00502     endif(PLATFORM_IS_BIG_ENDIAN)
00503     message("")
00504 
00505     if(PLATFORM_IS_POSIX)
00506         message("-------------------------------------------------------------------")
00507         message("Posix Specifications")
00508         message("-------------------------------------------------------------------")
00509         message("")
00510         if(POSIX_HAS_CLOCK_SELECTION)
00511             message("Clock selection.................yes")
00512         else()
00513             message("Clock selection.................no")
00514         endif()
00515         if(POSIX_HAS_MONOTONIC_CLOCK)
00516             message("Monotonic clock.................yes")
00517         else()
00518           message("Monotonic clock.................no")
00519         endif()
00520         if(POSIX_HAS_PRIORITY_SCHEDULING)
00521             message("Priority scheduling.............yes")
00522         else()
00523             message("Priority scheduling.............no")
00524         endif()
00525         if(POSIX_HAS_SEMAPHORES)
00526             message("Semaphores......................yes")
00527         else()
00528             message("Semaphores......................no")
00529         endif()
00530         if(POSIX_HAS_SHARED_MEMORY_OBJECTS)
00531             message("Shared memory objects...........yes")
00532         else()
00533             message("Shared memory objects...........no")
00534         endif()
00535         if(POSIX_HAS_TIMERS)
00536             message("Timers..........................yes")
00537         else()
00538             message("Timers..........................no")
00539         endif()
00540         if(POSIX_HAS_TIMEOUTS)
00541             message("Timeouts........................yes")
00542         else()
00543             message("Timeouts........................no")
00544         endif()
00545         if(POSIX_HAS_CLOCK_GETTIME)
00546             message(" - clock_gettime................yes")
00547         else()
00548             message(" - clock_gettime................no")
00549         endif()
00550         if(POSIX_HAS_CLOCK_NANOSLEEP)
00551             message(" - clock_nanosleep..............yes")
00552         else()
00553             message(" - clock_nanosleep..............no")
00554         endif()
00555         if(POSIX_HAS_NANOSLEEP)
00556             message(" - nanosleep....................yes")
00557         else()
00558             message(" - nanosleep....................no")
00559         endif()
00560         if(POSIX_HAS_MUTEX_TIMEDLOCK)
00561             message(" - pthread_mutex_timedlock......yes")
00562         else()
00563             message(" - pthread_mutex_timedlock......no")
00564         endif()
00565         if(POSIX_HAS_SCHED_SETSCHEDULER)
00566             message(" - sched_setscheduler...........yes")
00567         else()
00568             message(" - sched_setscheduler...........no")
00569         endif()
00570         if(POSIX_HAS_SEM_INIT)
00571             message(" - sem_init.....................yes")
00572         else()
00573             message(" - sem_init.....................no")
00574         endif()
00575         if(POSIX_HAS_SEM_TIMEDWAIT)
00576             message(" - sem_timedwait................yes")
00577         else()
00578             message(" - sem_timedwait................no")
00579         endif()
00580         if(POSIX_HAS_SHM_OPEN)
00581             message(" - shm_open.....................yes")
00582         else()
00583             message(" - shm_open.....................no")
00584         endif()
00585         message("")
00586     endif()
00587     message("-------------------------------------------------------------------")
00588     message("Build Environment")
00589     message("-------------------------------------------------------------------")
00590     message("")
00591     # Compiler
00592     message("Compiler........................${CMAKE_CXX_COMPILER}")
00593     if(COMPILER_VERSION)
00594         message(" - version......................${COMPILER_VERSION}")
00595     endif()
00596     message("")
00597 endmacro()
00598 
00599 #endif // DOXYGEN_SHOULD_SKIP_THIS


ecl_build
Author(s): Daniel Stonier (d.stonier@gmail.com)
autogenerated on Thu Jan 2 2014 11:13:41