summaryrefslogtreecommitdiff
path: root/CMakeLists.txt
diff options
context:
space:
mode:
authorNaram Qashat <cyberbotx@cyberbotx.com>2011-11-20 18:41:46 -0500
committerNaram Qashat <cyberbotx@cyberbotx.com>2011-11-20 18:41:46 -0500
commit51d6e8ebfbacdbae659dde213c619024e86bf73d (patch)
tree33de6532a1775c345d3042b19fc9ec74c82d416e /CMakeLists.txt
parent3f148829927a9ce02be474d35e38d25f8d963aaa (diff)
CMake handles strings and lists differently, so this should hopefully finally fix the linking issue.
Diffstat (limited to 'CMakeLists.txt')
-rw-r--r--CMakeLists.txt10
1 files changed, 3 insertions, 7 deletions
diff --git a/CMakeLists.txt b/CMakeLists.txt
index 18e0f9177..b9a869012 100644
--- a/CMakeLists.txt
+++ b/CMakeLists.txt
@@ -261,7 +261,7 @@ endif(MSVC)
# If CMake has found that the given system requires a special library for dl* calls, include it with the linker flags
if(CMAKE_DL_LIBS)
- set(LINK_LIBS "${LINK_LIBS} ${CMAKE_DL_LIBS}")
+ append_to_list(LINK_LIBS ${CMAKE_DL_LIBS})
endif(CMAKE_DL_LIBS)
# Under MinGW, the -shared flag isn't properly set in the module-specific linker flags, add it from the C flags for shared libraries
@@ -297,12 +297,12 @@ if(NOT MSVC)
# Check if socket is within the socket library (if the library exists), and add it to the linker flags if needed
check_library_exists(socket socket "" HAVE_SOCKET_LIB)
if(HAVE_SOCKET_LIB)
- set(LINK_LIBS "${LINK_LIBS} socket")
+ append_to_list(LINK_LIBS socket)
endif(HAVE_SOCKET_LIB)
# Check if inet_addr is within the nsl library (if the library exists), and add it to the linker flags if needed
check_library_exists(nsl inet_addr "" HAVE_NSL_LIB)
if(HAVE_NSL_LIB)
- set(LINK_LIBS "${LINK_LIBS} nsl")
+ append_to_list(LINK_LIBS nsl)
endif(HAVE_NSL_LIB)
# 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)
@@ -357,10 +357,6 @@ endif(CXXFLAGS)
if(LDFLAGS)
strip_string(${LDFLAGS} LDFLAGS)
endif(LDFLAGS)
-# Strip the leading and trailing spaces from the link libraries
-if(LINK_LIBS)
- strip_string(${LINK_LIBS} LINK_LIBS)
-endif(LINK_LIBS)
# Search for the following programs
find_program(GREP grep)