I am trying to use ADD_LIBRARY to create a .lib file from a collection
of .cpp and .h files.
If I do:
ADD_LIBRARY(LibraryName AllOfTheCPPFiles.cpp)
and then try to link against that library, I get many missing-function
type linker errors. I looked in the .h files and many of them have
actual function definitions:
(an example):
class UdpTransmitSocket : public UdpSocket{
public:
UdpTransmitSocket( const IpEndpointName& remoteEndpoint )
{ Connect( remoteEndpoint ); }
};
I tried to tell CMake to compile the .h files into the library as well
by doing this:
set(CMAKE_CXX_SOURCE_FILE_EXTENSIONS ${CMAKE_CXX_SOURCE_FILE_EXTENSIONS} h)
ADD_LIBRARY(LibraryName AllOfTheCPPFiles.cpp AllOfTheHFiles.h)
but it didn't seem to change anything. Is there a way this is typically handled?
Thanks,
David
_______________________________________________
Powered by www.kitware.com
Visit other Kitware open-source projects at
http://www.kitware.com/opensource/opensource.html
Please keep messages on-topic and check the CMake FAQ at:
http://www.cmake.org/Wiki/CMake_FAQ
Follow this link to subscribe/unsubscribe:
http://www.cmake.org/mailman/listinfo/cmake