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})