From 32931f90a89a40a8045a30d6062131cf893d7ea8 Mon Sep 17 00:00:00 2001 From: Robert Osfield Date: Fri, 25 May 2007 13:15:00 +0000 Subject: [PATCH] From Luigi Calori, build fixes for Win32 build osg WxWidgets example --- CMakeModules/OsgMacroUtils.cmake | 10 +++++++++- examples/osgsimpleviewerWX/CMakeLists.txt | 3 ++- 2 files changed, 11 insertions(+), 2 deletions(-) diff --git a/CMakeModules/OsgMacroUtils.cmake b/CMakeModules/OsgMacroUtils.cmake index 33dc40ef3..91d9fa6c7 100644 --- a/CMakeModules/OsgMacroUtils.cmake +++ b/CMakeModules/OsgMacroUtils.cmake @@ -152,8 +152,11 @@ MACRO(SETUP_EXE IS_COMMANDLINE_APP) ENDIF(NOT TARGET_LABEL) IF(${IS_COMMANDLINE_APP}) + ADD_EXECUTABLE(${TARGET_TARGETNAME} ${TARGET_SRC} ${TARGET_H}) + ELSE(${IS_COMMANDLINE_APP}) + IF(APPLE) # SET(MACOSX_BUNDLE_LONG_VERSION_STRING "${OPENSCENEGRAPH_MAJOR_VERSION}.${OPENSCENEGRAPH_MINOR_VERSION}.${OPENSCENEGRAPH_PATCH_VERSION}") # Short Version is the "marketing version". It is the version @@ -167,8 +170,13 @@ MACRO(SETUP_EXE IS_COMMANDLINE_APP) # SET(MACOSX_BUNDLE_COPYRIGHT "") # SET(MACOSX_BUNDLE_INFO_STRING "Info string, localized?") ENDIF(APPLE) + + IF(WIN32 AND REQUIRE_WINMAIN_FLAG) + ADD_EXECUTABLE(${TARGET_TARGETNAME} WIN32 ${TARGET_SRC} ${TARGET_H}) + ELSE(WIN32 AND REQUIRE_WINMAIN_FLAG) + ADD_EXECUTABLE(${TARGET_TARGETNAME} MACOSX_BUNDLE ${TARGET_SRC} ${TARGET_H}) + ENDIF(WIN32 AND REQUIRE_WINMAIN_FLAG) - ADD_EXECUTABLE(${TARGET_TARGETNAME} MACOSX_BUNDLE ${TARGET_SRC} ${TARGET_H}) ENDIF(${IS_COMMANDLINE_APP}) SET_TARGET_PROPERTIES(${TARGET_TARGETNAME} PROPERTIES PROJECT_LABEL "${TARGET_LABEL}") SET_TARGET_PROPERTIES(${TARGET_TARGETNAME} PROPERTIES DEBUG_POSTFIX ${CMAKE_DEBUG_POSTFIX}) diff --git a/examples/osgsimpleviewerWX/CMakeLists.txt b/examples/osgsimpleviewerWX/CMakeLists.txt index 2e45c3e34..4fb2b940e 100644 --- a/examples/osgsimpleviewerWX/CMakeLists.txt +++ b/examples/osgsimpleviewerWX/CMakeLists.txt @@ -6,6 +6,7 @@ INCLUDE(${wxWidgets_USE_FILE}) #### end var setup ### -SETUP_EXAMPLE(osgsimpleviewerWX 1) +SET(REQUIRE_WINMAIN_FLAG ON) +SETUP_EXAMPLE(osgsimpleviewerWX) TARGET_LINK_LIBRARIES("${TARGET_DEFAULT_PREFIX}osgsimpleviewerWX" ${wxWidgets_LIBRARIES})