ENH: add a simple x11 test for packaging

This commit is contained in:
Bill Hoffman 2008-04-11 10:23:27 -04:00
parent ee867fb1b2
commit 94f40300e8
2 changed files with 11 additions and 2 deletions

View File

@ -1,6 +1,6 @@
# a simple C only test case
cmake_minimum_required (VERSION 2.6)
PROJECT (UseX11 C)
PROJECT (UseX11 CXX C)
INCLUDE (${CMAKE_ROOT}/Modules/FindX11.cmake)
MESSAGE("X11_FOUND: ${X11_FOUND}")
@ -23,4 +23,13 @@ IF(X11_FOUND)
ADD_DEFINITIONS(-DCMAKE_HAS_X)
INCLUDE_DIRECTORIES(${X11_INCLUDE_DIR})
TARGET_LINK_LIBRARIES(UseX11 ${X11_LIBRARIES})
IF(APPLE)
ADD_EXECUTABLE(HelloWorldX11 HelloWorldX11.cxx)
TARGET_LINK_LIBRARIES(HelloWorldX11 ${X11_LIBRARIES})
install( TARGETS HelloWorldX11 DESTINATION bin)
# build a CPack driven installer package
set(CPACK_PACKAGE_NAME HelloWorldX11Package)
set(CPACK_PACKAGE_EXECUTABLES HelloWorldX11 HelloWorldX11)
include(CPack)
ENDIF(APPLE)
ENDIF(X11_FOUND)

View File

@ -72,7 +72,7 @@ Main::Main (int argc, char * const argv[]) {
init_x();
// event loop
while(TRUE) {
while(1) {
// get the next event and stuff it into our event variable.
// Note: only events we set the mask for are detected!
XNextEvent(dis, &event);