CMakeLists.txt 2.56 KB
Newer Older
Whitney Armstrong's avatar
Whitney Armstrong committed
1
cmake_minimum_required (VERSION 3.0)
Whitney Armstrong's avatar
Whitney Armstrong committed
2 3
project (PHYSICA C Fortran)

Whitney Armstrong's avatar
Whitney Armstrong committed
4 5 6 7
SET(CMAKE_PREFIX_PATH
  ${CMAKE_PREFIX_PATH}
  /opt/software/local
  )
Whitney Armstrong's avatar
Whitney Armstrong committed
8 9 10 11 12
set(CMAKE_MODULE_PATH
   ${CMAKE_MODULE_PATH}
   ${PROJECT_SOURCE_DIR}/cmake
   ${PROJECT_SOURCE_DIR}/cmake/Modules 
   )
Whitney Armstrong's avatar
Whitney Armstrong committed
13 14 15 16 17 18

find_package(Threads REQUIRED)

find_package(X11 REQUIRED)
include_directories(${X11_INCLUDE_DIRS})

Whitney Armstrong's avatar
Whitney Armstrong committed
19 20 21
find_package(GD REQUIRED)
include_directories(${GD_INCLUDE_DIR})
link_libraries(${GD_LIBRARIES})
Whitney Armstrong's avatar
Whitney Armstrong committed
22

Whitney Armstrong's avatar
Whitney Armstrong committed
23 24
find_package(Readline REQUIRED)
include_directories(${Readline_INCLUDE_DIR})
Whitney Armstrong's avatar
Whitney Armstrong committed
25

Whitney Armstrong's avatar
Whitney Armstrong committed
26 27 28
#find_package(CERNLIB REQUIRED)
#link_libraries(${CERNLIB_LIBRARIES})

Whitney Armstrong's avatar
Whitney Armstrong committed
29 30
find_library(KERNLIB
    NAMES libkernlib  kernlib
Whitney Armstrong's avatar
Whitney Armstrong committed
31
    HINTS /opt/software/local/lib64/cernlib/2006/lib  ${CMAKE_PREFIX_PATH}/lib ${CMAKE_PREFIX_PATH}/lib64
Whitney Armstrong's avatar
Whitney Armstrong committed
32 33 34 35
)
find_library(PACKLIB
    NAMES libpacklib  packlib
    #HINTS "${CMAKE_PREFIX_PATH}/lib"
Whitney Armstrong's avatar
Whitney Armstrong committed
36
    HINTS /opt/software/local/lib64/cernlib/2006/lib  ${CMAKE_PREFIX_PATH}/lib ${CMAKE_PREFIX_PATH}/lib64
Whitney Armstrong's avatar
Whitney Armstrong committed
37 38 39 40 41 42 43 44 45
)


set(CMAKE_Fortran_FLAGS "${CMAKE_Fortran_FLAGS} -g -malign-double -fno-second-underscore -fno-automatic -frecord-marker=4 -Dgfortran -Dunix ")

add_subdirectory (gplot) 
add_subdirectory (mud) 
add_subdirectory (physica) 

Whitney Armstrong's avatar
Whitney Armstrong committed
46 47 48 49
configure_file (
   "${PROJECT_SOURCE_DIR}/physica/physica.sh.in"
   "${PROJECT_BINARY_DIR}/physica.sh"
   )
Whitney Armstrong's avatar
Whitney Armstrong committed
50

Whitney Armstrong's avatar
Whitney Armstrong committed
51 52
add_executable(Physica-bin physica/src/phys_main.F )
target_link_libraries(Physica-bin physicalib Threads::Threads ${PACKLIB} ${KERNLIB} ${X11_LIBRARIES} mudlib gplot ${GD_LIBRARY} ${Readline_LIBRARY})
Whitney Armstrong's avatar
Whitney Armstrong committed
53 54


Whitney Armstrong's avatar
Whitney Armstrong committed
55 56
#install(Physica 

Whitney Armstrong's avatar
Whitney Armstrong committed
57 58 59 60 61 62 63 64 65 66 67 68 69 70
install( TARGETS Physica-bin
         RUNTIME DESTINATION bin
         LIBRARY DESTINATION lib
         ARCHIVE DESTINATION lib/static )

install( FILES physica/physica.hlp physica/physica.hli DESTINATION bin )

install( FILES gplot/vaxfont.dat
  DESTINATION share/physica )

install( PROGRAMS "${PROJECT_BINARY_DIR}/physica.sh"
  DESTINATION bin 
  RENAME physica
  )
Whitney Armstrong's avatar
Whitney Armstrong committed
71 72


Whitney Armstrong's avatar
Whitney Armstrong committed
73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92
#$add_executable(physica physicalib gplot mud kernlib packlib )

#physica :       $(PHYSICA_LIB)
#                $(FORTRAN) -o $@ -Wl,-u,MAIN__ \
#                $(PHYSICA_LIB) $(MUD_LIB) $(GPLOT_LIB) $(KERNLIB) $(PACKLIB) $(OTHER_LIBS)

#ifeq (${HAVE_CERNLIB},YES)
#  XSRCS = $(PHYSICA_DIR)/src/physica_minuit.F \
#	  $(PHYSICA_DIR)/src/map_hbook_dum.F \
#	  $(PHYSICA_DIR)/src/rstr_hbook.F
#else
#  XSRCS = $(PHYSICA_DIR)/src/cern_dum.F
#endif
#
#CSRCS = $(PHYSICA_DIR)/src/physica_malloc.c \
#        $(PHYSICA_DIR)/src/physica_free.c \
#        $(PHYSICA_DIR)/src/x_resize_window.c \
#        $(PHYSICA_DIR)/src/digitize_png.c \
#        $(PHYSICA_DIR)/src/readline_wrapper.c \
#        $(PHYSICA_DIR)/src/linux/rstr_mudc.c