diff --git a/examples/CMakeLists.txt b/examples/CMakeLists.txt index 37b7f754..39cad943 100644 --- a/examples/CMakeLists.txt +++ b/examples/CMakeLists.txt @@ -14,6 +14,12 @@ if (APPLE) add_executable("Split View" MACOSX_BUNDLE splitview.c) add_executable(Triangle MACOSX_BUNDLE triangle.c) add_executable(Wave MACOSX_BUNDLE wave.c) + + set_target_properties(Boing PROPERTIES MACOSX_BUNDLE_BUNDLE_NAME "Boing") + set_target_properties(Gears PROPERTIES MACOSX_BUNDLE_BUNDLE_NAME "Gears") + set_target_properties("Split View" PROPERTIES MACOSX_BUNDLE_BUNDLE_NAME "Split View") + set_target_properties(Triangle PROPERTIES MACOSX_BUNDLE_BUNDLE_NAME "Triangle") + set_target_properties(Wave PROPERTIES MACOSX_BUNDLE_BUNDLE_NAME "Wave") else() # Set boring names for executables add_executable(boing WIN32 boing.c) @@ -24,11 +30,19 @@ else() add_executable(wave WIN32 wave.c) endif() -set(WINDOWS_BINARIES boing gears heightmap splitview triangle wave) - if (MSVC) + set(WINDOWS_BINARIES boing gears heightmap splitview triangle wave) + # Tell MSVC to use main instead of WinMain for Windows subsystem executables set_target_properties(${WINDOWS_BINARIES} PROPERTIES LINK_FLAGS "/ENTRY:mainCRTStartup") endif() +if (APPLE) + set(BUNDLE_BINARIES Boing Gears "Split View" Triangle Wave) + + set_target_properties(${BUNDLE_BINARIES} PROPERTIES + MACOSX_BUNDLE_SHORT_VERSION_STRING ${GLFW_VERSION} + MACOSX_BUNDLE_LONG_VERSION_STRING ${GLFW_VERSION_FULL}) +endif() + diff --git a/tests/CMakeLists.txt b/tests/CMakeLists.txt index 58631603..44a79972 100644 --- a/tests/CMakeLists.txt +++ b/tests/CMakeLists.txt @@ -44,18 +44,23 @@ target_link_libraries(reopen ${STATIC_DEPS}) add_executable(accuracy WIN32 MACOSX_BUNDLE accuracy.c) target_link_libraries(accuracy ${STATIC_DEPS}) +set_target_properties(accuracy PROPERTIES MACOSX_BUNDLE_BUNDLE_NAME "Accuracy") add_executable(sharing WIN32 MACOSX_BUNDLE sharing.c) target_link_libraries(sharing ${STATIC_DEPS}) +set_target_properties(sharing PROPERTIES MACOSX_BUNDLE_BUNDLE_NAME "Sharing") add_executable(tearing WIN32 MACOSX_BUNDLE tearing.c) target_link_libraries(tearing ${STATIC_DEPS}) +set_target_properties(tearing PROPERTIES MACOSX_BUNDLE_BUNDLE_NAME "Tearing") add_executable(title WIN32 MACOSX_BUNDLE title.c) target_link_libraries(title ${STATIC_DEPS}) +set_target_properties(title PROPERTIES MACOSX_BUNDLE_BUNDLE_NAME "Title") add_executable(windows WIN32 MACOSX_BUNDLE windows.c) target_link_libraries(windows ${STATIC_DEPS}) +set_target_properties(windows PROPERTIES MACOSX_BUNDLE_BUNDLE_NAME "Windows") set(WINDOWS_BINARIES accuracy sharing tearing title windows) set(CONSOLE_BINARIES defaults events fsaa fsfocus gamma glfwinfo iconify @@ -67,3 +72,9 @@ if (MSVC) LINK_FLAGS "/ENTRY:mainCRTStartup") endif() +if (APPLE) + set_target_properties(${WINDOWS_BINARIES} ${CONSOLE_BINARIES} PROPERTIES + MACOSX_BUNDLE_SHORT_VERSION_STRING ${GLFW_VERSION} + MACOSX_BUNDLE_LONG_VERSION_STRING ${GLFW_VERSION_FULL}) +endif() +