Permalink
Browse files

Put compile guards around falcon_mouse for command line options. Fixes

  • Loading branch information...
1 parent ad8191c commit 4fc60464f981cf1c961bcaabddba278e437c6122 @qdot committed Dec 29, 2011
Showing with 32 additions and 29 deletions.
  1. +32 −29 examples/CMakeLists.txt
@@ -116,32 +116,35 @@ ENDIF(NOT Boost_PROGRAM_OPTIONS_FOUND)
# Build function for falcon_mouse
######################################################################################
-IF(WIN32)
- SET(MOUSE_SRCS falcon_mouse/falcon_mouse.cpp falcon_mouse/falcon_mouse_win.cpp)
- SET(MOUSE_LINK_LIBS ${LIBNIFALCON_EXE_PO_LINK_LIBS})
-ELSEIF(APPLE)
- SET(MOUSE_SRCS falcon_mouse/falcon_mouse.cpp falcon_mouse/falcon_mouse_osx.cpp)
- SET(MOUSE_LINK_LIBS ${LIBNIFALCON_EXE_PO_LINK_LIBS})
- SET(MOUSE_LINK_FLAGS "-framework Carbon -framework ApplicationServices")
-ELSEIF(UNIX)
- FIND_PACKAGE(X11)
- IF(X11_FOUND AND X11_XTest_LIB)
- INCLUDE_DIRECTORIES(${X11_INCLUDE_DIR})
- SET(MOUSE_SRCS falcon_mouse/falcon_mouse.cpp falcon_mouse/falcon_mouse_x11.cpp)
- SET(MOUSE_LINK_LIBS ${LIBNIFALCON_EXE_PO_LINK_LIBS} ${X11_LIBRARIES} ${X11_XTest_LIB})
- ELSE(X11_FOUND AND X11_XTest_LIB)
- MESSAGE(STATUS "Not compiling falcon_mouse example - X11 compiling requires the XTest library")
- ENDIF(X11_FOUND AND X11_XTest_LIB)
-ENDIF(WIN32)
-
-IF(MOUSE_SRCS)
- BUILDSYS_BUILD_EXE(
- NAME falcon_mouse
- SOURCES "${MOUSE_SRCS}"
- LINK_LIBS "${MOUSE_LINK_LIBS}"
- LINK_FLAGS "${MOUSE_LINK_FLAGS}"
- CXX_FLAGS FALSE
- DEPENDS nifalcon_DEPEND
- SHOULD_INSTALL TRUE
- )
-ENDIF(MOUSE_SRCS)
+IF(NOT Boost_PROGRAM_OPTIONS_FOUND)
+ MESSAGE("Cannot compile falcon_mouse - Missing Boost Program Options")
+ELSE(NOT Boost_PROGRAM_OPTIONS_FOUND)
+ IF(WIN32)
+ SET(MOUSE_SRCS falcon_mouse/falcon_mouse.cpp falcon_mouse/falcon_mouse_win.cpp)
+ SET(MOUSE_LINK_LIBS ${LIBNIFALCON_EXE_PO_LINK_LIBS})
+ ELSEIF(APPLE)
+ SET(MOUSE_SRCS falcon_mouse/falcon_mouse.cpp falcon_mouse/falcon_mouse_osx.cpp)
+ SET(MOUSE_LINK_LIBS ${LIBNIFALCON_EXE_PO_LINK_LIBS})
+ SET(MOUSE_LINK_FLAGS "-framework Carbon -framework ApplicationServices")
+ ELSEIF(UNIX)
+ FIND_PACKAGE(X11)
+ IF(X11_FOUND AND X11_XTest_LIB)
+ INCLUDE_DIRECTORIES(${X11_INCLUDE_DIR})
+ SET(MOUSE_SRCS falcon_mouse/falcon_mouse.cpp falcon_mouse/falcon_mouse_x11.cpp)
+ SET(MOUSE_LINK_LIBS ${LIBNIFALCON_EXE_PO_LINK_LIBS} ${X11_LIBRARIES} ${X11_XTest_LIB})
+ ELSE(X11_FOUND AND X11_XTest_LIB)
+ MESSAGE(STATUS "Not compiling falcon_mouse example - X11 compiling requires the XTest library")
+ ENDIF(X11_FOUND AND X11_XTest_LIB)
+ ENDIF(WIN32)
+ IF(MOUSE_SRCS)
+ BUILDSYS_BUILD_EXE(
+ NAME falcon_mouse
+ SOURCES "${MOUSE_SRCS}"
+ LINK_LIBS "${MOUSE_LINK_LIBS}"
+ LINK_FLAGS "${MOUSE_LINK_FLAGS}"
+ CXX_FLAGS FALSE
+ DEPENDS nifalcon_DEPEND
+ SHOULD_INSTALL TRUE
+ )
+ ENDIF(MOUSE_SRCS)
+ENDIF()

0 comments on commit 4fc6046

Please sign in to comment.