From 2f6dae6bbb215a6b8df75bbed02ea1019215ecb0 Mon Sep 17 00:00:00 2001 From: Eric Berberich Date: Fri, 3 Aug 2012 12:57:04 +0000 Subject: [PATCH] now I got it: it's not just the first argument, it's the first file "first" is a little bit general name for a parameter, changed to firstfile and added a comment about handling other files --- .../CGAL_CreateSingleSourceCGALProgram.cmake | 14 ++++++++------ .../CGAL_CreateSingleSourceCGALProgramQt4.cmake | 13 +++++++------ 2 files changed, 15 insertions(+), 12 deletions(-) diff --git a/Installation/cmake/modules/CGAL_CreateSingleSourceCGALProgram.cmake b/Installation/cmake/modules/CGAL_CreateSingleSourceCGALProgram.cmake index cde9d2f1b1e..98ddbf5b672 100644 --- a/Installation/cmake/modules/CGAL_CreateSingleSourceCGALProgram.cmake +++ b/Installation/cmake/modules/CGAL_CreateSingleSourceCGALProgram.cmake @@ -1,18 +1,20 @@ -function(create_single_source_cgal_program file ) +function(create_single_source_cgal_program firstfile ) - if(NOT IS_ABSOLUTE "${file}") - set(file "${CMAKE_CURRENT_SOURCE_DIR}/${file}") + if(NOT IS_ABSOLUTE "${firstfile}") + set(file "${CMAKE_CURRENT_SOURCE_DIR}/${firstfile}") endif() - if(EXISTS "${file}") + if(EXISTS "${firstfile}") - set( all "${file}" ) + set( all "${firstfile}" ) + # remaining files foreach( i ${ARGN} ) set( all ${all} ${CMAKE_CURRENT_SOURCE_DIR}/${i} ) endforeach() - get_filename_component(exe_name ${file} NAME_WE) + + get_filename_component(exe_name ${firstfile} NAME_WE) add_executable(${exe_name} ${all}) add_to_cached_list( CGAL_EXECUTABLE_TARGETS ${exe_name} ) diff --git a/Installation/cmake/modules/CGAL_CreateSingleSourceCGALProgramQt4.cmake b/Installation/cmake/modules/CGAL_CreateSingleSourceCGALProgramQt4.cmake index b4da2538aac..2c3cbd0a614 100644 --- a/Installation/cmake/modules/CGAL_CreateSingleSourceCGALProgramQt4.cmake +++ b/Installation/cmake/modules/CGAL_CreateSingleSourceCGALProgramQt4.cmake @@ -1,14 +1,15 @@ -macro(create_single_source_cgal_program_qt4 file ) +macro(create_single_source_cgal_program_qt4 firstfile ) - if(EXISTS ${CMAKE_CURRENT_SOURCE_DIR}/${file}) + if(EXISTS ${CMAKE_CURRENT_SOURCE_DIR}/${firstfile}) - set( all ${CMAKE_CURRENT_SOURCE_DIR}/${file} ) + set( all ${CMAKE_CURRENT_SOURCE_DIR}/${firstfile} ) + # remaining files foreach( i ${ARGN} ) set( all ${all} ${CMAKE_CURRENT_SOURCE_DIR}/${i} ) endforeach() - - get_filename_component(exe_name ${file} NAME_WE) + + get_filename_component(exe_name ${firstfile} NAME_WE) # UI files (Qt Designer files) qt4_wrap_ui( DT_UI_FILES ${exe_name}.ui ) @@ -22,7 +23,7 @@ macro(create_single_source_cgal_program_qt4 file ) add_executable(${exe_name} ${all}) add_to_cached_list( CGAL_EXECUTABLE_TARGETS ${exe_name} ) - + # Link the executable to CGAL and third-party libraries if ( CGAL_AUTO_LINK_ENABLED )