Hi,

I'm trying to build a trivial project with cmake 3.0 and Visual Studio 2013.
The project has a top-level directory, a sub-directory with the main
program,
and a sub-directory that builds a static library that the main program
depends on.
It all builds fine the first time. Then I change a routine in the library
and rebuild.
The static library gets rebuilt but the main program does not get re-linked.

I have perused the cmake-built VS project for hours and it looks fine to
me; the
main program depends on the library as expected. I can't figure out why the
main
program is not being rebuilt.

More embarrassing, I can easily build a similar VS project by hand that
behaves as
expected but I can' find the significant difference between the two that is
causing the
problematic behavior.

If anyone has any insights on this I would be very appreciative.

Here are my three CMakeLists.txt files:

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

cmTestLib
--------------
FILE(GLOB SRC *.cpp)
FILE(GLOB H_FILES *.h)
add_library (cmTestLib STATIC ${SRC} ${H_FILES})

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

Thanks.

Bill
-- 

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