Igloo Project setup with CMake

108 views
Skip to first unread message

Alwin Mark

unread,
Feb 11, 2015, 9:06:05 AM2/11/15
to igloo-...@googlegroups.com
Hi,

I would be very interested in the source files/demo video of your posted code kata using CMake. I'm currently not very familiar with C Macros and CMake and need a kickstart to setup a Project on my own. I'm lacking of having one main.cpp File executing all Specs.

I have following file structure:

.
├── CMakeLists.txt
├── include
├── src
│   └── subject
│       ├── subject.cpp
│       └── subject.hpp
├── tests
│   ├── main.cpp
│   └── subject_test.cpp

Where main.cpp includes:

int main(int argc, char *argv[])
{
  return TestRunner::RunAllTests(argc, argv);
}

and my subject_tests includes the real Specification.

Here is my Cmake.txt:
cmake_minimum_required(VERSION 2.8.4)
project(project)

set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -std=c++11")

include_directories(include src tests)

add_executable(all_tests tests/main.cpp)


But running all_tests only prints:

Test run complete. 0 tests run, 0 succeeded, 0 failed.

So he does not include the subject_test.cpp correctly.

 
 

Joakim Karlsson

unread,
Feb 12, 2015, 11:49:33 AM2/12/15
to igloo-...@googlegroups.com
Hi,

You need to add all cpp-files in your add_executable statement. Otherwise they won't get lcompiled and inked.

In your case:

FILE(GLOB, TestSrc tests/*.cpp src/*.cpp)
add_executable(${TestSrc})

might help (depends a bit on what your code does). 

You can also specify all cpp-files explicitly.

/Joakim





--
You received this message because you are subscribed to the Google Groups "Igloo-testing" group.
To unsubscribe from this group and stop receiving emails from it, send an email to igloo-testin...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Reply all
Reply to author
Forward
0 new messages