Introduction:
I am trying to use CMake to get cross-platform compilation scripts (for VS 9.0 on Windows32 and Makefiles for Unix).
I am experiencing what I cannot understand about add_subdirectory ().
Let me show you my code:
Context:
My architecture for a module named "module1" looks something like this:
- CMakeLists.txt
- enable /
- SRC /
- test /
- CMakeLists.txt
- SRC /
- testfile1.cpp
- testfile2.cpp
The architecture of my entire application consists of these modules, which in themselves are projects that can work independently.
My goals:
Here is the CMakeLists I wrote:
This file is CMakeLists.txt in the root directory of my module.
#ENSURE MINIMUM VERSION OF CMAKE cmake_minimum_required(VERSION 2.8)
And then, in the test folder, here is CMakeLists.txt
#ENSURE MINIMUM VERSION OF CMAKE cmake_minimum_required(VERSION 2.8)
Question
CMake displays the correct solution MyProject.sln Visual Studio 9.0, which successfully compiles in my library related to OpenCV and Xerces (and other libraries of the third part). However, the test binary did not output MyProjectTest.sln.
I thought ( and read in the CMake documentation ) that add_subdirectory (dir) was used to create CMake in the next section (I mean the name could not be clearer: p!), So should I continue to work with CMake in the directory test / and create my solution MyProjectTest.sln?
I use the CMake GUI to run the root CMakeLists.txt in the build directory, which I create in the root of my module. When I examine the assembly directory, where can I find MyProjet.sln, the test / folder, but without MyProjectTest.sln in it!
cmake build-system
jmartel Jul 19 '11 at 13:25 2011-07-19 13:25
source share