cmake_minimum_required(VERSION 2.6) # project name project(vmchooser) set(CMAKE_BUILD_TYPE Debug) set(CMAKE_CXX_FLAGS_DEBUG "-O0 -g -Wall -Wextra") set(CMAKE_CXX_FLAGS_RELEASE "-O3 -march=native -Wall -Wextra -Werror") set(CMAKE_VERBOSE_MAKEFILE TRUE) set(OPENSLX_ROOT "../../../..") #set(OPENSLX_ROOT "~/hiwi/openslx") file(GLOB_RECURSE VMCHOOSER_SOURCES src/*.cpp) file(GLOB_RECURSE VMCHOOSER_MOC_HEADERS src/*.h) file(GLOB_RECURSE VMCHOOSER_UIS src/ui/*.ui) file(GLOB_RECURSE VMCHOOSER_RESOURCES src/*.qrc) include_directories(${CMAKE_CURRENT_BINARY_DIR}) # # Boost libraries # set(Boost_USE_STATIC_LIBS ON) find_package(Boost COMPONENTS "filesystem" "regex" "system" REQUIRED) if(Boost_FOUND) message(STATUS "Boost libraries found") #message(STATUS "Boost_LIBRARIES=${Boost_LIBRARIES}") link_directories(${Boost_LIBRARY_DIRS}) include_directories(${Boost_INCLUDE_DIRS}) else(Boost_FOUND) message(FATAL_ERROR "Boost libraries not found") endif(Boost_FOUND) # # LibXml2 library # find_package(LibXml2 REQUIRED) if(LIBXML2_FOUND) # TODO: this sucks, but we will get rid of libxml2 anyway message(STATUS "LibXml2 found") set(LIBXML2_INCLUDE_DIRS "/usr/include/libxml2") include_directories(${LIBXML2_INCLUDE_DIRS}) else(LIBXML2_FOUND) message(FATAL_ERROR "LibXml2 not found") endif(LIBXML2_FOUND) # # Qt4 # # TODO: Qt4.3 should do find_package(Qt4 4.5.0 REQUIRED) if(QT4_FOUND) message(STATUS "Qt4 found") else(QT4_FOUND) message(FATAL_ERROR "Qt4 not found") endif(QT4_FOUND) set(QT_USE_QTDBUS TRUE) set(QT_USE_QTXML TRUE) set(QT_USE_QTSVG TRUE) include(${QT_USE_FILE}) QT4_ADD_RESOURCES(VMCHOOSER_RC_SOURCES ${VMCHOOSER_RESOURCES}) QT4_WRAP_UI(VMCHOOSER_UI_HEADERS ${VMCHOOSER_UIS}) QT4_WRAP_CPP(VMCHOOSER_MOC_SOURCES ${VMCHOOSER_MOC_HEADERS}) # run qdbusxml2cpp on org.openslx.pvs.xml (taken from pvs build) QT4_ADD_DBUS_INTERFACE(VMCHOOSER_SOURCES src/org.openslx.pvs.xml pvsinterface ) # # build vmchooser # add_executable(vmchooser ${VMCHOOSER_SOURCES} ${VMCHOOSER_MOC_SOURCES} ${VMCHOOSER_UI_HEADERS} ${VMCHOOSER_RC_SOURCES} ) target_link_libraries(vmchooser ${QT_LIBRARIES} ${Boost_LIBRARIES} ${LIBXML2_LIBRARIES} ) #install(TARGETS vmchooser RUNTIME DESTINATION # "${OPENSLX_ROOT}/openslx/trunk/os-plugins/plugins/vmchooser/files/") install(TARGETS vmchooser RUNTIME DESTINATION "${CMAKE_BINARY_DIR}")