diff options
| author | Albrecht Schlosser <albrechts.fltk@online.de> | 2014-10-09 16:11:36 +0000 |
|---|---|---|
| committer | Albrecht Schlosser <albrechts.fltk@online.de> | 2014-10-09 16:11:36 +0000 |
| commit | 982e6ffb2c9a21ccde85e477d98e5cfae43044cd (patch) | |
| tree | 69e38cd7207779102f809cf44424342c105ca524 | |
| parent | cb6cc2d5a9e4c9684011b81c3d48365651545a0c (diff) | |
CMake: rename reserved target name "help" (CMake 2.8.12 and later).
The executable built is still help(.exe).
git-svn-id: file:///fltk/svn/fltk/branches/branch-1.3@10370 ea41ed52-d2ee-0310-a9c1-e6b18d33e121
| -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} ) |
