mirror of
https://github.com/fltk/fltk.git
synced 2026-06-06 00:22:42 +08:00
CMake for Mac OS: the generated Xcode project creates bundled test applications and
uses appropriate icons for blocks, checkers, and sudoku. git-svn-id: file:///fltk/svn/fltk/branches/branch-1.3@10683 ea41ed52-d2ee-0310-a9c1-e6b18d33e121
This commit is contained in:
+23
-4
@@ -102,10 +102,29 @@ macro(CREATE_EXAMPLE NAME SOURCES LIBRARIES)
|
|||||||
fltk_wrap_ui(${tname} ${flsrcs})
|
fltk_wrap_ui(${tname} ${flsrcs})
|
||||||
endif(flsrcs)
|
endif(flsrcs)
|
||||||
|
|
||||||
add_executable(${tname} WIN32 ${srcs} ${${tname}_FLTK_UI_SRCS})
|
if(APPLE)
|
||||||
set_target_properties(${tname}
|
unset(ICON_NAME)
|
||||||
PROPERTIES OUTPUT_NAME ${oname}
|
if(${tname} STREQUAL "blocks" OR ${tname} STREQUAL "checkers" OR ${tname} STREQUAL "sudoku")
|
||||||
)
|
set( ICON_NAME ${tname}.icns )
|
||||||
|
set( ICON_PATH "${PROJECT_SOURCE_DIR}/test/${tname}.app/Contents/resources/${ICON_NAME}" )
|
||||||
|
endif(${tname} STREQUAL "blocks" OR ${tname} STREQUAL "checkers" OR ${tname} STREQUAL "sudoku")
|
||||||
|
|
||||||
|
if(DEFINED ICON_NAME )
|
||||||
|
add_executable(${tname} MACOSX_BUNDLE ${srcs} ${ICON_PATH})
|
||||||
|
else()
|
||||||
|
add_executable(${tname} MACOSX_BUNDLE ${srcs} ${${tname}_FLTK_UI_SRCS})
|
||||||
|
endif(DEFINED ICON_NAME)
|
||||||
|
else()
|
||||||
|
add_executable(${tname} WIN32 ${srcs} ${${tname}_FLTK_UI_SRCS})
|
||||||
|
endif(APPLE)
|
||||||
|
|
||||||
|
set_target_properties(${tname}
|
||||||
|
PROPERTIES OUTPUT_NAME ${oname}
|
||||||
|
)
|
||||||
|
if(APPLE AND DEFINED ICON_NAME)
|
||||||
|
set_target_properties(${tname} PROPERTIES MACOSX_BUNDLE_ICON_FILE ${ICON_NAME})
|
||||||
|
set_target_properties(${tname} PROPERTIES RESOURCE ${ICON_PATH})
|
||||||
|
endif(APPLE AND DEFINED ICON_NAME)
|
||||||
|
|
||||||
target_link_libraries(${tname} ${LIBRARIES})
|
target_link_libraries(${tname} ${LIBRARIES})
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user