On 01/28/2016 12:42 PM, Nikita Barawade wrote:
Hi All ,
It is possible to same master CMakeList to generate multiple visual
studio solution files ?
here is my master CMakeList :
cmake_minimum_required (VERSION 2.8.11)
project (Myproject_all)
set_property (GLOBAL PROPERTY USE_FOLDERS ON)
# Set compiler flags and options.
# enable the Visual Studio warning level to 4
set (CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} /W4")
# Sub-directories where more CMakeLists.txt exist
add_subdirectory (lib1)
add_subdirectory (TestApp1)
add_subdirectory (lib2)
add_subdirectory (TestApp2)
add_subdirectory (TestApp3)
Now , my project "Myproject_all" includes all sub-projects as
lib1,TestApp1,lib2,TestApp2,TestApp3 (testApps depend on libraries )
I want another solution to be generated through same CMakeList for
example with name "Myproject" which includes only ,
lib1,TestApp1,lib2.
I should not always edit master CMakeList to change project name and
remove TestApp2 and TestApp3.Is there any way to automate this?
CMake generates one solution per directory (CMakeLists.txt) that has its
own project() call.
To put lib1,TestApp1,lib2 into their own solution you would therefor
have to put them into a common parent directory (distinct from the other
targets) and give that parent directory's CMakeLists.txt its own
project(Myproject) call.
Nils
--
Powered by www.kitware.com
Please keep messages on-topic and check the CMake FAQ at:
http://www.cmake.org/Wiki/CMake_FAQ
Kitware offers various services to support the CMake community. For more
information on each offering, please visit:
CMake Support: http://cmake.org/cmake/help/support.html
CMake Consulting: http://cmake.org/cmake/help/consulting.html
CMake Training Courses: http://cmake.org/cmake/help/training.html
Visit other Kitware open-source projects at
http://www.kitware.com/opensource/opensource.html
Follow this link to subscribe/unsubscribe:
http://public.kitware.com/mailman/listinfo/cmake