[cmake-commits] hoffman committed CMakeLists.txt NONE 1.1 bar.c NONE 1.1 foo.c NONE 1.1

cmake-commits at cmake.org cmake-commits at cmake.org
Tue Feb 20 09:35:23 EST 2007


Update of /cvsroot/CMake/CMake/Tests/SetLang
In directory public:/mounts/ram/cvs-serv12903/Tests/SetLang

Added Files:
	CMakeLists.txt bar.c foo.c 
Log Message:
BUG: fix for bug 4423 set language fixes


--- NEW FILE: CMakeLists.txt ---
# test forcing a source file language to c++ from c
project(SetLang)
add_library(foo foo.c)
add_executable(bar bar.c)
set_source_files_properties(foo.c bar.c PROPERTIES LANGUAGE CXX)
target_link_libraries(bar foo)
set_target_properties(bar PROPERTIES LINKER_LANGUAGE CXX)

--- NEW FILE: foo.c ---
int foo()
{
  int r = 10;
  r++;
  int ret = r+10;
  return ret;
}

--- NEW FILE: bar.c ---
#include <stdio.h>

int foo();
class A
{
public:
  A() {this->i = foo();}
  int i;
};

int main()
{
  A a;
  if(a.i == 21)
    {
    printf("passed foo is 21\n");
    return 0;
    }
  printf("Failed foo is not 21\n");
  return -1;
}



More information about the Cmake-commits mailing list