X-Git-Url: https://git.creatis.insa-lyon.fr/pubgit/?a=blobdiff_plain;f=CMakeLists.txt;h=5ff95b1b256b019901b458e1c1ab8a9607bdcb79;hb=e1d59b9033b0e40ae040ad8f6a66892a7157ba99;hp=7d4de8923a68f2a37bf9078befd21d8e28046183;hpb=45490622810d0706cb4ec538634c4a886f39737b;p=gdcm.git diff --git a/CMakeLists.txt b/CMakeLists.txt index 7d4de892..5ff95b1b 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -27,6 +27,30 @@ SET (EXECUTABLE_OUTPUT_PATH ${GDCM_BINARY_DIR}/bin CACHE PATH "Single output dir SET (LIBRARY_OUTPUT_PATH ${GDCM_BINARY_DIR}/bin CACHE PATH "Single output directory for building all libraries.") MARK_AS_ADVANCED(LIBRARY_OUTPUT_PATH EXECUTABLE_OUTPUT_PATH) +#----------------------------------------------------------------------------- +# Test if compiler defines __FUNCTION__ +IF("GDCM_COMPILER_HAS_FUNCTION" MATCHES "^GDCM_COMPILER_HAS_FUNCTION$") + MESSAGE(STATUS "Checking support for __FUNCTION__ in compiler") + TRY_COMPILE(GDCM_COMPILER_HAS_FUNCTION + ${GDCM_BINARY_DIR}/CMakeTmp/Function + ${GDCM_SOURCE_DIR}/gdcmTestFUNCTION.cxx + OUTPUT_VARIABLE OUTPUT) + IF(GDCM_COMPILER_HAS_FUNCTION) + MESSAGE(STATUS "Checking support for __FUNCTION__ -- yes") + SET(GDCM_COMPILER_HAS_FUNCTION 1 CACHE INTERNAL "Support for extention C __FUNCTION__") + WRITE_FILE(${CMAKE_BINARY_DIR}/CMakeOutput.log + "Determining if the C compiler supports __FUNCTION__ " + "passed with the following output:\n" + "${OUTPUT}\n" APPEND) + ELSE(GDCM_COMPILER_HAS_FUNCTION) + MESSAGE(STATUS "Checking support for __FUNCTION__ -- no") + SET(GDCM_COMPILER_HAS_FUNCTION 0 CACHE INTERNAL "Support for extension C __FUNCTION__") + WRITE_FILE(${CMAKE_BINARY_DIR}/CMakeError.log + "Determining if the C compiler supports __FUNCTION__ " + "failed with the following output:\n" + "${OUTPUT}\n" APPEND) + ENDIF(GDCM_COMPILER_HAS_FUNCTION) +ENDIF("GDCM_COMPILER_HAS_FUNCTION" MATCHES "^GDCM_COMPILER_HAS_FUNCTION$") #----------------------------------------------------------------------------- # Build directory on which many applications depend SUBDIRS( @@ -62,7 +86,7 @@ INCLUDE (${CMAKE_ROOT}/Modules/TestBigEndian.cmake) TEST_BIG_ENDIAN(GDCM_WORDS_BIGENDIAN) INCLUDE (${CMAKE_ROOT}/Modules/CheckIncludeFile.cmake) -CHECK_INCLUDE_FILE("stdint.h" CMAKE_HAVE_STDINT_H) +CHECK_INCLUDE_FILE("stdint.h" GDCM_HAVE_STDINT_H) CONFIGURE_FILE(${GDCM_SOURCE_DIR}/gdcmConfigure.h.in ${GDCM_BINARY_DIR}/gdcmConfigure.h @ONLY IMMEDIATE)