[CMake] Creating a common (= across several projects) CMake module/include-file/library

Shlomi Fish shlomif at shlomifish.org
Sat May 11 17:22:51 EDT 2013


Hi all,

many of my CMake-based projects carry a common top-level "Common.cmake" file
that I copy from one project to another and enhance, and since this is
duplicate code/functionality I would like to consolidate it.

What I want to be able to do is say something like:

<CODE>

INCLUDE(ShlomifCommon)

</CODE>

at the top, and then have it read from a system wide "ShlomifCommon.cmake"
file that I will maintain in one central location, and install. For a bonus
point, I'd like to have a way to copy this file into every project's tarball
so it won't require installation.

What would be the best way to achieve this?

Regards,

	Shlomi Fish 

-- 
-----------------------------------------------------------------
Shlomi Fish       http://www.shlomifish.org/
The Case for File Swapping - http://shlom.in/file-swap

There is no IGLU cabal! The former cabalists are trying to prove the
correctness of a program that proves the correctness of proofs of other
programs.

Please reply to list if it's a mailing list post - http://shlom.in/reply .


More information about the CMake mailing list