CMakeLists.txt
changeset 878 6d65c5e0049a
parent 847 5e5e6c067413
child 885 e1fe7fe85939
--- a/CMakeLists.txt	Sun Apr 01 22:06:37 2007 +0000
+++ b/CMakeLists.txt	Mon Apr 02 20:57:39 2007 +0000
@@ -297,7 +297,7 @@
     SET_TARGET_PROPERTIES(physfs-static PROPERTIES CLEAN_DIRECT_OUTPUT 1)
 ENDIF(PHYSFS_BUILD_SHARED AND PHYSFS_BUILD_STATIC)
 
-OPTION(PHYSFS_BUILD_TEST "Build test program." TRUE)
+OPTION(PHYSFS_BUILD_TEST "Build stdio test program." TRUE)
 MARK_AS_ADVANCED(PHYSFS_BUILD_TEST)
 IF(PHYSFS_BUILD_TEST)
     CHECK_INCLUDE_FILE(readline/readline.h HAVE_READLINE_H)
@@ -317,6 +317,24 @@
     SET(PHYSFS_INSTALL_TARGETS ${PHYSFS_INSTALL_TARGETS} ";test_physfs")
 ENDIF(PHYSFS_BUILD_TEST)
 
+OPTION(PHYSFS_BUILD_WX_TEST "Build wxWidgets test program." TRUE)
+MARK_AS_ADVANCED(PHYSFS_BUILD_WX_TEST)
+IF(PHYSFS_BUILD_WX_TEST)
+    SET(wxWidgets_USE_LIBS base core adv)
+    SET(wxWidgets_INCLUDE_DIRS_NO_SYSTEM 1)
+    FIND_PACKAGE(wxWidgets)
+    IF(wxWidgets_FOUND)
+        INCLUDE(${wxWidgets_USE_FILE})
+        ADD_EXECUTABLE(wxtest_physfs test/wxtest_physfs.cpp)
+        SET_SOURCE_FILES_PROPERTIES(test/wxtest_physfs.cpp COMPILE_FLAGS ${wxWidgets_CXX_FLAGS})
+        TARGET_LINK_LIBRARIES(wxtest_physfs ${PHYSFS_LIB_TARGET} ${wxWidgets_LIBRARIES} ${OTHER_LDFLAGS})
+        SET(PHYSFS_INSTALL_TARGETS ${PHYSFS_INSTALL_TARGETS} ";wxtest_physfs")
+    ELSE(wxWidgets_FOUND)
+        MESSAGE(STATUS "wxWidgets not found. Disabling wx test app.")
+        SET(PHYSFS_BUILD_WX_TEST FALSE)
+    ENDIF(wxWidgets_FOUND)
+ENDIF(PHYSFS_BUILD_WX_TEST)
+
 INSTALL(TARGETS ${PHYSFS_INSTALL_TARGETS}
         RUNTIME DESTINATION bin
         LIBRARY DESTINATION lib
@@ -352,7 +370,8 @@
 MESSAGE_BOOL_OPTION("Build own zlib" PHYSFS_INTERNAL_ZLIB)
 MESSAGE_BOOL_OPTION("Build static library" PHYSFS_BUILD_STATIC)
 MESSAGE_BOOL_OPTION("Build shared library" PHYSFS_BUILD_SHARED)
-MESSAGE_BOOL_OPTION("Build test program" PHYSFS_BUILD_TEST)
+MESSAGE_BOOL_OPTION("Build wxWidgets test program" PHYSFS_BUILD_WX_TEST)
+MESSAGE_BOOL_OPTION("Build stdio test program" PHYSFS_BUILD_TEST)
 IF(PHYSFS_BUILD_TEST)
     MESSAGE_BOOL_OPTION("  Use readline in test program" HAVE_SYSTEM_READLINE)
 ENDIF(PHYSFS_BUILD_TEST)