I want to create a library with Visual Studio 2010 / VC10 and CMake.
The Windows tree does not match the CMake project tree. The problem is that CMake does not create foolib with the header and source files in Visual Studio.
I cannot change the library tree because it is an old extended code with a lot of libraries that have several included files.
root
|-'includes
| '-foo.h
|-'src
| '-libprojects
| | '-foolib
| | | '-bin
| | | '-project
| | | | '-mak100
| | | | '-CMakeLists01.txt
| | | '-src
| | | | '-CMakeLists02.txt
| | | | '-foo.cxx
CMakeLists.txt only has an explanation number.
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")
add_subdirectory("${PROJECT_SOURCE_DIR}/../src")
CMakeLists02.txt
set (QueryHeader
"./../../../../include/foo.h")
set (QuerySources
"foo.cxx")
Question: How to enable CMakeLists02.txt in CMakeLists01.txt with add_subdirectory ()
This is a batch file if someone tests it
@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
source
share