[CMake] Fwd: building libs and specifying addition folders

John Drescher drescherjm at gmail.com
Thu Jan 19 01:01:01 EST 2012


---------- Forwarded message ----------
From: John Drescher <drescherjm at gmail.com>
Date: Thu, Jan 19, 2012 at 1:00 AM
Subject: Re: [CMake] building libs and specifying addition folders
To: Dev Guy <devguy.ca at gmail.com>


On Wed, Jan 18, 2012 at 10:57 PM, Dev Guy <devguy.ca at gmail.com> wrote:
> Hi,
>
> I am relatively new to CMake and I've read the tutorial. However I
> have a few questions.
>
> 1. How can I declare a CMakeLists file to create a project to build a
> DLL or static lib ? I assume if I build a DLL on windows, it will
> build as a shared lib on Linux

put SHARED in the add_library statement

For more info than that type the following from a command prompt or shell:

cmake --help-command add_library

>
> 2. If my main source folder has 2 sub-folders, one that only includes
> header files call is Include and another folder that contains source
> files call it Utils. How do I add declare them to my CMakeLists files
> so that both the header and addition source files are found and and
> compiled in the main source folder to build the final binary.
>

add_subdirectory

Again for help:
cmake --help-command add_subdirectory


John


-- 
John M. Drescher


More information about the CMake mailing list