Make CreateSingleSourceCGALProgram work even if some demos/examples are in dont_submit.

This commit is contained in:
Laurent Rineau 2008-02-25 14:08:24 +00:00
parent adf6f9ea52
commit af7d2be6db
3 changed files with 81 additions and 75 deletions

View File

@ -1,30 +1,32 @@
macro(create_single_source_cgal_program first )
set( all ${first} )
foreach( i ${ARGN} )
set( all ${all} ${i} )
endforeach()
get_filename_component(exe_name ${first} NAME_WE)
add_executable (${exe_name} ${all})
#add_dependencies(${exe_name} CGAL CGAL_CORE)
if(EXISTS ${first})
set( all ${first} )
# Link the executable to CGAL and third-party libraries
if ( NOT AUTO_LINK_ENABLED )
target_link_libraries(${exe_name} ${CGAL_LIBRARIES} ${CGAL_3RD_PARTY_LIBRARIES})
endif()
# TODO: get test parameters from ${exe_name}.cmd
#set ( test_args )
#
#if ( EXISTS ${exe_name}.cmd )
# file( READ ${exe_name}.cmd ${test_args} )
# message( STATUS "Command line arguments for ${exe_name}: ${test_args} )
#endif()
#
#add_test( ${exe_name} ${exe_name} ${ARGS} )
foreach( i ${ARGN} )
set( all ${all} ${i} )
endforeach()
get_filename_component(exe_name ${first} NAME_WE)
add_executable (${exe_name} ${all})
#add_dependencies(${exe_name} CGAL CGAL_CORE)
# Link the executable to CGAL and third-party libraries
if ( NOT AUTO_LINK_ENABLED )
target_link_libraries(${exe_name} ${CGAL_LIBRARIES} ${CGAL_3RD_PARTY_LIBRARIES})
endif()
# TODO: get test parameters from ${exe_name}.cmd
#set ( test_args )
#
#if ( EXISTS ${exe_name}.cmd )
# file( READ ${exe_name}.cmd ${test_args} )
# message( STATUS "Command line arguments for ${exe_name}: ${test_args} )
#endif()
#
#add_test( ${exe_name} ${exe_name} ${ARGS} )
endif(EXISTS ${first})
endmacro()

View File

@ -1,33 +1,35 @@
macro(create_single_source_cgal_qt3_program first )
set( all ${first} )
foreach( i ${ARGN} )
set( all ${all} ${i} )
endforeach()
get_filename_component(exe_name ${first} NAME_WE)
QT3_AUTOMOC( ${all} )
# Make sure the compiler can find generated .moc files
include_directories(BEFORE ${CMAKE_CURRENT_BINARY_DIR})
include_directories(BEFORE ${CMAKE_CURRENT_SOURCE_DIR})
include_directories( ${QT_INCLUDE_DIR} )
add_executable (${exe_name} ${all})
add_dependencies(${exe_name} CGAL CGAL_QT)
if ( CGAL_USE_CGAL_CORE )
add_dependencies(${exe_name} CGAL_CORE)
endif()
if(EXISTS ${first})
set( all ${first} )
# Link the executable to CGAL and third-party libraries
if ( AUTO_LINK_ENABLED )
target_link_libraries(${exe_name} ${CGAL_3RD_PARTY_LIBRARIES} ${QT_LIBRARIES} )
else()
target_link_libraries(${exe_name} ${CGAL_LIBRARIES} ${CGAL_QT_LIBRARIES} ${CGAL_3RD_PARTY_LIBRARIES} ${QT_LIBRARIES})
endif()
foreach( i ${ARGN} )
set( all ${all} ${i} )
endforeach()
get_filename_component(exe_name ${first} NAME_WE)
QT3_AUTOMOC( ${all} )
# Make sure the compiler can find generated .moc files
include_directories(BEFORE ${CMAKE_CURRENT_BINARY_DIR})
include_directories(BEFORE ${CMAKE_CURRENT_SOURCE_DIR})
include_directories( ${QT_INCLUDE_DIR} )
add_executable (${exe_name} ${all})
add_dependencies(${exe_name} CGAL CGAL_QT)
if ( CGAL_USE_CGAL_CORE )
add_dependencies(${exe_name} CGAL_CORE)
endif()
# Link the executable to CGAL and third-party libraries
if ( AUTO_LINK_ENABLED )
target_link_libraries(${exe_name} ${CGAL_3RD_PARTY_LIBRARIES} ${QT_LIBRARIES} )
else()
target_link_libraries(${exe_name} ${CGAL_LIBRARIES} ${CGAL_QT_LIBRARIES} ${CGAL_3RD_PARTY_LIBRARIES} ${QT_LIBRARIES})
endif()
endif(EXISTS ${first})
endmacro()

View File

@ -1,29 +1,31 @@
macro(create_single_source_cgal_qt4_program first )
set( all ${first} )
if(EXISTS ${first})
set( all ${first} )
foreach( i ${ARGN} )
set( all ${all} ${i} )
endforeach()
get_filename_component(exe_name ${first} NAME_WE)
QT4_AUTOMOC( ${all} )
# Make sure the compiler can find generated .moc files
include_directories(BEFORE ${CMAKE_CURRENT_BINARY_DIR})
include_directories(BEFORE ${CMAKE_CURRENT_SOURCE_DIR})
add_executable (${exe_name} ${all})
add_dependencies(${exe_name} CGAL CGAL_CORE)
foreach( i ${ARGN} )
set( all ${all} ${i} )
endforeach()
# Link the executable to CGAL and third-party libraries
if ( NOT AUTO_LINK_ENABLED )
target_link_libraries(${exe_name} ${CGAL_LIBRARIES} ${QT_LIBRARIES} ${CGAL_3RD_PARTY_LIBRARIES})
endif()
get_filename_component(exe_name ${first} NAME_WE)
QT4_AUTOMOC( ${all} )
# Make sure the compiler can find generated .moc files
include_directories(BEFORE ${CMAKE_CURRENT_BINARY_DIR})
include_directories(BEFORE ${CMAKE_CURRENT_SOURCE_DIR})
add_executable (${exe_name} ${all})
add_dependencies(${exe_name} CGAL CGAL_CORE)
# Link the executable to CGAL and third-party libraries
if ( NOT AUTO_LINK_ENABLED )
target_link_libraries(${exe_name} ${CGAL_LIBRARIES} ${QT_LIBRARIES} ${CGAL_3RD_PARTY_LIBRARIES})
endif()
# Add " make test" rule for executable
# TODO: get test parameters from ${exe_name}.cmd
# add_test(${exe_name} ${exe_name})
# Add " make test" rule for executable
# TODO: get test parameters from ${exe_name}.cmd
# add_test(${exe_name} ${exe_name})
endif(EXISTS ${first})
endmacro()