summaryrefslogtreecommitdiff
path: root/CMakeLists.txt
diff options
context:
space:
mode:
authorNaram Qashat <cyberbotx@cyberbotx.com>2012-09-22 03:45:51 -0400
committerNaram Qashat <cyberbotx@cyberbotx.com>2012-09-22 03:45:51 -0400
commitd30e53ee2c87ae1fdeb276a3a79b82370e36f7b0 (patch)
treeac91b0af2a4bc98b9c83cdca3e3a57032dbcd513 /CMakeLists.txt
parentaa57ad608235fa86dec794beaac50fa0f78bf4cb (diff)
OK, so the FIND sub-command of string() in CMake was only added with 2.8.5, change this to use the REGEX sub-commands instead. Also while I'm at it, make -pthread only get added when not on Mac OS X, it's auto-included there.
Diffstat (limited to 'CMakeLists.txt')
-rw-r--r--CMakeLists.txt9
1 files changed, 4 insertions, 5 deletions
diff --git a/CMakeLists.txt b/CMakeLists.txt
index 5e0da5f0e..3590cf986 100644
--- a/CMakeLists.txt
+++ b/CMakeLists.txt
@@ -133,10 +133,7 @@ if(CMAKE_COMPILER_IS_GNUCXX)
math(EXPR LINE_LENGTH "${LINE_LENGTH} - 1")
string(SUBSTRING ${LINE} 1 ${LINE_LENGTH} INCLUDE)
# For systems like Mac OS X, look for include paths that say " (framework directory)" at the end of them and strip that off
- string(FIND ${INCLUDE} " (framework directory)" FRAMEWORK)
- if(NOT FRAMEWORK EQUAL -1)
- string(SUBSTRING ${INCLUDE} 0 ${FRAMEWORK} INCLUDE)
- endif(NOT FRAMEWORK EQUAL -1)
+ string(REGEX REPLACE " \\(framework directory\\)$" "" INCLUDE ${INCLUDE})
# Convert the path to an absolute one, just in case it wasn't
get_filename_component(INCLUDE ${INCLUDE} ABSOLUTE)
# Add that directory to the list of default include directories
@@ -313,7 +310,9 @@ if(NOT MSVC)
# Check if pthread_create is within the pthread library (if the library exists), and add it to the linker flags if needed
check_library_exists(pthread pthread_create "" HAVE_PTHREAD)
if(HAVE_PTHREAD)
- set(LDFLAGS "${LDFLAGS} -pthread")
+ if(NOT APPLE)
+ set(LDFLAGS "${LDFLAGS} -pthread")
+ endif(NOT APPLE)
else(HAVE_PTHREAD)
message(FATAL_ERROR "The pthread library is required to build Anope")
endif(HAVE_PTHREAD)