diff options
Diffstat (limited to 'CMakeLists.txt')
-rw-r--r-- | CMakeLists.txt | 89 |
1 files changed, 89 insertions, 0 deletions
diff --git a/CMakeLists.txt b/CMakeLists.txt new file mode 100644 index 0000000..5cf4b53 --- /dev/null +++ b/CMakeLists.txt @@ -0,0 +1,89 @@ +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") + +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) + +# +# 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") + set(LIBXML2_INCLUDE_DIRS "/usr/include/libxml2") + include_directories(${LIBXML2_INCLUDE_DIRS}) +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(PVSMGR_MOC_SOURCES ${VMCHOOSER_MOC_HEADERS}) + +# +# 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}") |