From eef0ecc952025f310df16aed5e484a981ef6ccde Mon Sep 17 00:00:00 2001 From: haraldhv Date: Fri, 23 Feb 2007 17:55:47 +0000 Subject: [PATCH] Added libtest and fixed library. QT application not yet used. --- CMakeLists.txt | 7 +++++++ lib/CMakeLists.txt | 6 +++--- libtest/CMakeLists.txt | 6 ++++++ libtest/main.cpp | 9 ++++++++ qt/CMakeLists.txt | 47 ++++++++++++++++++++++++++++++++++++++++++ 5 files changed, 72 insertions(+), 3 deletions(-) create mode 100644 libtest/CMakeLists.txt create mode 100644 libtest/main.cpp create mode 100644 qt/CMakeLists.txt diff --git a/CMakeLists.txt b/CMakeLists.txt index c0678de..3b51549 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -4,3 +4,10 @@ set(lib_DIR lib) get_filename_component(lib_ABSOLUTE ${lib_DIR} ABSOLUTE) add_subdirectory(${lib_ABSOLUTE}) +set(libtest_DIR libtest) +get_filename_component(libtest_ABSOLUTE ${libtest_DIR} ABSOLUTE) +add_subdirectory(${libtest_ABSOLUTE}) + +#set(qt_DIR qt) +#get_filename_component(qt_ABSOLUTE ${qt_DIR} ABSOLUTE) +#add_subdirectory(${qt_ABSOLUTE}) diff --git a/lib/CMakeLists.txt b/lib/CMakeLists.txt index 1fa2faa..3795ec8 100644 --- a/lib/CMakeLists.txt +++ b/lib/CMakeLists.txt @@ -1,4 +1,4 @@ -project(aigo) +project(aigolib) set(AIGO_SRCS camera.cpp @@ -21,9 +21,9 @@ include_directories( ${OPENGL_INCLUDE_DIR} ) #find_package(GLEW REQUIRED) #compile the aigo library -add_library(aigo ${AIGO_SRCS}) +add_library(aigolib ${AIGO_SRCS}) #SET(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -std=c99") # c99 flag not used now, not supported by visual studio -target_link_libraries(aigo ${SDL_LIBRARY} ${SDLIMAGE_LIBRARY} ${OPENGL_LIBRARIES} ) +target_link_libraries(aigolib ${SDL_LIBRARY} ${SDLIMAGE_LIBRARY} ${OPENGL_LIBRARIES} ) diff --git a/libtest/CMakeLists.txt b/libtest/CMakeLists.txt new file mode 100644 index 0000000..b7d14bb --- /dev/null +++ b/libtest/CMakeLists.txt @@ -0,0 +1,6 @@ +project(libtest) + +link_directories(../lib) +include_directories(../lib) +add_executable(libtest main.cpp) +target_link_libraries(libtest aigolib) diff --git a/libtest/main.cpp b/libtest/main.cpp new file mode 100644 index 0000000..d8c0e99 --- /dev/null +++ b/libtest/main.cpp @@ -0,0 +1,9 @@ +#include +#include +#include + +int main( void ) +{ + Quickcam cam("/dev/video0"); + return 0; +} diff --git a/qt/CMakeLists.txt b/qt/CMakeLists.txt new file mode 100644 index 0000000..7b23af3 --- /dev/null +++ b/qt/CMakeLists.txt @@ -0,0 +1,47 @@ +project(aigoqt) + +cmake_minimum_required(VERSION 2.4.0) +find_package(Qt4 REQUIRED) + +#find SDL and its related libraries +find_package(SDL REQUIRED) +find_package(SDL_image REQUIRED) +include_directories( ${SDL_INCLUDE_DIR} ${SDLIMAGE_INCLUDE_DIR} ) + + +# the next line sets up include and link directories and defines some variables that we will use. +# you can modify the behavior by setting some variables, e.g. +set(QT_USE_QTOPENGL TRUE) +# -> this will cause cmake to include and link against the OpenGL module +include(${QT_USE_FILE}) + +# the variable "qtproject_SRCS" contains all .cpp files of this project +set(aigoqt_SRCS + + ) + +#ui +set(aigoqt_UIS + + ) +qt4_wrap_ui(aigoqt_UIS_H ${aigoqt_UIS}) +set(CMAKE_INCLUDE_CURRENT_DIR ON) + + +#moc +qt4_automoc(${aigoqt_SRCS}) + +#resources +qt4_add_resources(aigoqt_RESOURCES resources) + +link_directories(${effector_ABSOLUTE}) +include_directories( + ${QT_INCLUDE_DIR} + ${QT_QTOPENGL_INCLUDE_DIR} + ${CMAKE_CURRENT_BINARY_DIR} + #${dgl_ABSOLUTE} + ${current_demo_dir} + ) +add_executable(aigoqt ${aigoqt_SRCS} ${aigoqt_UIS_H} ${aigoqt_RESOURCES}) +target_link_libraries(aigoqt ${QT_LIBRARIES} aigolib) +