diff options
| author | Albrecht Schlosser <albrechts.fltk@online.de> | 2014-10-09 16:03:56 +0000 |
|---|---|---|
| committer | Albrecht Schlosser <albrechts.fltk@online.de> | 2014-10-09 16:03:56 +0000 |
| commit | 078df04bfda35c426573d2438af0394666f15bef (patch) | |
| tree | d6fc154b4afe35cde65d5b7cbe1d3708fd9182c6 /CMake | |
| parent | 3e4af3cd8c7d4e09f6074f475727e0cbeb297462 (diff) | |
CMake: Prevent annoying warning under Cygwin.
git-svn-id: file:///fltk/svn/fltk/branches/branch-1.3@10368 ea41ed52-d2ee-0310-a9c1-e6b18d33e121
Diffstat (limited to 'CMake')
| -rw-r--r-- | CMake/macros.cmake | 30 |
1 files changed, 21 insertions, 9 deletions
diff --git a/CMake/macros.cmake b/CMake/macros.cmake index caa295eec..a7d3c7a34 100644 --- a/CMake/macros.cmake +++ b/CMake/macros.cmake @@ -4,7 +4,7 @@ # macros.cmake defines macros used by the build system # Written by Michael Surette # -# Copyright 1998-2010 by Bill Spitzak and others. +# Copyright 1998-2014 by Bill Spitzak and others. # # This library is free software. Distribution and use rights are outlined in # the file "COPYING" which should have been included with this file. If this @@ -78,8 +78,17 @@ endmacro(FL_ADD_LIBRARY LIBNAME LIBTYPE LIBFILES) ####################################################################### macro(CREATE_EXAMPLE NAME SOURCES LIBRARIES) - set(srcs) - set(flsrcs) + set(srcs) # source files + set(flsrcs) # fluid source files + + set(tname ${NAME}) # target name + set(oname ${NAME}) # output (executable) name + + # rename reserved target name "help" (CMake 2.8.12 and later) + if(${tname} MATCHES "^help$") + set(tname "test_help") + endif(${tname} MATCHES "^help$") + foreach(src ${SOURCES}) if("${src}" MATCHES ".fl$") list(APPEND flsrcs ${src}) @@ -90,24 +99,27 @@ macro(CREATE_EXAMPLE NAME SOURCES LIBRARIES) if(flsrcs) set(FLTK_WRAP_UI TRUE) - fltk_wrap_ui(${NAME} ${flsrcs}) + fltk_wrap_ui(${tname} ${flsrcs}) endif(flsrcs) - add_executable(${NAME} WIN32 ${srcs} ${${NAME}_FLTK_UI_SRCS}) + add_executable(${tname} WIN32 ${srcs} ${${tname}_FLTK_UI_SRCS}) + set_target_properties(${tname} + PROPERTIES OUTPUT_NAME ${oname} + ) - target_link_libraries(${NAME} ${LIBRARIES}) + target_link_libraries(${tname} ${LIBRARIES}) # link in optional libraries if(USE_XFT) - target_link_libraries(${NAME} ${X11_Xft_LIB}) + target_link_libraries(${tname} ${X11_Xft_LIB}) endif(USE_XFT) if(HAVE_XINERAMA) - target_link_libraries(${NAME} ${X11_Xinerama_LIB}) + target_link_libraries(${tname} ${X11_Xinerama_LIB}) endif(HAVE_XINERAMA) # install the example - install(TARGETS ${NAME} + install(TARGETS ${tname} DESTINATION ${FLTK_EXAMPLES_PATH} ) |
