-
Notifications
You must be signed in to change notification settings - Fork 0
/
CMakeLists.txt
executable file
·71 lines (58 loc) · 2.22 KB
/
CMakeLists.txt
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
#----------------------------------------------------------------------------
# Setup the project
#----------------------------------------------------------------------------
cmake_minimum_required(VERSION 2.6 FATAL_ERROR)
project(CAENHV_CTRL)
#----------------------------------------------------------------------------
# REQUIRE GTK3
#----------------------------------------------------------------------------
find_package(PkgConfig REQUIRED)
pkg_check_modules(GTK3 REQUIRED gtk+-3.0)
message(STATUS "----- GTK3_INCLUDE_DIRS: ${GTK3_INCLUDE_DIRS}")
message(STATUS "----- GKT3_LIBRARIES: ${GTK3_LIBRARIES}")
message(STATUS "----- GTK3_LINK_LIBRARIES: ${GTK3_LINK_LIBRARIES}")
include_directories(${GTK3_INCLUDE_DIRS})
link_directories(${GTK3_LIBRARY_DIRS})
list(APPEND FC_DEP_LIBS ${GTK3_LIBRARIES})
#----------------------------------------------------------------------------
# Copying GLADE XML GUI
#----------------------------------------------------------------------------
set(
CAENHV_CTRL
glade/gui.glade
docs/icon.png
)
foreach(_script ${CAENHV_CTRL})
configure_file(
${PROJECT_SOURCE_DIR}/${_script}
${PROJECT_BINARY_DIR}/${_script}
COPYONLY
)
endforeach()
if(CMAKE_COMPILER_IS_GNUCXX)
add_definitions(--std=gnu99)
endif()
include_directories(${PROJECT_SOURCE_DIR}/include)
#----------------------------------------------------------------------------
# Locate sources and headers for this project
# NB: headers are included so they will show up in IDEs
#
file(GLOB sources ${PROJECT_SOURCE_DIR}/src/*.c)
file(GLOB headers ${PROJECT_SOURCE_DIR}/include/*.h)
#----------------------------------------------------------------------------
# Add the executable, and link it to the Geant4 libraries
#
add_executable(caenhvctrl caenhvctrl.c ${sources} ${headers})
target_link_libraries(caenhvctrl -rdynamic)
target_link_libraries (caenhvctrl ${FC_DEP_LIBS})
option(DEBUG "DEBUG" ON)
if(DEBUG)
message("-- Building with console debug.")
add_definitions(-DDEBUG)
else()
message("-- Building without console debug.")
endif()
#----------------------------------------------------------------------------
# Install the executable to 'bin' directory under CMAKE_INSTALL_PREFIX
#
install(TARGETS caenhvctrl DESTINATION bin)