summaryrefslogtreecommitdiff
authorDustin Frisch <dustin@dustin-frisch.de>2011-06-20 02:41:43 (GMT)
committer Dustin Frisch <dustin@dustin-frisch.de>2011-06-20 02:41:43 (GMT)
commit18cb5e98c922ce4face3ad290fdfe45ebacab9f5 (patch) (side-by-side diff)
tree35aa22b2962c7fccec6f123a5a9785d449e4b003
parentd5cbdf66042dc59d0beb3b0cf33451fbf1eed92e (diff)
downloadsmartsens-demo-gtk-18cb5e98c922ce4face3ad290fdfe45ebacab9f5.zip
smartsens-demo-gtk-18cb5e98c922ce4face3ad290fdfe45ebacab9f5.tar.gz
Build script improved
Diffstat (more/less context) (ignore whitespace changes)
-rw-r--r--CMakeLists.txt37
1 files changed, 23 insertions, 14 deletions
diff --git a/CMakeLists.txt b/CMakeLists.txt
index cedbf95..9b1a3e7 100644
--- a/CMakeLists.txt
+++ b/CMakeLists.txt
@@ -1,17 +1,26 @@
+cmake_minimum_required (VERSION 2.6)
-include_directories (${GTK2_INCLUDE_DIRS})
+project (SMARTSENS_DEMO_GTK)
-include_directories (${SMARTSENS_SOURCE_DIR}/smartsens-protocol/include)
-include_directories (${SMARTSENS_SOURCE_DIR}/smartsens-server/include)
+find_package (GTK2 COMPONENTS gtk)
-link_directories (${SMARTSENS_BINARY_DIR}/smartsens-server)
-
-include_directories (${SMARTSENS_SOURCE_DIR}/smartsens-demo-gtk/include)
-add_executable (smartsens-demo-gtk
- src/main.c
-)
-
-target_link_libraries (smartsens-demo-gtk
- smartsens-server
- ${GTK2_LIBRARIES}
-)
+if (GTK2_FOUND)
+ include_directories (${GTK2_INCLUDE_DIRS})
+
+ include_directories (${SMARTSENS_PROTOCOL_SOURCE_DIR}/include)
+ include_directories (${SMARTSENS_SERVER_SOURCE_DIR}/include)
+
+ link_directories (${SMARTSENS_SERVER_BINARY_DIR})
+
+ include_directories (${SMARTSENS_DEMO_GTK_SOURCE_DIR}/include)
+ add_executable (smartsens-demo-gtk
+ src/main.c
+ )
+
+ target_link_libraries (smartsens-demo-gtk
+ smartsens-server
+ ${GTK2_LIBRARIES}
+ )
+
+ configure_file (${SMARTSENS_DEMO_GTK_SOURCE_DIR}/main.glade ${CMAKE_CURRENT_BINARY_DIR}/ COPYONLY)
+endif (GTK2_FOUND)