I am new to CMake and it seems really hard to get my script work. My codes can be compiled the usual way, but I really need to use CMake. I compiled with the following:
g++ vectc.cpp -c -std=c++11
gfortran vectf.f vectc.o -lstdc++
This CMakeLists.txt, that doesn't work for me:
cmake_minimum_required (VERSION 2.6)
project (add_vectors CXX Fortran)
enable_language(Fortran)
set(CMAKE_CXX_FLAGS "-c -std=c++11")
set(CMAKE_Fortran_FLAGS "CMakeFiles/executable/vectc.o -lstdc++")
add_executable( executable
vectc.cpp
vectf.f)
If I run make after cmake i get the following, and I really dont know what to do:
[ 33%] Linking CXX executable executable
c++: warning: CMakeFiles/executable.dir/vectf.f.o: linker input file unused because linking not done
c++: warning: CMakeFiles/executable.dir/vectc.cpp.o: linker input file unused because linking not done
[100%] Built target executable
Does anyone can help me with it?
Edit: The comments shows, I did not asked well. I am pretty new to the Cmake, and I don't know why I got the warnings. Also I have not found my "executable" file.