diff options
-rw-r--r-- | cmake/Anope.cmake | 22 | ||||
-rw-r--r-- | modules/CMakeLists.txt | 12 | ||||
-rw-r--r-- | src/CMakeLists.txt | 2 | ||||
-rw-r--r-- | src/tools/CMakeLists.txt | 2 |
4 files changed, 21 insertions, 17 deletions
diff --git a/cmake/Anope.cmake b/cmake/Anope.cmake index a9e7f6269..da8a88d54 100644 --- a/cmake/Anope.cmake +++ b/cmake/Anope.cmake @@ -359,12 +359,12 @@ macro(find_includes SRC INCLUDES) endmacro(find_includes) ############################################################################### -# calculate_depends(<source filename> <output variable set to TRUE on fail> [<optional output variable for includes>]) +# calculate_depends(<source filename> <output variable set to TRUE on fail> <TRUE to output error messages> [<optional output variable for includes>]) # # This macro is used in most of the src (sub)directories to calculate the # header file dependencies for the given source file. ############################################################################### -macro(calculate_depends SRC SKIP) +macro(calculate_depends SRC SKIP VERBOSE) # Temporarily set that we didn't get a 3rd argument before we actually check if we did get one or not set(CHECK_ANGLE_INCLUDES FALSE) # Check for a third argument @@ -402,14 +402,16 @@ macro(calculate_depends SRC SKIP) endif(FOUND_DEFAULT) endforeach(DEFAULT_INCLUDE_DIR) if(FOUND_IN_DEFAULTS EQUAL -1) - find_in_list(${ARGV2} "${FOUND_${FILENAME}_INCLUDE}" FOUND_IN_INCLUDES) + find_in_list(${ARGV3} "${FOUND_${FILENAME}_INCLUDE}" FOUND_IN_INCLUDES) if(FOUND_IN_INCLUDES EQUAL -1) - append_to_list(${ARGV2} "${FOUND_${FILENAME}_INCLUDE}") + append_to_list(${ARGV3} "${FOUND_${FILENAME}_INCLUDE}") endif(FOUND_IN_INCLUDES EQUAL -1) endif(FOUND_IN_DEFAULTS EQUAL -1) else(FOUND_${FILENAME}_INCLUDE) set(${SKIP} TRUE) - message("${SRC} needs header file ${FILENAME} but we were unable to locate that header file! Check that the header file is within the search path of your OS.") + if(VERBOSE) + message("${SRC} needs header file ${FILENAME} but we were unable to locate that header file! Check that the header file is within the search path of your OS.") + endif(VERBOSE) endif(FOUND_${FILENAME}_INCLUDE) endif(CHECK_ANGLE_INCLUDES) endif(QUOTE_TYPE STREQUAL "angle brackets") @@ -417,12 +419,12 @@ macro(calculate_depends SRC SKIP) endmacro(calculate_depends) ############################################################################### -# calculate_libraries(<source filename> <output variable set to TRUE on fail> <output variable for linker flags> <output variable for extra depends>) +# calculate_libraries(<source filename> <output variable set to TRUE on fail> <TRUE to output error messages> <output variable for linker flags> <output variable for extra depends>) # # This macro is used in most of the module (sub)directories to calculate the # library dependencies for the given source file. ############################################################################### -macro(calculate_libraries SRC SKIP SRC_LDFLAGS EXTRA_DEPENDS) +macro(calculate_libraries SRC SKIP VERBOSE SRC_LDFLAGS EXTRA_DEPENDS) # Set up a temporary LDFLAGS for this file set(THIS_LDFLAGS "${LDFLAGS}") # Reset extra dependencies @@ -464,8 +466,10 @@ macro(calculate_libraries SRC SKIP SRC_LDFLAGS EXTRA_DEPENDS) else(FOUND_${LIBRARY}_LIBRARY) # Skip this file set(${SKIP} TRUE) - # In the case of the library not being found, we fatally error so CMake stops trying to generate - message("${SRC} needs library ${LIBRARY} but we were unable to locate that library! Check that the library is within the search path of your OS.") + if(VERBOSE) + # In the case of the library not being found, we fatally error so CMake stops trying to generate + message(FATAL_ERROR "${SRC} needs library ${LIBRARY} but we were unable to locate that library! Check that the library is within the search path of your OS.") + endif(VERBOSE) endif(FOUND_${LIBRARY}_LIBRARY) endforeach(LIBRARY) endforeach(REQUIRED_LIBRARY) diff --git a/modules/CMakeLists.txt b/modules/CMakeLists.txt index b49b53d37..e1adec666 100644 --- a/modules/CMakeLists.txt +++ b/modules/CMakeLists.txt @@ -42,7 +42,7 @@ foreach(MODULE_FOLDER ${MODULES_FOLDERS}) # Temporary variable for the current source's include directories set(TEMP_INCLUDES) # Calculate the header file dependencies for the given source file - calculate_depends(${SRC} SKIP_DEPENDS TEMP_INCLUDES) + calculate_depends(${SRC} SKIP_DEPENDS FALSE TEMP_INCLUDES) # If there were some extra include directories, add them to the list if(TEMP_INCLUDES) append_to_list(EXTRA_INCLUDES ${TEMP_INCLUDES}) @@ -54,7 +54,7 @@ foreach(MODULE_FOLDER ${MODULES_FOLDERS}) # Reset skip_libraries set(SKIP_LIBRARIES) # Calculate the library dependencies for the given source file - calculate_libraries(${SRC} SKIP_LIBRARIES TEMP_LDFLAGS TEMP_DEPENDENCIES) + calculate_libraries(${SRC} SKIP_LIBRARIES FALSE TEMP_LDFLAGS TEMP_DEPENDENCIES) if(NOT SKIP_DEPENDS AND NOT SKIP_LIBRARIES) # Reset has_function set(HAS_FUNCTION) @@ -95,7 +95,7 @@ foreach(MODULE_FOLDER ${MODULES_FOLDERS}) ) endif(HAS_FUNCTION) else(NOT SKIP_DEPENDS AND NOT SKIP_LIBRARIES) - message(" This is not a fatal error - ${SRC} will not be built.") + message(" ${SRC} can not be built due to missing dependencies.") endif(NOT SKIP_DEPENDS AND NOT SKIP_LIBRARIES) endforeach(SRC) @@ -138,7 +138,7 @@ foreach(MODULE_FOLDER ${MODULES_FOLDERS}) # Temporary variable for the current source's include directories set(TEMP_INCLUDES) # Calculate the header file dependencies for the given source file - calculate_depends(${SRC} SKIP_DEPENDS TEMP_INCLUDES) + calculate_depends(${SRC} SKIP_DEPENDS FALSE TEMP_INCLUDES) # If there were some extra include directories, add them to the list if(TEMP_INCLUDES) append_to_list(EXTRA_INCLUDES ${TEMP_INCLUDES}) @@ -148,7 +148,7 @@ foreach(MODULE_FOLDER ${MODULES_FOLDERS}) # Reset extra dependencies set(TEMP_DEPENDENCIES) # Calculate the library dependencies for the given source file - calculate_libraries(${SRC} SKIP_LIBRARIES TEMP_LDFLAGS TEMP_DEPENDENCIES) + calculate_libraries(${SRC} SKIP_LIBRARIES FALSE TEMP_LDFLAGS TEMP_DEPENDENCIES) # Check the function dependencies for the given source file check_functions(${SRC} HAS_FUNCTION) @@ -195,7 +195,7 @@ foreach(MODULE_FOLDER ${MODULES_FOLDERS}) DESTINATION ${LIB_DIR}/modules ) else(NOT SKIP_DEPENDS AND NOT SKIP_LIBRARIES AND HAS_FUNCTION) - message(" This is not a fatal error - ${SUBDIR} will not be built.") + message(" ${SRC} can not be built due to missing dependencies.") endif(NOT SKIP_DEPENDS AND NOT SKIP_LIBRARIES AND HAS_FUNCTION) # Run the directories CMakeLists.txt if there is one diff --git a/src/CMakeLists.txt b/src/CMakeLists.txt index 13a88bf51..f1f383397 100644 --- a/src/CMakeLists.txt +++ b/src/CMakeLists.txt @@ -47,7 +47,7 @@ foreach(SRC ${SRC_SRCS}) # Create unused skip variable set(SKIP) # Calculate the header file dependencies for the given source file - calculate_depends(${SRC} SKIP TEMP_INCLUDES) + calculate_depends(${SRC} SKIP TRUE TEMP_INCLUDES) # If there were some extra include directories, add them to the list if(TEMP_INCLUDES) append_to_list(EXTRA_INCLUDES ${TEMP_INCLUDES}) diff --git a/src/tools/CMakeLists.txt b/src/tools/CMakeLists.txt index c69c2fa7d..88fc37ffc 100644 --- a/src/tools/CMakeLists.txt +++ b/src/tools/CMakeLists.txt @@ -12,7 +12,7 @@ foreach(SRC ${TOOLS_SRCS}) # Create skip variable set(SKIP) # Calculate the header file dependencies for the given source file - calculate_depends(${SRC} SKIP) + calculate_depends(${SRC} SKIP TRUE) # Only continue if this file isn't skipped if(NOT SKIP) # Generate the executable and set its linker flags, also set it to depend on the main Anope executable to be built beforehand |