Bill,

I want to reset this conversation a bit. What you are doing should work no problem. Most of the suggestions should not be needed. I do agree that glob is bad, but it will cause different problems. Anyway, I created the following example based on your posts and it works with VS 2010. Can you try this and report back? This could be a bug in VS as CMake has very little to do with depends like this and the VS IDE.

I did this to test:
$ ls -l b/cmTestMain/Debug/
total 684
-rwxr-xr-x 1 hoffman Domain Users  28160 Oct  6 10:47 cmTestMain.exe

hoffman@quasar ~/Work/dep
$ touch cmTestLib/MySub.cpp

#build from VS IDE and exe relinks
hoffman@quasar ~/Work/dep
$ ls -l b/cmTestMain/Debug/
total 684
-rwxr-xr-x 1 hoffman Domain Users  28160 Oct  6 10:48 cmTestMain.exe


hoffman@quasar ~/Work/dep
$ touch cmTestLib/MySub.h

# build from VS IDE exe relinks again
hoffman@quasar ~/Work/dep
$ ls -l b/cmTestMain/Debug
total 684
-rwxr-xr-x 1 hoffman Domain Users  28160 Oct  6 10:49 cmTestMain.exe




top level:
-----------
cmake_minimum_required (VERSION 2.8)
project(cmTest)
add_subdirectory (cmTestLib)
add_subdirectory (cmTestMain)

cmTestLib
--------------
add_library (cmTestLib STATIC MySub.cpp MySub.h)

------ cmTestLib/MySub.cpp
#include "MySub.h"

int hello()  { return 0;}

----- cmTestLib/MySub.h
int hello();

cmTestMain
----------------
include_directories (${cmTest_SOURCE_DIR}/cmTestLib)
add_executable (cmTestMain cmTestMain.cpp)
target_link_libraries (cmTestMain cmTestLib)


Here are the source files:

------ cmTestLib/MySub.cpp
#include "MySub.h"

int hello()  { return 0;}

----- cmTestLib/MySub.h
int hello();

cmTestMain/cmTestMain.cpp

#include "MySub.h"

int main()
{
  return hello();
}



--

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