[Ktutorial-commits] SF.net SVN: ktutorial:[89] trunk/ktutorial
Status: Alpha
Brought to you by:
danxuliu
|
From: <dan...@us...> - 2010-02-13 19:19:29
|
Revision: 89
http://ktutorial.svn.sourceforge.net/ktutorial/?rev=89&view=rev
Author: danxuliu
Date: 2010-02-13 19:19:22 +0000 (Sat, 13 Feb 2010)
Log Message:
-----------
-Adjust CMakeLists.txt's to the new directory layout.
-KTutorial test app can now be built without KTutorial library sources. However, in most cases the whole KTutorial project will be available, so KTutorial test app is built against a built but not installed yet KTutorial library.
Modified Paths:
--------------
trunk/ktutorial/ktutorial-library/CMakeLists.txt
trunk/ktutorial/ktutorial-library/src/CMakeLists.txt
trunk/ktutorial/ktutorial-test-app/CMakeLists.txt
trunk/ktutorial/ktutorial-test-app/TestApp.cpp
trunk/ktutorial/ktutorial-test-app/TutorialClearText.cpp
trunk/ktutorial/ktutorial-test-app/TutorialClearText.h
trunk/ktutorial/ktutorial-test-app/TutorialMoveText.cpp
trunk/ktutorial/ktutorial-test-app/TutorialMoveText.h
Added Paths:
-----------
trunk/ktutorial/CMakeLists.txt
Added: trunk/ktutorial/CMakeLists.txt
===================================================================
--- trunk/ktutorial/CMakeLists.txt (rev 0)
+++ trunk/ktutorial/CMakeLists.txt 2010-02-13 19:19:22 UTC (rev 89)
@@ -0,0 +1,6 @@
+project(ktutorial)
+
+find_package(KDE4 REQUIRED)
+
+macro_optional_add_subdirectory(ktutorial-library)
+macro_optional_add_subdirectory(ktutorial-test-app)
Property changes on: trunk/ktutorial/CMakeLists.txt
___________________________________________________________________
Added: svn:eol-style
+ native
Modified: trunk/ktutorial/ktutorial-library/CMakeLists.txt
===================================================================
--- trunk/ktutorial/ktutorial-library/CMakeLists.txt 2010-02-13 19:08:14 UTC (rev 88)
+++ trunk/ktutorial/ktutorial-library/CMakeLists.txt 2010-02-13 19:19:22 UTC (rev 89)
@@ -1,4 +1,4 @@
-project(ktutorial)
+project(ktutorial-library)
set(QT_MIN_VERSION "4.5.3")
find_package(KDE4 REQUIRED)
@@ -9,4 +9,3 @@
add_subdirectory(po)
add_subdirectory(src)
add_subdirectory(test)
-add_subdirectory(test-app)
Modified: trunk/ktutorial/ktutorial-library/src/CMakeLists.txt
===================================================================
--- trunk/ktutorial/ktutorial-library/src/CMakeLists.txt 2010-02-13 19:08:14 UTC (rev 88)
+++ trunk/ktutorial/ktutorial-library/src/CMakeLists.txt 2010-02-13 19:19:22 UTC (rev 89)
@@ -50,6 +50,12 @@
WaitForSignal.h
)
+# Hack to make headers available to other ktutorial modules (like
+# ktutorial-test-app) when the library is built but not installed yet.
+foreach(header ${ktutorial_LIB_HEADERS})
+ configure_file(${CMAKE_CURRENT_SOURCE_DIR}/${header} ${ktutorial-library_BINARY_DIR}/includes/ktutorial/${header} COPYONLY)
+endforeach(header)
+
install(FILES ${ktutorial_LIB_HEADERS} DESTINATION ${INCLUDE_INSTALL_DIR}/ktutorial)
install(FILES ktutorialui.rc DESTINATION ${DATA_INSTALL_DIR}/ktutorial)
Modified: trunk/ktutorial/ktutorial-test-app/CMakeLists.txt
===================================================================
--- trunk/ktutorial/ktutorial-test-app/CMakeLists.txt 2010-02-13 19:08:14 UTC (rev 88)
+++ trunk/ktutorial/ktutorial-test-app/CMakeLists.txt 2010-02-13 19:19:22 UTC (rev 89)
@@ -1,5 +1,26 @@
-include_directories(${ktutorial_SOURCE_DIR}/src ${KDE4_INCLUDES})
+project(ktutorial-test-app)
+find_package(KDE4 REQUIRED)
+include_directories(${KDE4_INCLUDES})
+
+add_subdirectory(po)
+
+# When KTutorial is built, the library isn't installed yet when the test-app is
+# built. In that case, use the headers and libraries in the build directory
+# of the library.
+if(ktutorial-library_BINARY_DIR)
+ set(KTUTORIAL_FOUND TRUE)
+ include_directories(${ktutorial-library_BINARY_DIR}/includes)
+ set(KTUTORIAL_LIBRARIES ktutorial)
+endif(ktutorial-library_BINARY_DIR)
+
+# If ktutorial-test-app is built in standalone mode, look for an installed
+# KTutorial library.
+if(NOT KTUTORIAL_FOUND)
+ find_package(KTutorial REQUIRED)
+ include_directories(${KTUTORIAL_INCLUDE_DIRS})
+endif(NOT KTUTORIAL_FOUND)
+
set(ktutorial_test_app_SRCS
main.cpp
TestApp.cpp
@@ -9,7 +30,7 @@
kde4_add_executable(ktutorial-test-app ${ktutorial_test_app_SRCS})
-target_link_libraries(ktutorial-test-app ktutorial ${KDE4_KDEUI_LIBS} ${KDE4_KIO_LIBS})
+target_link_libraries(ktutorial-test-app ${KTUTORIAL_LIBRARIES} ${KDE4_KDEUI_LIBS} ${KDE4_KIO_LIBS})
####### Install the test application #######
Modified: trunk/ktutorial/ktutorial-test-app/TestApp.cpp
===================================================================
--- trunk/ktutorial/ktutorial-test-app/TestApp.cpp 2010-02-13 19:08:14 UTC (rev 88)
+++ trunk/ktutorial/ktutorial-test-app/TestApp.cpp 2010-02-13 19:19:22 UTC (rev 89)
@@ -27,7 +27,7 @@
#include <KSaveFile>
#include <QTextStream>
-#include "KTutorial.h"
+#include <ktutorial/KTutorial.h>
#include "TestApp.h"
#include "TutorialClearText.h"
Modified: trunk/ktutorial/ktutorial-test-app/TutorialClearText.cpp
===================================================================
--- trunk/ktutorial/ktutorial-test-app/TutorialClearText.cpp 2010-02-13 19:08:14 UTC (rev 88)
+++ trunk/ktutorial/ktutorial-test-app/TutorialClearText.cpp 2010-02-13 19:19:22 UTC (rev 89)
@@ -20,11 +20,12 @@
#include <ktextedit.h>
#include "TutorialClearText.h"
-#include "KTutorial.h"
-#include "Step.h"
-#include "TutorialInformation.h"
-#include "WaitForSignal.h"
+#include <ktutorial/KTutorial.h>
+#include <ktutorial/Step.h>
+#include <ktutorial/TutorialInformation.h>
+#include <ktutorial/WaitForSignal.h>
+
//public:
TutorialClearText::TutorialClearText(): Tutorial(0) {
Modified: trunk/ktutorial/ktutorial-test-app/TutorialClearText.h
===================================================================
--- trunk/ktutorial/ktutorial-test-app/TutorialClearText.h 2010-02-13 19:08:14 UTC (rev 88)
+++ trunk/ktutorial/ktutorial-test-app/TutorialClearText.h 2010-02-13 19:19:22 UTC (rev 89)
@@ -19,7 +19,7 @@
#ifndef TUTORIALCLEARTEXT_H
#define TUTORIALCLEARTEXT_H
-#include "Tutorial.h"
+#include <ktutorial/Tutorial.h>
class TutorialClearText: public Tutorial {
Q_OBJECT
Modified: trunk/ktutorial/ktutorial-test-app/TutorialMoveText.cpp
===================================================================
--- trunk/ktutorial/ktutorial-test-app/TutorialMoveText.cpp 2010-02-13 19:08:14 UTC (rev 88)
+++ trunk/ktutorial/ktutorial-test-app/TutorialMoveText.cpp 2010-02-13 19:19:22 UTC (rev 89)
@@ -23,14 +23,15 @@
#include <ktextedit.h>
#include "TutorialMoveText.h"
-#include "KTutorial.h"
-#include "Option.h"
-#include "Step.h"
-#include "TutorialInformation.h"
-#include "WaitForAnd.h"
-#include "WaitForNot.h"
-#include "WaitForSignal.h"
+#include <ktutorial/KTutorial.h>
+#include <ktutorial/Option.h>
+#include <ktutorial/Step.h>
+#include <ktutorial/TutorialInformation.h>
+#include <ktutorial/WaitForAnd.h>
+#include <ktutorial/WaitForNot.h>
+#include <ktutorial/WaitForSignal.h>
+
//public:
TutorialMoveText::TutorialMoveText(): Tutorial(0) {
Modified: trunk/ktutorial/ktutorial-test-app/TutorialMoveText.h
===================================================================
--- trunk/ktutorial/ktutorial-test-app/TutorialMoveText.h 2010-02-13 19:08:14 UTC (rev 88)
+++ trunk/ktutorial/ktutorial-test-app/TutorialMoveText.h 2010-02-13 19:19:22 UTC (rev 89)
@@ -19,7 +19,7 @@
#ifndef TUTORIALMOVETEXT_H
#define TUTORIALMOVETEXT_H
-#include "Tutorial.h"
+#include <ktutorial/Tutorial.h>
class KTextEdit;
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|