I am new to cmake file creation. I have c++ code in list of directory, each directory has its own CMakeLists.txt
file. For compile and create executable in each directory, I have to go inside directory and execute following two command on terminal.
$ cmake .
$ make
Each directory 1, 2 ...41 has its own `CMakeLists.txt'.
Example inside each directory file structure:
For compile and create executable in each directory, i have to follow those tow command.
But now i have to write either python script/ cmake script to do above this action in each directory and capture the output and store in log file.
Kindly anyone to guide me to solve my issue. Thanks in advance.
My each directory CMakeLists.txt like this:
project(foundations)
cmake_minimum_required(VERSION 2.6)
include_directories($ENV{GMOCK_HOME}/include $ENV{GMOCK_HOME}/gtest/include)
link_directories($ENV{GMOCK_HOME}/mybuild $ENV{GMOCK_HOME}/gtest/mybuild)
add_definitions(-std=c++11)
set(sources main.cpp RetweetCollectionTest.cpp)
add_executable(test ${sources})
target_link_libraries(test pthread)
target_link_libraries(test gmock)
target_link_libraries(test gtest)