Since the WIN32 thing is such a fundamental part of CMake, I'd guess that there is more to this than what you mention.
Up vote 1 down vote favorite 1 share g+ share fb share tw.
Windows VC++ 2008 linux gcc 4.4.3 I have the following problem. When I compile on windows I need the ws2_32 library. However, when I compile on linux, I don't need to link this.
My CMakeLists. Txt INCLUDE_DIRECTORIES($CLIENT_SERVER_SOURCE_DIR/client) INCLUDE_DIRECTORIES($CLIENT_SERVER_SOURCE_DIR/cltsvr_ults) # Link the library LINK_DIRECTORIES($CLIENT_SERVER_DIR/client) # Add the executable ADD_EXECUTABLE(clt test_clt) # Link the executable to the client library IF(WIN32) TARGET_LINK_LIBRARIES(clt client ws2_32) ENDIF(WIN32) IF(CMAKE_COMPILER_IS_GNUCXXX) TARGET_LINK_LIBRARIES(clt client) ENDIF(CMAKE_COMPILER_IS_GNUCXXX) I have tried unsuccessfully to compile under linux. Using the above conditions.
However, It always tries to link the ws2_32 and I get a compile error. I think that the conditions aren't working, as it always falls through the WIN32 condition. Many thanks for any suggestions, cmake link|improve this question asked 2_320 at 9:07ant20096961060129 94% accept rate.
Since the WIN32 thing is such a fundamental part of CMake, I'd guess that there is more to this than what you mention. Are you doing a clean check out of your code, or just copying up a whole directory on Linux? If you have all your CMake build files cached from the Windows build, maybe (just maybe!
) something has snuck in there and "detects" itself as WIN32 on Linux? Are you sure it is that line and not something else that causes the link to the stray Win-library? Maybe try a MESSAGE(STATUS "I am here")line within the IF(WIN32) just to make sure.
Are you sure the error is caused by linking that library? I can see a typo in your script, it should be IF(CMAKE_COMPILER_IS_GNUCXX) - you have an extra X on there. Perhaps you are not linking in what you thing you are, and that is why it fails.
Yes, you were 100% correct, it was the extra X. Thanks – ant2009 May 6 '10 at 12:29.
I cant really gove you an answer,but what I can give you is a way to a solution, that is you have to find the anglde that you relate to or peaks your interest. A good paper is one that people get drawn into because it reaches them ln some way.As for me WW11 to me, I think of the holocaust and the effect it had on the survivors, their families and those who stood by and did nothing until it was too late.