summaryrefslogtreecommitdiff
path: root/src/protocol
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/protocol
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/protocol')
-rw-r--r--src/protocol/CMakeLists.txt17
1 files changed, 16 insertions, 1 deletions
diff --git a/src/protocol/CMakeLists.txt b/src/protocol/CMakeLists.txt
index dc8d40126..c903545c3 100644
--- a/src/protocol/CMakeLists.txt
+++ b/src/protocol/CMakeLists.txt
@@ -14,12 +14,21 @@ endif(WIN32)
# 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(${PROTOCOL_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 ${PROTOCOL_SRCS})
# Convert the source file extension to have a .so extension
string(REGEX REPLACE "\\.(c|cpp)$" ".so" SO ${SRC})
+ # 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)
# For Visual Studio only, include win32_memory.cpp to the list of sources, required to override Visual Studio's overrides of the new/delete operators
if(MSVC)
append_to_list(SRC ${Anope_SOURCE_DIR}/src/win32_memory.cpp)
@@ -39,3 +48,9 @@ foreach(SRC ${PROTOCOL_SRCS})
DESTINATION data/modules
)
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)