For any question write to : phy.vijayraj@gmail.com
Few major cmake commands to set your own project. This is indeed the very first step for the Geant4 project.
#-----The minimum cmake required ----#
cmake_minimum_required(VERSION 2.6 FATAL_ERROR)
#------Set your project or program name ----#
set (NAME_MAIN_PROGRAM mcpdetectorinin)
project(${NAME_MAIN_PROGRAM})
#-----Since we want Geant4 package already installed, therefore, call it----#
find_package(Geant4 REQUIRED ui_all vis_all) #The ui_all and vis_all commands are for GUI and visualization.
include(${Geant4_USE_FILE})
file(GLOB sources ${PROJECT_SOURCE_DIR}/*.cc)
file(GLOB headers ${PROJECT_SOURCE_DIR}/*.hh)
# To create a executable file and linking it to the Geant4 libraries
add_executable(mcp mcp.cc ${sources} ${headers}) # mcp will be our executable file
target_link_libraries(mcp ${Geant4_LIBRARIES})
# For internal Geant4 use - but has no effect if you build this
add_custom_target(${NAME_MAIN_PROGRAM} DEPENDS mcp)