Skip to content
Snippets Groups Projects
Commit 39623d1a authored by Emmanuel Christophe's avatar Emmanuel Christophe
Browse files

COMP: replace try_run by add_custom_command

parent 0e097c63
No related branches found
No related tags found
No related merge requests found
...@@ -15,7 +15,7 @@ CHECK_INCLUDE_FILE("dbmalloc.h" CMAKE_HAVE_DBMALLOC_H) ...@@ -15,7 +15,7 @@ CHECK_INCLUDE_FILE("dbmalloc.h" CMAKE_HAVE_DBMALLOC_H)
CHECK_INCLUDE_FILE("malloc.h" CMAKE_HAVE_MALLOC_H) CHECK_INCLUDE_FILE("malloc.h" CMAKE_HAVE_MALLOC_H)
CHECK_INCLUDE_FILE("dlfcn.h" CMAKE_HAVE_DLFCN_H) CHECK_INCLUDE_FILE("dlfcn.h" CMAKE_HAVE_DLFCN_H)
# itkjpeg headers are not generated and put into the include dir automatically. # itkjpeg headers are not generated and put into the include dir automatically.
# Therefore we have to do it ourselves. # Therefore we have to do it ourselves.
IF(OTB_USE_EXTERNAL_ITK) IF(OTB_USE_EXTERNAL_ITK)
...@@ -58,24 +58,31 @@ CONFIGURE_FILE(${OTB_SOURCE_DIR}/Utilities/otbossim/include/ossim/ossimConfig.h. ...@@ -58,24 +58,31 @@ CONFIGURE_FILE(${OTB_SOURCE_DIR}/Utilities/otbossim/include/ossim/ossimConfig.h.
${OTB_BINARY_DIR}/Utilities/otbossim/include/ossim/ossimConfig.h) ${OTB_BINARY_DIR}/Utilities/otbossim/include/ossim/ossimConfig.h)
# Run ossim/version-config.cpp taht will generate ossim/ossimVersion.h file nedeed to compile OSSIM # Run ossim/version-config.cpp taht will generate ossim/ossimVersion.h file nedeed to compile OSSIM
SET(INCLUDES_OSSIM_TRY_RUN "-DINCLUDE_DIRECTORIES:STRING=${OTB_BINARY_DIR}/Utilities/otbossim/include" ) # SET(INCLUDES_OSSIM_TRY_RUN "-DINCLUDE_DIRECTORIES:STRING=${OTB_BINARY_DIR}/Utilities/otbossim/include" )
TRY_RUN(RUN_RESULT_VAR COMPILE_RESULT_VAR # TRY_RUN(RUN_RESULT_VAR COMPILE_RESULT_VAR
${OTB_BINARY_DIR} # ${OTB_BINARY_DIR}
${OTB_SOURCE_DIR}/Utilities/otbossim/src/ossim/version-config.cpp # ${OTB_SOURCE_DIR}/Utilities/otbossim/src/ossim/version-config.cpp
CMAKE_FLAGS "${INCLUDES_OSSIM_TRY_RUN}" # CMAKE_FLAGS "${INCLUDES_OSSIM_TRY_RUN}"
OUTPUT_VARIABLE output # OUTPUT_VARIABLE output
ARGS "${OTB_BINARY_DIR}/Utilities/otbossim/include/ossim/ossimVersion.h" # ARGS "${OTB_BINARY_DIR}/Utilities/otbossim/include/ossim/ossimVersion.h"
) # )
add_executable(version-config ${OTB_SOURCE_DIR}/Utilities/otbossim/src/ossim/version-config.cpp)
IF(NOT COMPILE_RESULT_VAR) add_custom_command(
MESSAGE(FATAL_ERROR "OSSIM : cannot compile version-config.cpp") OUTPUT ${OTB_BINARY_DIR}/Utilities/otbossim/include/ossim/ossimVersion.h
ENDIF(NOT COMPILE_RESULT_VAR) DEPENDS version-config
COMMAND version-config
ARGS "${OTB_BINARY_DIR}/Utilities/otbossim/include/ossim/ossimVersion.h"
)
# IF(NOT COMPILE_RESULT_VAR)
# MESSAGE(FATAL_ERROR "OSSIM : cannot compile version-config.cpp")
# ENDIF(NOT COMPILE_RESULT_VAR)
# IF(RUN_RESULT_VAR)
# MESSAGE(FATAL_ERROR "OSSIM : cannot create ossimVersion.h file")
# ENDIF(RUN_RESULT_VAR)
IF(RUN_RESULT_VAR)
MESSAGE(FATAL_ERROR "OSSIM : cannot create ossimVersion.h file")
ENDIF(RUN_RESULT_VAR)
SUBDIRS(include) SUBDIRS(include)
# ADDED BY OTB DEVELOPPERS TO AVOID INTENSIVE RECOMPILATION # ADDED BY OTB DEVELOPPERS TO AVOID INTENSIVE RECOMPILATION
IF(NOT OTB_DISABLE_UTILITIES_COMPILATION) IF(NOT OTB_DISABLE_UTILITIES_COMPILATION)
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment