asdlei00 / crashrpt

Automatically exported from code.google.com/p/crashrpt
0 stars 0 forks source link

CMake generated projects do not contain header files #150

Closed GoogleCodeExporter closed 9 years ago

GoogleCodeExporter commented 9 years ago
When generating projects with CMake, only the source files are part of the 
project.
While this compiles find, it is not ideal when navigating the sources or when 
doing a find in "Entire Solution".

The issue can be quickly fixed by adding a line after the definition of 
source_files:

aux_source_directory( . source_files )
file( GLOB header_files *.h )

And when defining the target(s) adding ${header_files} after ${source_files}. 
e.g.

# Add library build target
if(CRASHRPT_BUILD_SHARED_LIBS)
    add_library(CrashRpt SHARED 
        ${source_files}
        ${header_files}
    )
else(CRASHRPT_BUILD_SHARED_LIBS)
    add_library(CrashRpt STATIC 
        ${source_files}
        ${header_files}
    )
endif(CRASHRPT_BUILD_SHARED_LIBS)

in the CrashRpt CMakeLists.txt file. As a side remark, the CMake documentation 
recommends not using aux_source_directory in the way used here:
http://www.cmake.org/cmake/help/v2.8.8/cmake.html#command:aux_source_directory
as convenient as it may be. 

Original issue reported on code.google.com by Schoenle...@googlemail.com on 7 May 2012 at 8:19

GoogleCodeExporter commented 9 years ago

Original comment by zexspect...@gmail.com on 10 May 2012 at 6:23

GoogleCodeExporter commented 9 years ago
This issue was closed by revision r1365.

Original comment by zexspect...@gmail.com on 29 Aug 2012 at 7:19