diff --git a/CMake/cmake/modules/CreateSingleSourceCGALProgram.cmake b/CMake/cmake/modules/CreateSingleSourceCGALProgram.cmake index 431d221822c..7196829f7b8 100644 --- a/CMake/cmake/modules/CreateSingleSourceCGALProgram.cmake +++ b/CMake/cmake/modules/CreateSingleSourceCGALProgram.cmake @@ -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() diff --git a/CMake/cmake/modules/CreateSingleSourceCGALQt3Program.cmake b/CMake/cmake/modules/CreateSingleSourceCGALQt3Program.cmake index 851fae6eaf9..c183118bfb7 100644 --- a/CMake/cmake/modules/CreateSingleSourceCGALQt3Program.cmake +++ b/CMake/cmake/modules/CreateSingleSourceCGALQt3Program.cmake @@ -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() diff --git a/CMake/cmake/modules/CreateSingleSourceCGALQt4Program.cmake b/CMake/cmake/modules/CreateSingleSourceCGALQt4Program.cmake index ba368d75320..91e158f4b67 100644 --- a/CMake/cmake/modules/CreateSingleSourceCGALQt4Program.cmake +++ b/CMake/cmake/modules/CreateSingleSourceCGALQt4Program.cmake @@ -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()