[Cmake] how to include header files in MSVC++60 .dsp ?
Bitter, Ingmar (NIH/CC/DRD)
IBitter at cc.nih.gov
Mon Mar 31 18:39:34 EST 2003
Ok, quite simple, just read the error message generated by the example
below, and then figure out that
ADD_LIBRARY(tbase STATIC ${SRC_TBASE} foo.h )
Has to be rwplaced by
ADD_LIBRARY(tbase STATIC ${SRC_TBASE} ../t_base/foo.h )
Ones the path is right it works.
-Ingmar
------------------------------------------------------------------------
Hi,
I am just starting to use cmake.
I would like to create separate libraries for each source directory and I
would like them to show up as separate groups (.dsp's) in MSVC++ 6.0.
I got pretty close, only that I can not find a way to add the header files
to the library groups.
How do I do that?
-Ingmar
PS: here is what I got so far (each file starting with a ### comment):
### ../t_base/CMakeLists.txt
INCLUDE_DIRECTORIES( ../t_base )
AUX_SOURCE_DIRECTORY(../t_base SRC_TBASE )
ADD_LIBRARY (tbase STATIC ${SRC_TBASE} )
#ADD_LIBRARY(tbase STATIC ${SRC_TBASE} foo.h ) // creates error msg
### ../frameworks/qt/CMakeLists.txt
INCLUDE_DIRECTORIES (../frameworks/qt )
AUX_SOURCE_DIRECTORY(../frameworks/qt SRC_QTFRAMEWORK )
ADD_LIBRARY (qtFramework STATIC ${SRC_QTFRAMEWORK})
### mainProject/CMakeLists.txt
PROJECT(_vglT1)
#setup system libraries
FIND_PACKAGE(VGL)
FIND_PACKAGE(Qt)
FIND_PACKAGE(OpenGL)
#make separate dsp's for each dir
INCLUDE ( ../t_base/CMakeLists.txt )
INCLUDE ( ../frameworks/qt/CMakeLists.txt )
AUX_SOURCE_DIRECTORY( . SRCS )
ADD_EXECUTABLE( vlgTutorial SRCS )
#ADD_EXECUTABLE(vlgTutorial SRCS foo.h ) // is ok, but only in main project
TARGET_LINK_LIBRARIES( vlgTutorial tbase qtFramework )
More information about the CMake
mailing list