Pārlūkot izejas kodu

sources and headers seperated; CMakeLists modified accordingly

Sven Sickert 8 gadi atpakaļ
vecāks
revīzija
54d66bbadf

+ 14 - 16
CMakeLists.txt

@@ -1,32 +1,32 @@
 cmake_minimum_required(VERSION 2.8)
 project (ImageLabeler)
 
-FIND_PACKAGE(Qt4 REQUIRED) 
-
+FIND_PACKAGE(Qt4 REQUIRED)
 
 # The version number.
-set (ImageLabeler_VERSION_MAJOR 1)
-set (ImageLabeler_VERSION_MINOR 0)
- 
-SET(ImageLabeler_SOURCES main.cpp functions.cpp ImageHolder.cpp ImageLabeler.cpp LineEditForm.cpp OptionsForm.cpp)
-SET(ImageLabeler_HEADERS ImageHolder.h ImageLabeler.h LineEditForm.h OptionsForm.h)
+SET (ImageLabeler_VERSION_MAJOR 1)
+SET (ImageLabeler_VERSION_MINOR 1)
+
+SET(ImageLabeler_SRC "${ImageLabeler_SOURCE_DIR}/src")
+SET(ImageLabeler_INC "${ImageLabeler_SOURCE_DIR}/include")
 SET(ImageLabeler_FORMS ui/ImageLabeler.ui)
 
 SET(QT_USE_QTXML TRUE)
 
+# recurse over files
+FILE(GLOB_RECURSE ImageLabeler_SOURCES ${ImageLabeler_SRC}/*.cpp)
+FILE(GLOB_RECURSE ImageLabeler_HEADERS ${ImageLabeler_INC}/*.h)
+
 QT4_WRAP_CPP(ImageLabeler_HEADERS_MOC ${ImageLabeler_HEADERS})
 QT4_WRAP_UI(ImageLabeler_HEADERS_FORMS ${ImageLabeler_FORMS})
- 
-# add the binary tree to the search path for include files
-# so that we will find TutorialConfig.h
-#include_directories ("${PROJECT_BINARY_DIR}")
+
+INCLUDE_DIRECTORIES(${ImageLabeler_INC})
 
 INCLUDE(${QT_USE_FILE})
-ADD_DEFINITIONS(${QT_DEFINITIONS}) 
+ADD_DEFINITIONS(${QT_DEFINITIONS})
 
 # add the executable
-add_executable (ImageLabeler ${ImageLabeler_SOURCES} ${ImageLabeler_HEADERS_MOC} ${ImageLabeler_HEADERS_FORMS})
-#target_link_libraries (Tutorial  ${EXTRA_LIBS})
+ADD_EXECUTABLE (ImageLabeler ${ImageLabeler_SOURCES} ${ImageLabeler_HEADERS_MOC} ${ImageLabeler_HEADERS_FORMS})
 
 INCLUDE_DIRECTORIES(${CMAKE_CURRENT_BINARY_DIR})
 
@@ -34,6 +34,4 @@ TARGET_LINK_LIBRARIES(ImageLabeler ${QT_LIBRARIES})
 
 # add the install targets
 install (TARGETS ImageLabeler DESTINATION bin)
-#install (FILES "${PROJECT_BINARY_DIR}/TutorialConfig.h"        
-#         DESTINATION include)
 

+ 0 - 0
ImageHolder.h → include/ImageHolder.h


+ 0 - 0
ImageLabeler.h → include/ImageLabeler.h


+ 0 - 0
LineEditForm.h → include/LineEditForm.h


+ 0 - 0
OptionsForm.h → include/OptionsForm.h


+ 0 - 0
functions.h → include/functions.h


+ 0 - 0
ImageHolder.cpp → src/ImageHolder.cpp


+ 0 - 0
ImageLabeler.cpp → src/ImageLabeler.cpp


+ 0 - 0
LineEditForm.cpp → src/LineEditForm.cpp


+ 0 - 0
OptionsForm.cpp → src/OptionsForm.cpp


+ 0 - 0
functions.cpp → src/functions.cpp


+ 0 - 0
main.cpp → src/main.cpp