summaryrefslogtreecommitdiff
path: root/src/CMakeLists.txt
diff options
context:
space:
mode:
authorcyberbotx <cyberbotx@5417fbe8-f217-4b02-8779-1006273d7864>2009-03-02 01:33:47 +0000
committercyberbotx <cyberbotx@5417fbe8-f217-4b02-8779-1006273d7864>2009-03-02 01:33:47 +0000
commitc6f4b951317ad3c78844359742de66ce63210ef0 (patch)
treea990f1aea84132625830d3cca72c454dd7fb0dae /src/CMakeLists.txt
parent6794273f7d44987b061f038bc3c7909fa64a86d5 (diff)
Added a strip_string function to Anope.cmake, cleaned up other parts of Anope.cmake, added better find function for #include lines, added functionality for CMake to auto-detect includes in non-standard locations.
git-svn-id: http://anope.svn.sourceforge.net/svnroot/anope/trunk@2139 5417fbe8-f217-4b02-8779-1006273d7864
Diffstat (limited to 'src/CMakeLists.txt')
-rw-r--r--src/CMakeLists.txt15
1 files changed, 14 insertions, 1 deletions
diff --git a/src/CMakeLists.txt b/src/CMakeLists.txt
index 6e700db49..d1cc3d832 100644
--- a/src/CMakeLists.txt
+++ b/src/CMakeLists.txt
@@ -17,11 +17,24 @@ endif(CMAKE244_OR_BETTER)
# Set all the files to use C++ as well as set their compile flags (use the module-specific compile flags, though)
set_source_files_properties(${SRC_SRCS} PROPERTIES LANGUAGE CXX COMPILE_FLAGS "${CXXFLAGS}")
+# Create an empty list to store extra include directories
+set(EXTRA_INCLUDES)
# Iterate through all the source files
foreach(SRC ${SRC_SRCS})
+ # 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})
+ calculate_depends(${SRC} TEMP_INCLUDES)
+ # If there were some extra include directories, add them to the list
+ if(TEMP_INCLUDES)
+ append_to_list(EXTRA_INCLUDES ${TEMP_INCLUDES})
+ endif(TEMP_INCLUDES)
endforeach(SRC)
+# If there were extra include directories, remove the duplicates and add the directories to the include path
+if(EXTRA_INCLUDES)
+ remove_list_duplicates(EXTRA_INCLUDES)
+ include_directories(${EXTRA_INCLUDES})
+endif(EXTRA_INCLUDES)
# Under Windows, we also include a resource file to the build
if(WIN32)