2017-03-19 3 views
1

Ich habe ein CERN-ROOT-Skript, das auf C++ basiert und ich schreibe (bearbeiten Sie ein Beispiel) CMakeList.txt. Ich bin so rokie bei CMake BTW. Wenn ich befehle, mit cmake .. zu kompilieren, es richtig gemacht -ich denke- ohne Fehler. Aber .exe-Datei, was ich produzieren möchte, erscheint nicht. Meine Auswahl AufträgeCMake produziert keine .exe-Datei

/Project 
../TLV.cpp 
../CMakeLists.txt 
../build 

Da meine CMakeLists.txt

ist
cmake_minimum_required(VERSION 2.8) 
project(TLV) 
#Set CXX flags to compile with c++11 and error warnings quiet 
set(CMAKE_CXX_FLAGS "-O3 -fPIC -Wall -Wextra -std=c++11 -m64") 

#Load root 
set(CMAKE_MODULE_PATH ${CMAKE_MODULE_PATH} $ENV{ROOTSYS}/etc/cmake) 
#print conf 
message(STATUS "Environmental CMAKE_MODULE_PATH is $ENV{ROOTSYS}") 
#find the package with extra libraries needed 
find_package(ROOT MODULE REQUIRED Cling TreePlayer Tree Rint Postscript Matrix RIO Core Foam RooStats RooFit RooFitCore Gpad Graf3d Graf Hist Net TMVA XMLIO MLP) 
#include ROOT stuff 
include(${ROOT_USE_FILE}) 
message(STATUS "Environmental ROOTSYS is $ENV{ROOTSYS}") 
message(STATUS "found root at: ${ROOT_USE_FILE}") 
message(STATUS "ROOT_LIBRARIES=${ROOT_LIBRARIES}") 


#produce executables in bin path 
set(EXECUTABLE_OUTPUT_PATH bin) 
#include_directories(./../Framework Headers) 
#${FROM_OTHERS_INCLUDE}) 
#defines all .cpp support class with corresponding Headers 
#file(GLOB SRCS Sources/*.cpp Headers/*.hpp) 
#${FROM_OTHERS_HEADER} ${FROM_OTHERS_SOURCE}) 

#add executable 
add_executable(TLV TLV.cpp ) 

#link the executable with the root libraries 
target_link_libraries(TLV ${ROOT_LIBRARIES}) 

ich es nicht, wo ich bin falsch.

+0

TLV.cpp btw seine Arbeitsplätze richtig mit ROOT tun. – agenel

Antwort

1

Nachdem Sie Cmake Ausgabe dann

Ein typisches Szenario für ein Projekt machen ausstellen, die cmake benutzt, ist

cd src_directory # for example cd ~/other_src/root-6.08.06/ 
mkdir build  # skip this if dir build already exists 
cd build 
cmake ..   # the .. just says your source home dir is up a dir 
cmake-gui ..  # a GUI alternative to cmake where you can edit settings 
make    # if you have a quad core CPU then use : make -j8 
+0

Oh mein Gott. Ich habe so viel über Linux und diese Dinge zu lernen. Danke – agenel

+0

statt 'make' könnte man auch' cmake --build' vorschlagen. Letzteres hängt nicht davon ab, ob Ninja oder Gnu verwendet wird. – pseyfert

Verwandte Themen