Permalink
Browse files

Fix build on late versions of cmake 2.4

  • Loading branch information...
1 parent 3dc64ba commit f0f43cf4264c68d638cd5920877d088c6c278435 @Adam- Adam- committed Jul 26, 2013
Showing with 5 additions and 5 deletions.
  1. +1 −1 cmake/Anope.cmake
  2. +4 −4 modules/CMakeLists.txt
View
@@ -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 "")
View
@@ -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})

0 comments on commit f0f43cf

Please sign in to comment.