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
This commit is contained in:
Eric Berberich 2012-08-03 12:57:04 +00:00
parent 293a072b43
commit 2f6dae6bbb
2 changed files with 15 additions and 12 deletions

View File

@ -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} )

View File

@ -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 )