Files
cgal/Installation/cmake/modules/CreateSingleSourceCGALProgram.cmake
T
Laurent Rineau da490ca698 Partially revert revision 45319. The follwing has been revert:
"Use unique names for example, demo and test targets"
2008-09-05 12:16:37 +00:00

28 lines
839 B
CMake

macro(create_single_source_cgal_program first )
if(EXISTS ${CMAKE_CURRENT_SOURCE_DIR}/${first})
set( all ${CMAKE_CURRENT_SOURCE_DIR}/${first} )
foreach( i ${ARGN} )
set( all ${all} ${CMAKE_CURRENT_SOURCE_DIR}/${i} )
endforeach()
get_filename_component(exe_name ${first} NAME_WE)
add_executable(${exe_name} ${all})
set( CGAL_EXECUTABLE_TARGETS )
set( CGAL_EXECUTABLE_TARGETS "${CGAL_EXECUTABLE_TARGETS}" "${exe_name}" CACHE INTERNAL "" FORCE )
# Link the executable to CGAL and third-party libraries
if ( AUTO_LINK_ENABLED )
target_link_libraries(${exe_name} ${CGAL_3RD_PARTY_LIBRARIES} )
else()
target_link_libraries(${exe_name} ${CGAL_3RD_PARTY_LIBRARIES} ${CGAL_LIBRARIES} )
endif()
endif()
endmacro()