0

I have found this sample program for CMake:

cmake_minimum_required (VERSION 2.6)
project (Tutorial)
add_library(Tutorial tutorial.cxx)

However, im trying to get my entire project onto cmake that includes alot of librarys and source files, how should i go about adding an entire directory instead of just "tutorial.cxx"?

  • Normally you do one `CMakeLists.txt` file per directory/library. But this is mainly a question of style and there are lot of CMake examples out there explaining different scenarios. On SO itself see e.g [here](http://stackoverflow.com/questions/31512485/cmake-how-to-setup-source-library-and-cmakelists-txt-dependencies). Please tell us what you've tried and why it didn’t meet your needs. This demonstrates that you’ve taken the time to try to help yourself, it saves us from reiterating obvious answers, and most of all it helps you get a more specific and relevant answer. See also: [ask] – Florian Sep 28 '16 at 08:13
  • 3
    looks like a duplicate of http://stackoverflow.com/questions/3201154/cmake-automatically-add-all-files-in-a-folder-to-a-target – galsh83 Sep 28 '16 at 08:33

0 Answers0