mirror of https://github.com/CGAL/cgal
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:
parent
293a072b43
commit
2f6dae6bbb
|
|
@ -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} )
|
||||
|
|
|
|||
|
|
@ -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 )
|
||||
|
||||
|
|
|
|||
Loading…
Reference in New Issue