Bill Greene<[email protected]>  wrote:

add_library (cmTestLib STATIC MySub.cpp MySub.h)
You need not include the header files in an add_library call. They'll be found by the compiler, provided you have included them in the cpp files.

If I understand your problem correctly, I fear you may be trying to use a sledgehammer to crack a peanut!

Try this:

        add_library (cmTestLib STATIC MySub.cpp)

        add_executable(cmTestMain cmTestMain.cpp)

        # Make sure the library is up to date
        add_dependencies(cmTestMain cmTestLib)

        # Add lib to the link line
        target_link_libraries(cmTestMain cmTestLib)

Cheers,
Jim

--
Jim Butler
Build Systems Engineer
Limit Point Systems, Inc.
http://cmake.limitpoint.com
--

Powered by www.kitware.com

Please keep messages on-topic and check the CMake FAQ at: 
http://www.cmake.org/Wiki/CMake_FAQ

Kitware offers various services to support the CMake community. For more 
information on each offering, please visit:

CMake Support: http://cmake.org/cmake/help/support.html
CMake Consulting: http://cmake.org/cmake/help/consulting.html
CMake Training Courses: http://cmake.org/cmake/help/training.html

Visit other Kitware open-source projects at 
http://www.kitware.com/opensource/opensource.html

Follow this link to subscribe/unsubscribe:
http://public.kitware.com/mailman/listinfo/cmake

Reply via email to