[CMake] Preventing CMakeLists from being too similar

Crast, Nicholas Nicholas.Crast at saabsensis.com
Mon Jul 6 08:41:57 EDT 2015


Hi guys,

I have a question for you about general practices. I have a top level directory with a bunch of modules inside:

Nick
|
|module1
|module2
|module3

Module1, module2, and module3 are subdirectories inside of the nick directory. Each module directory contains src,inc and test (gtest unit test files).

These modules are pretty similar in structure, meaning the CMakeLists files are almost identical. Is there any way to make some sort of generic CMakeLists file that I can call with arguments for all 3 modules? I'm having the same issue with unit tests, where the unit test section for my CMakeLists is essentially identical between the modules.

Thoughts?

-Nick

----------------------------------------
Nick Crast
Software Engineer
Saab Sensis Corporation
Phone: 315-445-5703
Email: Nicholas.Crast at saabsensis.com<mailto:Nicholas.Crast at saabsensis.com>


This message is intended only for the addressee and may contain information that is company confidential or privileged. Any technical data in this message may be exported only in accordance with the U.S. International Traffic in Arms Regulations (22 CFR Parts 120-130) or the Export Administration Regulations (15 CFR Parts 730-774). Unauthorized use is strictly prohibited and may be unlawful. If you are not the intended recipient, or the person responsible for delivering to the intended recipient, you should not read, copy, disclose or otherwise use this message. If you have received this email in error, please delete it, and advise the sender immediately.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://public.kitware.com/pipermail/cmake/attachments/20150706/d72b466e/attachment.html>


More information about the CMake mailing list