Source

installer / CMakeLists.txt

Full commit
project("installer" C)


cmake_minimum_required(VERSION 2.6)

list(APPEND CMAKE_MODULE_PATH ${CMAKE_SOURCE_DIR}/cmake/vala/ )
list(APPEND CMAKE_MODULE_PATH ${CMAKE_SOURCE_DIR}/cmake/gettext/ )

include(FindVala)
include(UseVala)

find_package(Vala)

find_package(PkgConfig)

SET(CMAKE_BUILD_TYPE "Release")

# Package options
SET (LOCALEDIR "/usr/share/locale" CACHE STRING "Where we should install localisations")
SET (GETTEXT_PACKAGE "valhalla" CACHE STRING "The gettext domain")
SET (GENERATED_DIR "${CMAKE_SOURCE_DIR}/GENERATED" CACHE STRING "Autogenerated files directory")
SET (INSTALLER_NAME "valhalla" CACHE STRING "The name of the installer, used in binary files")

OPTION (BUILD_TEST "Build the test programs" OFF)
OPTION (GNOME_PANEL_HACK "Use the panel hack for sizing the window" ON)
OPTION (WITH_GEOIP "Whether the timezone module can determine location using GeoIP" ON)

# TRANSLATION STUFF #
add_subdirectory (po)

pkg_check_modules (GTK REQUIRED gtk+-2.0)
add_definitions (${GTK_CFLAGS})
#link_libraries (${GTK_LIBRARIES})
link_directories (${GTK_LIBRARY_DIRS})

# Everything we used needs gmodule, so use it
pkg_check_modules (GMODULE REQUIRED gmodule-2.0)
add_definitions (${GMODULE_CFLAGS})
link_libraries (${GMODULE_LIBRARIES})
link_directories (${GMODULE_LIBRARY_DIRS})

# We need gobject globally, link to it
pkg_check_modules (GOBJECT REQUIRED gobject-2.0)
add_definitions (${GOBJECT_CFLAGS})
link_libraries (${GOBJECT_LIBRARIES})
link_directories (${GOBJECT_LIBRARY_DIRS})

# libxml for src/core/xml
pkg_check_modules (LIBXML REQUIRED libxml-2.0)
add_definitions (${LIBXML_CFLAGS})
link_directories (${LIBXML_LIBRARY_DIRS})


pkg_check_modules (PANGO REQUIRED pango)
add_definitions (${PANGO_CFLAGS})
link_directories (${PANGO_LIBRARY_DIRS})

pkg_check_modules (PANGOCAIRO REQUIRED pangocairo)
add_definitions (${PANGOCAIRO_CFLAGS})
link_directories (${PANGOCAIRO_LIBRARY_DIRS})

pkg_check_modules (LIBUNIQUE REQUIRED unique-1.0)
add_definitions (${LIBUNIQUE_CFLAGS})
link_directories (${LIBUNIQUE_LIBRARY_DIRS})

IF (GNOME_PANEL_HACK)
pkg_check_modules (GCONF REQUIRED gconf-2.0)
add_definitions (${GCONF_CFLAGS})
link_directories (${GCONF_LIBRARY_DIRS})
ENDIF (GNOME_PANEL_HACK)

IF (WITH_GEOIP)
pkg_check_modules (GEOIP REQUIRED geoip)
add_definitions (${GEOIP_CFLAGS})
link_directories (${GEOIP_LIBRARY_DIRS})
ENDIF (WITH_GEOIP)

pkg_check_modules (LIBPARTED REQUIRED libparted>=2.3)
#add_definitions (${LIBPARTED_CFLAGS})
#link_libraries (${LIBPARTED_LIBRARIES})
#link_directories (${LIBPARTED_LIBRARY_DIRS})

include_directories (${CMAKE_SOURCE_DIR}/vapi)
include_directories (${CMAKE_SOURCE_DIR}/src)
include_directories (${CMAKE_SOURCE_DIR}/src/modules)
include_directories (${GENERATED_DIR})
# Write our config
CONFIGURE_FILE ( ${CMAKE_SOURCE_DIR}/vapi/config.h.in ${CMAKE_BINARY_DIR}/gen/config.h )

include_directories (${CMAKE_BINARY_DIR}/gen)

# Installer pages - shared lib
vala_precompile(INSTALLER_PAGE
"src/page.vala"
PACKAGES
gmodule-2.0
gio-2.0
gtk+-2.0
DIRECTORY
.
GENERATE_VAPI
GENERATED/installerpage
OPTIONS
--disable-warnings
)

add_library ("installerpage" SHARED ${INSTALLER_PAGE})
target_link_libraries ("installerpage" ${GTK_LIBRARIES})
add_subdirectory (src)

# make install stuff

INSTALL (PROGRAMS ${CMAKE_BINARY_DIR}/libinstallerpage.so DESTINATION lib)
INSTALL (DIRECTORY ${CMAKE_SOURCE_DIR}/data/resources DESTINATION share/${INSTALLER_NAME})
INSTALL (FILES ${CMAKE_SOURCE_DIR}/data/debian-installer-launcher.desktop DESTINATION share/applications)
INSTALL (FILES ${CMAKE_SOURCE_DIR}/data/live-installer DESTINATION share/menu)