summaryrefslogtreecommitdiff
path: root/CMakeLists.txt
blob: 8fadd73cfc8a9416de1ce1723f47548637544e62 (plain)
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
project(acritoxinstaller)
cmake_minimum_required(VERSION 2.6)
find_package(Qt4 REQUIRED)

include(${QT_USE_FILE})
add_definitions(${QT_DEFINITIONS})

if(${CMAKE_BUILD_TYPE} MATCHES "Release")
  add_definitions(-DNDEBUG)
  add_definitions(-DQT_NO_DEBUG_OUTPUT)
endif(${CMAKE_BUILD_TYPE} MATCHES "Release")

set(LIB_SUFFIX "" CACHE STRING "Define suffix of directory name (32/64)")
set(EXEC_INSTALL_PREFIX ${CMAKE_INSTALL_PREFIX} CACHE PATH "Installation prefix for executables and object code libraries" FORCE)
set(BIN_INSTALL_DIR ${EXEC_INSTALL_PREFIX}/bin CACHE PATH "Installation prefix for user executables" FORCE)
set(LIB_INSTALL_DIR ${EXEC_INSTALL_PREFIX}/lib${LIB_SUFFIX} CACHE PATH  "Installation prefix for object code libraries" FORCE)
set(DATA_INSTALL_DIR ${EXEC_INSTALL_PREFIX}/share/acritoxinstaller CACHE PATH  "Installation prefix where shared data will be installed" FORCE)
set(INCLUDE_INSTALL_DIR ${CMAKE_INSTALL_PREFIX}/include CACHE PATH "Installation prefix for C header files" FORCE)

set(BACKEND_DIR ${DATA_INSTALL_DIR})
configure_file(${CMAKE_CURRENT_SOURCE_DIR}/backend/backend.sh.in ${CMAKE_CURRENT_BINARY_DIR}/backend.sh @ONLY)
install(PROGRAMS ${CMAKE_CURRENT_BINARY_DIR}/backend.sh DESTINATION "${BACKEND_DIR}")
install(DIRECTORY backend/modules DESTINATION "${DATA_INSTALL_DIR}")

add_subdirectory( qtermwidget )

file(GLOB wizard_SRCS wizard/[a-z]*.cpp)
file(GLOB wizard_HDRS wizard/[a-z]*.h)
file(GLOB wizard_UIS  wizard/[a-z]*.ui)

configure_file(config.h.in ${CMAKE_CURRENT_BINARY_DIR}/config.h)
set(acritoxinstaller_SRCS mainwizard.cpp main.cpp backend.cpp listitem.cpp listdelegate.cpp busyappfilter.cpp ${wizard_SRCS})
set(acritoxinstaller_MOC_HDRS mainwizard.h backend.h listdelegate.h ${wizard_HDRS})
set(acritoxinstaller_UIS ${wizard_UIS})

qt4_wrap_cpp(acritoxinstaller_MOC_SRCS ${acritoxinstaller_MOC_HDRS})
qt4_wrap_ui(acritoxinstaller_UIS_H ${acritoxinstaller_UIS})
include_directories(${CMAKE_CURRENT_BINARY_DIR})
add_executable(acritoxinstaller ${acritoxinstaller_SRCS} ${acritoxinstaller_MOC_SRCS} ${acritoxinstaller_UIS_H})
target_link_libraries(acritoxinstaller ${QT_LIBRARIES} qtermwidget crypt)

install(TARGETS acritoxinstaller RUNTIME DESTINATION "${BIN_INSTALL_DIR}" LIBRARY DESTINATION "${LIB_INSTALL_DIR}")