On 26/08/11 01:20, Ben Lindstrom wrote :
>
> On Aug 25, 2011, at 6:11 PM, Mike Gilbert wrote:
>
>> On Thu, Aug 25, 2011 at 5:23 PM, Ben Lindstrom <[email protected]> wrote:
>>>
>>> There seems to be an issue with the cmake script and SLES11 SP1.
>>>
>>> I had to make the following hack around:
>>>
>>> $ diff -u ../FreeRDP-FreeRDP-1.0-9b40f80/CMakeLists.txt CMakeLists.txt
>>> --- ../FreeRDP-FreeRDP-1.0-9b40f80/CMakeLists.txt 2011-08-25
>>> 13:11:45.000000000 -0500
>>> +++ CMakeLists.txt 2011-08-25 15:58:23.783759000 -0500
>>> @@ -53,7 +53,8 @@
>>>
>>> # Compiler-specific flags
>>> if(CMAKE_COMPILER_IS_GNUCC)
>>> - set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -Wall
>>> -Wno-unused-but-set-variable")
>>> + #set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -Wall
>>> -Wno-unused-but-set-variable")
>>> + set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -Wall -lncurses")
>>> if(CMAKE_BUILD_TYPE STREQUAL "Release")
>>> set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -O2")
>>> endif()
>>>
>>>
>>>
>>> Removing -Wno-unused-but-set-variable as it was stopping the Bigended and
>>> pthread tests from being successful, and adding the -lncurses was needed
>>> because the cunit 2.1-5.3 shipped by SuSE SLE11 SP1 OBS build requires
>>> ncurses by default.
>>>
>>
>> Just a quick comment: CFLAGS is the wrong place to put options
>> intended for the linker. I'm a bit surprised this actually works for
>> you.
>
> Yes, I'm aware it is the wrong place. =) Since I saw not good sign
> of how one does LD linker variables in a 30 second glance (I know
> autoconf tools not cmake)
usually a cmake target (i.e. a library or an executable) is linked to a lib
using the command "target_link_libraries()"
here's an example patch:
diff --git a/cunit/CMakeLists.txt b/cunit/CMakeLists.txt
index 5b51712..dda5b48 100644
--- a/cunit/CMakeLists.txt
+++ b/cunit/CMakeLists.txt
@@ -70,5 +70,6 @@ target_link_libraries(test_freerdp freerdp-gdi)
target_link_libraries(test_freerdp freerdp-utils)
target_link_libraries(test_freerdp freerdp-chanman)
target_link_libraries(test_freerdp freerdp-rfx)
+target_link_libraries(test_freerdp ncurses)
add_test(CUnitTests ${EXECUTABLE_OUTPUT_PATH}/test_freerdp)
note that in cmake one usually links to the "name" part of "libname.so" (here
"ncurses", as in "libncurses.so") as opposed to the usual "-lname" flag in gcc.
You can also use:
target_link_libraries(test_freerdp libncurses.so)
but it is not the "recommended way"
Alexis
------------------------------------------------------------------------------
EMC VNX: the world's simplest storage, starting under $10K
The only unified storage solution that offers unified management
Up to 160% more powerful than alternatives and 25% more efficient.
Guaranteed. http://p.sf.net/sfu/emc-vnx-dev2dev
_______________________________________________
Freerdp-devel mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/freerdp-devel