Skip to content

Commit

Permalink
Review DETERMINE_TYPE vxl macro
Browse files Browse the repository at this point in the history
  • Loading branch information
jcfr committed May 7, 2011
1 parent 8b892f8 commit f1fe0ad
Showing 1 changed file with 5 additions and 10 deletions.
15 changes: 5 additions & 10 deletions Utilities/vxl/config/cmake/config/vxl_config_macros.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -249,23 +249,18 @@ MACRO( DETERMINE_TYPE VAR INTEGRAL_TYPE SIZE TYPE_LIST )
# line to avoid issues with spaces. (In "long double", for
# example)
WRITE_FILE( ${CMAKE_BINARY_DIR}/CMakeTmp/config.h "#define THE_TYPE ${TYPE}\n#define THE_SIZE ${SIZE}\n#define INTEGRAL_TYPE ${INTEGRAL_TYPE}" )
SET( MACRO_DETERMINE_TYPE_FLAGS "-DVXL_HAS_TYPE_OF_SIZE -I\"${CMAKE_BINARY_DIR}/CMakeTmp\"" )
SET( MACRO_DETERMINE_TYPE_FLAGS "-DVXL_HAS_TYPE_OF_SIZE" )
MESSAGE( STATUS "${MSG} [Checking ${TYPE}...]" )
TRY_RUN( RUN_RESULT COMPILE_RESULT
TRY_COMPILE(COMPILE_RESULT
${CMAKE_BINARY_DIR}
${vxl_config_SOURCE_DIR}/vxl_platform_tests.cxx
CMAKE_FLAGS -DCOMPILE_DEFINITIONS:STRING=${MACRO_DETERMINE_TYPE_FLAGS}
-DINCLUDE_DIRECTORIES:STRING=${CMAKE_BINARY_DIR}/CMakeTmp
-DLINK_LIBRARIES:STRING=${CMAKE_REQUIRED_LIBRARIES}
OUTPUT_VARIABLE OUTPUT )
IF( COMPILE_RESULT )
IF( NOT RUN_RESULT )
SET( VXL_${VAR} ${TYPE} )
SET( VXL_HAS_${VAR} 1 )
ELSE( NOT RUN_RESULT )
WRITE_FILE( ${CMAKE_BINARY_DIR}${CMAKE_FILES_DIRECTORY}/CMakeError.log
"${MSG} Failed to run with the following output:\n(FLAGS=${MACRO_DETERMINE_TYPE_FLAGS})\n${OUTPUT}\n"
APPEND )
ENDIF( NOT RUN_RESULT )
SET( VXL_${VAR} ${TYPE} )
SET( VXL_HAS_${VAR} 1 )
ELSE( COMPILE_RESULT )
WRITE_FILE( ${CMAKE_BINARY_DIR}${CMAKE_FILES_DIRECTORY}/CMakeError.log
"${MSG} Failed to compile with the following output:\n(FLAGS=${MACRO_DETERMINE_TYPE_FLAGS})\n${OUTPUT}\n"
Expand Down

0 comments on commit f1fe0ad

Please sign in to comment.