CMake include and source pathes are not the same as the Windows Dirctory pathes

I want to create a libray with Visual Studion 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 soures files in Visual Studio.

I can’t change the tree of the libray because it’s an old grown code with a lot of librays that share several include files.

|  '-foo.h
|  '-libprojects
|  | '-foolib
|  | | '-bin
|  | | '-project
|  | | | '-mak100
|  | | | '-CMakeLists01.txt
|  | | '-src
|  | | | '-CMakeLists02.txt
|  | | | '-foo.cxx

The CMakeLists.txt only has a number to explain.


cmake_minimum_required (VERSION 2.8)
cmake_policy (SET CMP0015 NEW)
project (foolib)


include_directories ("${PROJECT_SOURCE_DIR}/../../../../include")

# This dosen't works and CMake can't find the CMakeLists02.txt ??? 


# CMakeLists02.txt
set (QueryHeader

set (QuerySources

This is a batch file if somebody test it

@echo off
call "c:Program Files (x86)Microsoft Visual Studio 10.0Common7Toolvsvars32.bat"
mkdir mak100
cd mak100
cmake -G "Visual Studio 10" ..
cd ..

Source: c#

Leave a Reply

This site uses Akismet to reduce spam. Learn how your comment data is processed.