Note that there are some explanatory texts on larger screens.

plurals
  1. POHow to setup cmake for a project with several modules including unit test etc
    primarykey
    data
    text
    <p>Ok, it is driving me crazy so I am going to ask you guys for some help. I am trying to set up a new project which is pretty small at the moment.</p> <p>To keep it simple, my project structure is something like:<br> RootProject<br> - module1 (which is a header only library)<br> -- include<br> ---module1<br> ----header files (containing templates, which I would like to test)<br> --test<br> ---testmain.cpp (uses gmock and boost unit test framework)<br> -CMakeLists.txt (1)<br> -module2 (another lib, using module1)<br> --same structure as module 1<br> CMakeLists.txt (2) </p> <p>So, I have a root CMakeLists.txt and several CMakeLists.txt for each module.</p> <p>Root CMakeLists.txt:<br> `</p> <pre><code>cmake_minimum_required(VERSION 2.8) project(root) # compiler set(CMAKE_CXX_COMPILER "g++") # cpp flags set(CMAKE_CXX_FLAGS "-g -Wall") add_definitions(-std=gnu++0x) find_package(Boost COMPONENTS system filesystem unit_test_framework REQUIRED) set(BOOST_INCLUDES ${Boost_FILESYSTEM_INCLUDE_DIR} ${Boost_SYSTEM_INCLUDE_DIR} ${Boost_UNIT_TEST_FRAMEWORK_INCLUDE_DIR} ) set(BOOST_LIBRARIES ${Boost_FILESYSTEM_LIBRARY} ${Boost_SYSTEM_LIBRARY} ${Boost_UNIT_TEST_FRAMEWORK_LIBRARY} ) # Build with system gmock and embedded gtest set (GMOCK_INCLUDE_DIR "C:/GMock/gmock-1.6.0/include") set(GMOCK_LIBRARIES gmock gmock_main) enable_testing() # Add sub-directories add_subdirectory (module1) add_subdirectory (module2) add_subdirectory (module3) add_executable(root main.cxx) </code></pre> <p>But having a working CMakeLists.txt for module1 let's me get a headache. Which would be the simplest solution to test the header only module? I would really appreciate your help!</p>
    singulars
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload