I'm use clion 1.0 with cmake and try to build simple demo project. But cmake don't want link external .c file to main.c.
System: Xubuntu 14.04
main.c
#include "common/source_file.h"
void SetupRC()
{
Cmake_dermo(1);
}
int main(int argc, char* argv[])
{
SetupRC();
return 0;
}
CMakeLists.txt
cmake_minimum_required(VERSION 3.2)
project(mytest)
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -std=c++11")
set(SOURCE_FILES main.cpp)
add_executable(mytest common/source_file.h common/source_file.c ${SOURCE_FILES})
source_file.c
#include "source_file.h"
void Cmake_dermo(int da)
{
da += 1;
}
What is wrong?