This test has been performed on Windows 7 SP1 (64bit) and using CMake 2.8.12.1 
and VS2005 SP1.
 
Here is the source code used (which does not use the Boost library).
#include <iostream>
int main(int argc, char **argv)
{
  std::cout << "Hello world" << std::endl;
 
  return 0;
}
 
Here is the CMakeLists.txt used which find and include Boost.
CMAKE_MINIMUM_REQUIRED(VERSION 2.8.11)
FIND_PACKAGE(Boost 1.47.0 COMPONENTS
  program_options
  system
  regex
  math_c99)
IF(Boost_FOUND)
  SET(Boost_INCLUDE_DIRS     
    ${Boost_INCLUDE_DIR}/boost/tr1/tr1
    ${Boost_INCLUDE_DIR})
  INCLUDE_DIRECTORIES("${Boost_INCLUDE_DIRS}")
ENDIF()
SET(_SOURCES 
  main.cpp 
)
ADD_EXECUTABLE(Dummy 
  ${_SOURCES} 
)
TARGET_LINK_LIBRARIES(Dummy 
  ${Boost_LIBRARIES} 
)
 
This configuration compiles and links.
When building the target a depend.make file is generated. Viewing this file I 
was surprised to discover that main.cpp.obj appears to "depend" on a number of 
boost files. There are 1200 lines like there;
CMakeFiles\Dummy.dir\main.cpp.obj: ..\main.cpp
CMakeFiles\Dummy.dir\main.cpp.obj: 
c:\Boost_r\1_47_0\include\boost-1_52\boost\aligned_storage.hpp
CMakeFiles\Dummy.dir\main.cpp.obj: 
c:\Boost_r\1_47_0\include\boost-1_52\boost\array.hpp
CMakeFiles\Dummy.dir\main.cpp.obj: 
c:\Boost_r\1_47_0\include\boost-1_52\boost\assert.hpp
 
Why does depend.make contain so many dependencies between main.cpp.obj and 
boost headers?
 
                                          
--

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://www.cmake.org/mailman/listinfo/cmake

Reply via email to