summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorcyberbotx <cyberbotx@5417fbe8-f217-4b02-8779-1006273d7864>2008-12-21 17:42:39 +0000
committercyberbotx <cyberbotx@5417fbe8-f217-4b02-8779-1006273d7864>2008-12-21 17:42:39 +0000
commit40ec6f0854c2210e670199f701636d9d78ffa6c0 (patch)
tree4f12736acbb0837189fc9d4bf0ab40f0dc6ced16 /src
parent4ef5ab0306a7c452def271bc4a301b0fb850028f (diff)
Some more CMake edits, this allows versions of CMake as early as 2.4.0 to work now.
Also fixed an issue with adding the dl library to the linker flags, reported by Obi_Wan, thanks! git-svn-id: http://anope.svn.sourceforge.net/svnroot/anope/trunk@1857 5417fbe8-f217-4b02-8779-1006273d7864
Diffstat (limited to 'src')
-rw-r--r--src/CMakeLists.txt6
-rw-r--r--src/core/CMakeLists.txt7
-rw-r--r--src/modules/CMakeLists.txt7
-rw-r--r--src/protocol/CMakeLists.txt7
-rw-r--r--src/tools/CMakeLists.txt4
5 files changed, 22 insertions, 9 deletions
diff --git a/src/CMakeLists.txt b/src/CMakeLists.txt
index 8b072a55d..eca0c782b 100644
--- a/src/CMakeLists.txt
+++ b/src/CMakeLists.txt
@@ -6,7 +6,9 @@ set(SRC_SRCS ${SRC_SRCS_C} ${SRC_SRCS_CPP})
if(NOT MSVC)
list(REMOVE_ITEM SRC_SRCS win32_memory.cpp)
endif(NOT MSVC)
-list(SORT SRC_SRCS)
+if(CMAKE244_OR_BETTER)
+ list(SORT SRC_SRCS)
+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}")
@@ -22,7 +24,7 @@ if(WIN32)
# Make sure that the resource file is seen as an RC file to be compiled with a resource compiler, not a C++ compiler
set_source_files_properties(${CMAKE_CURRENT_BINARY_DIR}/win32.rc LANGUAGE RC)
# Add the resource file to the list of sources
- list(APPEND SRC_SRCS ${CMAKE_CURRENT_BINARY_DIR}/win32.rc)
+ append_to_list(SRC_SRCS ${CMAKE_CURRENT_BINARY_DIR}/win32.rc)
# For MinGW, we have to change the compile flags
if(MINGW)
set(RC_CFLAGS "-DMINGW -Ocoff -I${Anope_SOURCE_DIR}/include")
diff --git a/src/core/CMakeLists.txt b/src/core/CMakeLists.txt
index 623f36f3e..904220c06 100644
--- a/src/core/CMakeLists.txt
+++ b/src/core/CMakeLists.txt
@@ -2,7 +2,9 @@
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})
-list(SORT CORE_SRCS)
+if(CMAKE244_OR_BETTER)
+ list(SORT CORE_SRCS)
+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(${CORE_SRCS} PROPERTIES LANGUAGE CXX COMPILE_FLAGS "${MODULE_CXXFLAGS}")
@@ -15,7 +17,8 @@ foreach(SRC ${CORE_SRCS})
calculate_depends(${SRC})
# 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)
- list(APPEND SRC ${Anope_SOURCE_DIR}/src/win32_memory.cpp)
+ append_to_list(SRC ${Anope_SOURCE_DIR}/src/win32_memory.cpp)
+ set_source_files_properties(${Anope_SOURCE_DIR}/src/win32_memory.cpp LANGUAGE CXX COMPILE_FLAGS "${MODULE_CXXFLAGS}")
endif(MSVC)
# Generate the module and set it's linker flags, also set it to depend on the main Anope executable to be built beforehand
add_library(${SO} MODULE ${SRC})
diff --git a/src/modules/CMakeLists.txt b/src/modules/CMakeLists.txt
index f8acaab58..5d9c37cae 100644
--- a/src/modules/CMakeLists.txt
+++ b/src/modules/CMakeLists.txt
@@ -2,7 +2,9 @@
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})
-list(SORT MODULES_SRCS)
+if(CMAKE244_OR_BETTER)
+ list(SORT MODULES_SRCS)
+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(${MODULES_SRCS} PROPERTIES LANGUAGE CXX COMPILE_FLAGS "${MODULE_CXXFLAGS}")
@@ -15,7 +17,8 @@ foreach(SRC ${MODULES_SRCS})
calculate_depends(${SRC})
# 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)
- list(APPEND SRC ${Anope_SOURCE_DIR}/src/win32_memory.cpp)
+ append_to_list(SRC ${Anope_SOURCE_DIR}/src/win32_memory.cpp)
+ set_source_files_properties(${Anope_SOURCE_DIR}/src/win32_memory.cpp LANGUAGE CXX COMPILE_FLAGS "${MODULE_CXXFLAGS}")
endif(MSVC)
# Generate the module and set it's linker flags, also set it to depend on the main Anope executable to be built beforehand
add_library(${SO} MODULE ${SRC})
diff --git a/src/protocol/CMakeLists.txt b/src/protocol/CMakeLists.txt
index 71352d576..50f83409c 100644
--- a/src/protocol/CMakeLists.txt
+++ b/src/protocol/CMakeLists.txt
@@ -2,7 +2,9 @@
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})
-list(SORT PROTOCOL_SRCS)
+if(CMAKE244_OR_BETTER)
+ list(SORT PROTOCOL_SRCS)
+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(${PROTOCOL_SRCS} PROPERTIES LANGUAGE CXX COMPILE_FLAGS "${MODULE_CXXFLAGS}")
@@ -15,7 +17,8 @@ foreach(SRC ${PROTOCOL_SRCS})
calculate_depends(${SRC})
# 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)
- list(APPEND SRC ${Anope_SOURCE_DIR}/src/win32_memory.cpp)
+ append_to_list(APPEND SRC ${Anope_SOURCE_DIR}/src/win32_memory.cpp)
+ set_source_files_properties(${Anope_SOURCE_DIR}/src/win32_memory.cpp LANGUAGE CXX COMPILE_FLAGS "${MODULE_CXXFLAGS}")
endif(MSVC)
# Generate the module and set it's linker flags, also set it to depend on the main Anope executable to be built beforehand
add_library(${SO} MODULE ${SRC})
diff --git a/src/tools/CMakeLists.txt b/src/tools/CMakeLists.txt
index 96fa1c39c..f995de04f 100644
--- a/src/tools/CMakeLists.txt
+++ b/src/tools/CMakeLists.txt
@@ -2,7 +2,9 @@
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})
-list(SORT TOOLS_SRCS)
+if(CMAKE244_OR_BETTER)
+ list(SORT TOOLS_SRCS)
+endif(CMAKE244_OR_BETTER)
# 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}")