I want to create a library with Visual Studio 2010 / VC10 and CMake.
The tree of Windows is not the same than the CMake project tree. The Problem is that CMake doesn't creates the foolib with header and source files in Visual Studio.
I can't change the tree of the library because it's an old grown code with a lot of libraries that share several include files.
root
|-'includes
| '-foo.h
|-'src
| '-libprojects
| | '-foolib
| | | '-bin
| | | '-project
| | | | '-mak100
| | | | '-CMakeLists01.txt
| | | '-src
| | | | '-CMakeLists02.txt
| | | | '-foo.cxx
The CMakeLists.txt only has a number to explain.
CMakeLists01.txt
cmake_minimum_required (VERSION 2.8)
cmake_policy (SET CMP0015 NEW)
project (foolib)
set (CMAKE_BUILD_TYPE Debug)
include_directories ("${PROJECT_SOURCE_DIR}/../../../../include")
# This dosen't works and CMake can't find the CMakeLists02.txt ???
add_subdirectory("${PROJECT_SOURCE_DIR}/../src")
CMakeLists02.txt
# CMakeLists02.txt
set (QueryHeader
"./../../../../include/foo.h")
set (QuerySources
"foo.cxx")
Question: How can I include CMakeLists02.txt into CMakeLists01.txt with add_subdirectory()
This is a batch file if somebody test it
#doCMake.cmd
@echo off
call "c:\Program Files (x86)\Microsoft Visual Studio 10.0\Common7\Tool\vsvars32.bat"
mkdir mak100
cd mak100
cmake -G "Visual Studio 10" ..
cd ..
pause