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
Original issue reported on code.google.com by
Schoenle...@googlemail.com
on 7 May 2012 at 8:19