[CMake] depend.make

Lars laasunde at hotmail.com
Wed Dec 11 06:53:14 EST 2013


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?
 
 		 	   		  
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://www.cmake.org/pipermail/cmake/attachments/20131211/f3fad455/attachment.htm>


More information about the CMake mailing list