summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAdam <Adam@anope.org>2013-07-26 12:57:36 -0400
committerAdam <Adam@anope.org>2013-07-26 12:57:36 -0400
commitf0f43cf4264c68d638cd5920877d088c6c278435 (patch)
tree0e6a607639f61ff8bef6d51a6a137ea0f93329a1
parent3dc64bac4d436ba27683270b88c0cc5bfa346acc (diff)
Fix build on late versions of cmake 2.4
-rw-r--r--cmake/Anope.cmake2
-rw-r--r--modules/CMakeLists.txt8
2 files changed, 5 insertions, 5 deletions
diff --git a/cmake/Anope.cmake b/cmake/Anope.cmake
index b4eadf279..587e32980 100644
--- a/cmake/Anope.cmake
+++ b/cmake/Anope.cmake
@@ -208,7 +208,7 @@ macro(read_from_file FILE REGEX STRINGS)
endif(REGEX STREQUAL "")
else(CMAKE26_OR_BETTER)
# For CMake 2.4.x, we need to do this manually, firstly we read the file in
- execute_process(COMMAND ${CMAKE_COMMAND} -DFILE:STRING=${FILE} -P ${Anope_SOURCE_DIR}/ReadFile.cmake ERROR_VARIABLE ALL_STRINGS)
+ execute_process(COMMAND ${CMAKE_COMMAND} -DFILE:STRING=${FILE} -P ${Anope_SOURCE_DIR}/cmake/ReadFile.cmake ERROR_VARIABLE ALL_STRINGS)
# Next we replace all newlines with semicolons
string(REGEX REPLACE "\n" ";" ALL_STRINGS ${ALL_STRINGS})
if(REGEX STREQUAL "")
diff --git a/modules/CMakeLists.txt b/modules/CMakeLists.txt
index 1e503d1c3..e9afbf45b 100644
--- a/modules/CMakeLists.txt
+++ b/modules/CMakeLists.txt
@@ -3,7 +3,7 @@ if(WIN32)
add_definitions(-DMODULE_COMPILE)
endif(WIN32)
-function(build_modules SRC)
+macro(build_modules SRC)
if(NOT ${SRC} STREQUAL ${CMAKE_CURRENT_SOURCE_DIR} AND EXISTS "${SRC}/CMakeLists.txt")
add_subdirectory("${SRC}")
else(NOT ${SRC} STREQUAL ${CMAKE_CURRENT_SOURCE_DIR} AND EXISTS "${SRC}/CMakeLists.txt")
@@ -76,9 +76,9 @@ function(build_modules SRC)
endif(IS_DIRECTORY "${MODULE_SRC}")
endforeach(MODULE_SRC ${MODULES_SRCS})
endif(NOT ${SRC} STREQUAL ${CMAKE_CURRENT_SOURCE_DIR} AND EXISTS "${SRC}/CMakeLists.txt")
-endfunction(build_modules)
+endmacro(build_modules)
-function(build_subdir)
+macro(build_subdir)
file(GLOB_RECURSE MODULES_SUBDIR_SRCS RELATIVE ${CMAKE_CURRENT_SOURCE_DIR} "*.cpp")
sort_list(MODULES_SUBDIR_SRCS)
@@ -159,7 +159,7 @@ function(build_subdir)
install(TARGETS ${SO} DESTINATION ${LIB_DIR}/modules)
endif(HAS_FUNCTION)
-endfunction(build_subdir)
+endmacro(build_subdir)
include_directories(${CMAKE_CURRENT_SOURCE_DIR})
build_modules(${CMAKE_CURRENT_SOURCE_DIR})