diff options
author | cyberbotx <cyberbotx@5417fbe8-f217-4b02-8779-1006273d7864> | 2009-03-11 20:10:00 +0000 |
---|---|---|
committer | cyberbotx <cyberbotx@5417fbe8-f217-4b02-8779-1006273d7864> | 2009-03-11 20:10:00 +0000 |
commit | 29b9577bd2846611efb732cc134e5c84956225b8 (patch) | |
tree | 78d6b4410748737b20824c80ae0a78f777ad6e2f /src | |
parent | 174bb94648eb9927255bed79f0ec09da4fbfd4d9 (diff) |
Fix the CMake generation to work with older versions of CMake 2.4.x, cleaning up some of the macros and also correcting the code to detect what version of CMake is in use.
git-svn-id: http://anope.svn.sourceforge.net/svnroot/anope/trunk@2155 5417fbe8-f217-4b02-8779-1006273d7864
Diffstat (limited to 'src')
-rw-r--r-- | src/CMakeLists.txt | 8 | ||||
-rw-r--r-- | src/core/CMakeLists.txt | 4 | ||||
-rw-r--r-- | src/modules/CMakeLists.txt | 4 | ||||
-rw-r--r-- | src/protocol/CMakeLists.txt | 4 | ||||
-rw-r--r-- | src/tools/CMakeLists.txt | 4 | ||||
-rw-r--r-- | src/win32_memory.cpp | 4 |
6 files changed, 11 insertions, 17 deletions
diff --git a/src/CMakeLists.txt b/src/CMakeLists.txt index d1cc3d832..9641a4ad2 100644 --- a/src/CMakeLists.txt +++ b/src/CMakeLists.txt @@ -4,15 +4,13 @@ file(GLOB SRC_SRCS_CPP RELATIVE ${CMAKE_CURRENT_SOURCE_DIR} "*.cpp") set(SRC_SRCS ${SRC_SRCS_C} ${SRC_SRCS_CPP}) # If not using Visual Studio, don't include win32_memory.cpp, it's only required by Visual Studio to override it's override of the new/delete operators if(NOT MSVC) - list(REMOVE_ITEM SRC_SRCS win32_memory.cpp) + remove_item_from_list(SRC_SRCS win32_memory.cpp) endif(NOT MSVC) # If not using Windows, don't include windows.cpp, as it's Windows-specific if(NOT WIN32) - list(REMOVE_ITEM SRC_SRCS windows.cpp) + remove_item_from_list(SRC_SRCS windows.cpp) endif(NOT WIN32) -if(CMAKE244_OR_BETTER) - list(SORT SRC_SRCS) -endif(CMAKE244_OR_BETTER) +sort_list(SRC_SRCS) # 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}") diff --git a/src/core/CMakeLists.txt b/src/core/CMakeLists.txt index ba1032f72..7aa474743 100644 --- a/src/core/CMakeLists.txt +++ b/src/core/CMakeLists.txt @@ -2,9 +2,7 @@ file(GLOB CORE_SRCS_C RELATIVE ${CMAKE_CURRENT_SOURCE_DIR} "*.c") file(GLOB CORE_SRCS_CPP RELATIVE ${CMAKE_CURRENT_SOURCE_DIR} "*.cpp") set(CORE_SRCS ${CORE_SRCS_C} ${CORE_SRCS_CPP}) -if(CMAKE244_OR_BETTER) - list(SORT CORE_SRCS) -endif(CMAKE244_OR_BETTER) +sort_list(CORE_SRCS) # If using Windows, add the MODULE_COMPILE define if(WIN32) diff --git a/src/modules/CMakeLists.txt b/src/modules/CMakeLists.txt index 65959b174..21b35c0b3 100644 --- a/src/modules/CMakeLists.txt +++ b/src/modules/CMakeLists.txt @@ -2,9 +2,7 @@ file(GLOB MODULES_SRCS_C RELATIVE ${CMAKE_CURRENT_SOURCE_DIR} "*.c") file(GLOB MODULES_SRCS_CPP RELATIVE ${CMAKE_CURRENT_SOURCE_DIR} "*.cpp") set(MODULES_SRCS ${MODULES_SRCS_C} ${MODULES_SRCS_CPP}) -if(CMAKE244_OR_BETTER) - list(SORT MODULES_SRCS) -endif(CMAKE244_OR_BETTER) +sort_list(MODULES_SRCS) # If using Windows, add the MODULE_COMPILE define if(WIN32) diff --git a/src/protocol/CMakeLists.txt b/src/protocol/CMakeLists.txt index c903545c3..fda2a9d90 100644 --- a/src/protocol/CMakeLists.txt +++ b/src/protocol/CMakeLists.txt @@ -2,9 +2,7 @@ file(GLOB PROTOCOL_SRCS_C RELATIVE ${CMAKE_CURRENT_SOURCE_DIR} "*.c") file(GLOB PROTOCOL_SRCS_CPP RELATIVE ${CMAKE_CURRENT_SOURCE_DIR} "*.cpp") set(PROTOCOL_SRCS ${PROTOCOL_SRCS_C} ${PROTOCOL_SRCS_CPP}) -if(CMAKE244_OR_BETTER) - list(SORT PROTOCOL_SRCS) -endif(CMAKE244_OR_BETTER) +sort_list(PROTOCOL_SRCS) # If using Windows, add the MODULE_COMPILE define if(WIN32) diff --git a/src/tools/CMakeLists.txt b/src/tools/CMakeLists.txt index 6ac5d76a9..286b11945 100644 --- a/src/tools/CMakeLists.txt +++ b/src/tools/CMakeLists.txt @@ -2,9 +2,7 @@ file(GLOB TOOLS_SRCS_C RELATIVE ${CMAKE_CURRENT_SOURCE_DIR} "*.c") file(GLOB TOOLS_SRCS_CPP RELATIVE ${CMAKE_CURRENT_SOURCE_DIR} "*.cpp") set(TOOLS_SRCS ${TOOLS_SRCS_C} ${TOOLS_SRCS_CPP}) -if(CMAKE244_OR_BETTER) - list(SORT TOOLS_SRCS) -endif(CMAKE244_OR_BETTER) +sort_list(TOOLS_SRCS) # Set all the files to use C++ as well as set their compile flags set_source_files_properties(${TOOLS_SRCS} PROPERTIES LANGUAGE CXX COMPILE_FLAGS "${CXXFLAGS}") diff --git a/src/win32_memory.cpp b/src/win32_memory.cpp index ba7826240..9da1b7812 100644 --- a/src/win32_memory.cpp +++ b/src/win32_memory.cpp @@ -11,6 +11,8 @@ * --------------------------------------------------- */ +#ifdef _WIN32 + #include <windows.h> #include <exception> #include <new> @@ -55,3 +57,5 @@ void operator delete[](void *ptr) { HeapFree(GetProcessHeap(), 0, ptr); } + +#endif |