summaryrefslogtreecommitdiff
path: root/CMakeLists.txt
diff options
context:
space:
mode:
authorNaram Qashat <cyberbotx@cyberbotx.com>2011-11-20 16:09:59 -0500
committerNaram Qashat <cyberbotx@cyberbotx.com>2011-11-20 16:09:59 -0500
commitbf8e4ac71484cfe30bcddd02cb91900875dc34b2 (patch)
tree542b131260c6ffd38a98d1ce28a67ff892840c8b /CMakeLists.txt
parent781ed11ba82dddac72976bd271adc44314a0221f (diff)
Attempt to fix where link libraries are set when compiling to fix failed builds on systems that require -ldl.
Diffstat (limited to 'CMakeLists.txt')
-rw-r--r--CMakeLists.txt6
1 files changed, 3 insertions, 3 deletions
diff --git a/CMakeLists.txt b/CMakeLists.txt
index 770a7d1ce..0249d831e 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(LDFLAGS "${LDFLAGS} -l${CMAKE_DL_LIBS}")
+ set(LINK_LIBS "${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(LDFLAGS "${LDFLAGS} -lsocket")
+ set(LINK_LIBS "${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(LDFLAGS "${LDFLAGS} -lnsl")
+ set(LINK_LIBS "${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)