[CMake] Multiple Visual Studio Solutions through same master CMakeLists.txt

Nikita Barawade nikita.barawade at einfochips.com
Thu Jan 28 06:42:03 EST 2016



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?


Regards,
Nikita
************************************************************************************************************************************************************* eInfochips Business Disclaimer: This e-mail message and all attachments transmitted with it are intended solely for the use of the addressee and may contain legally privileged and confidential information. If the reader of this message is not the intended recipient, or an employee or agent responsible for delivering this message to the intended recipient, you are hereby notified that any dissemination, distribution, copying, or other use of this message or its attachments is strictly prohibited. If you have received this message in error, please notify the sender immediately by replying to this message and please delete it from your computer. Any views expressed in this message are those of the individual sender unless otherwise stated. Company has taken enough precautions to prevent the spread of viruses. However the company accepts no liability for any damage caused by any virus transmitted by this email. *************************************************************************************************************************************************************
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://public.kitware.com/pipermail/cmake/attachments/20160128/eafc0fd0/attachment.html>


More information about the CMake mailing list