mirror of https://github.com/CGAL/cgal
Fix pending problems with examples and demos (now possible to do 'make examples' or 'make demo' from CGAL_DIR)
This commit is contained in:
parent
3fa4fad3af
commit
41251065c2
|
|
@ -71,6 +71,7 @@ message( STATUS "CGAL_MINOR_VERSION=${CGAL_MINOR_VERSION}" )
|
||||||
message( STATUS "CGAL_BUILD_VERSION=${CGAL_BUILD_VERSION}" )
|
message( STATUS "CGAL_BUILD_VERSION=${CGAL_BUILD_VERSION}" )
|
||||||
|
|
||||||
set( CGAL_SOVERSION "3.0.0" )
|
set( CGAL_SOVERSION "3.0.0" )
|
||||||
|
|
||||||
message( STATUS "CGAL_SOVERSION=${CGAL_SOVERSION}" )
|
message( STATUS "CGAL_SOVERSION=${CGAL_SOVERSION}" )
|
||||||
|
|
||||||
#--------------------------------------------------------------------------------------------------
|
#--------------------------------------------------------------------------------------------------
|
||||||
|
|
@ -79,10 +80,10 @@ message( STATUS "CGAL_SOVERSION=${CGAL_SOVERSION}" )
|
||||||
#
|
#
|
||||||
#--------------------------------------------------------------------------------------------------
|
#--------------------------------------------------------------------------------------------------
|
||||||
|
|
||||||
set(CGAL_3RD_PARTY_DEFINITIONS "" CACHE INTERNAL "" )
|
cache_set(CGAL_3RD_PARTY_DEFINITIONS "" )
|
||||||
set(CGAL_3RD_PARTY_INCLUDE_DIRS "" CACHE INTERNAL "" )
|
cache_set(CGAL_3RD_PARTY_INCLUDE_DIRS "" )
|
||||||
set(CGAL_3RD_PARTY_LIBRARIES "" CACHE INTERNAL "" )
|
cache_set(CGAL_3RD_PARTY_LIBRARIES "" )
|
||||||
set(CGAL_3RD_PARTY_LIBRARIES_DIR "" CACHE INTERNAL "" )
|
cache_set(CGAL_3RD_PARTY_LIBRARIES_DIR "" )
|
||||||
|
|
||||||
|
|
||||||
# This module finds dependent libraries: Boost, GMP, CORE, etc..
|
# This module finds dependent libraries: Boost, GMP, CORE, etc..
|
||||||
|
|
@ -126,9 +127,9 @@ foreach(config_test_cpp ${all_config_tests})
|
||||||
CHECK_CXX_FILE_RUNS(${config_test_cpp} ${config_test_name} ${config_test_name})
|
CHECK_CXX_FILE_RUNS(${config_test_cpp} ${config_test_name} ${config_test_name})
|
||||||
|
|
||||||
if ( ${config_test_name} )
|
if ( ${config_test_name} )
|
||||||
set ( ${config_test_name} 0 CACHE INTERNAL "" FORCE )
|
cache_set ( ${config_test_name} 0 )
|
||||||
else()
|
else()
|
||||||
set ( ${config_test_name} 1 CACHE INTERNAL "" FORCE )
|
cache_set ( ${config_test_name} 1 )
|
||||||
endif()
|
endif()
|
||||||
|
|
||||||
endif()
|
endif()
|
||||||
|
|
@ -213,8 +214,7 @@ endif()
|
||||||
|
|
||||||
set(CGAL_LIBRARIES_DIR ${CMAKE_BINARY_DIR}/lib)
|
set(CGAL_LIBRARIES_DIR ${CMAKE_BINARY_DIR}/lib)
|
||||||
|
|
||||||
set(CGAL_LIBRARIES "" CACHE STRING "Selected CGAL Libraries")
|
cache_set(CGAL_LIBRARIES "" )
|
||||||
hide_variable(CGAL_LIBRARIES)
|
|
||||||
|
|
||||||
set(CGAL_INCLUDE_DIRS ${CMAKE_BINARY_DIR}/include ${CMAKE_SOURCE_DIR}/include)
|
set(CGAL_INCLUDE_DIRS ${CMAKE_BINARY_DIR}/include ${CMAKE_SOURCE_DIR}/include)
|
||||||
|
|
||||||
|
|
@ -238,13 +238,10 @@ include(CGAL_SetupFlags)
|
||||||
|
|
||||||
add_subdirectory(src)
|
add_subdirectory(src)
|
||||||
|
|
||||||
#
|
cache_get(CGAL_3RD_PARTY_DEFINITIONS )
|
||||||
# load cache values from subdirectories above
|
cache_get(CGAL_3RD_PARTY_INCLUDE_DIRS )
|
||||||
#
|
cache_get(CGAL_3RD_PARTY_LIBRARIES )
|
||||||
set(CGAL_3RD_PARTY_DEFINITIONS )
|
cache_get(CGAL_3RD_PARTY_LIBRARIES_DIR)
|
||||||
set(CGAL_3RD_PARTY_INCLUDE_DIRS )
|
|
||||||
set(CGAL_3RD_PARTY_LIBRARIES )
|
|
||||||
set(CGAL_3RD_PARTY_LIBRARIES_DIR)
|
|
||||||
|
|
||||||
|
|
||||||
set( CGAL_LIBRARIES ${CGAL_CORE_LIBRARY} ${CGAL_LIBRARY} ${CGAL_IMAGEIO_LIBRARY} ${CGAL_PDB_LIBRARY} ${CGAL_QT_LIBRARY} )
|
set( CGAL_LIBRARIES ${CGAL_CORE_LIBRARY} ${CGAL_LIBRARY} ${CGAL_IMAGEIO_LIBRARY} ${CGAL_PDB_LIBRARY} ${CGAL_QT_LIBRARY} )
|
||||||
|
|
@ -328,14 +325,29 @@ endif()
|
||||||
#
|
#
|
||||||
#--------------------------------------------------------------------------------------------------
|
#--------------------------------------------------------------------------------------------------
|
||||||
|
|
||||||
|
macro( add_programs subdir ON_OFF )
|
||||||
|
|
||||||
|
cache_set( CGAL_EXECUTABLES "" )
|
||||||
|
|
||||||
|
add_custom_target( ${subdir} )
|
||||||
|
|
||||||
|
optional_add_subdirectory( ${subdir} ${ON_OFF} EXCLUDE_FROM_ALL )
|
||||||
|
|
||||||
|
cache_get( CGAL_EXECUTABLES )
|
||||||
|
|
||||||
|
foreach( CGAL_EXECUTABLE in ${CGAL_EXECUTABLES} )
|
||||||
|
add_dependencies( ${subdir} ${CGAL_EXECUTABLE} )
|
||||||
|
endforeach()
|
||||||
|
|
||||||
|
endmacro()
|
||||||
|
|
||||||
# This allows programs to locate CGALConfig.cmake
|
# This allows programs to locate CGALConfig.cmake
|
||||||
set(CGAL_DIR ${CMAKE_BINARY_DIR} )
|
set(CGAL_DIR ${CMAKE_BINARY_DIR} )
|
||||||
|
|
||||||
if ( NOT RUNNING_CGAL_AUTO_TEST )
|
if ( NOT RUNNING_CGAL_AUTO_TEST )
|
||||||
|
|
||||||
optional_add_subdirectory( demo OFF EXCLUDE_FROM_ALL )
|
add_programs(examples ON )
|
||||||
optional_add_subdirectory( examples ON EXCLUDE_FROM_ALL )
|
add_programs(demo OFF )
|
||||||
|
|
||||||
endif()
|
endif()
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -24,6 +24,19 @@ if( NOT CGAL_COMMON_FILE_INCLUDED )
|
||||||
set ( ${var} ${${var}} CACHE INTERNAL "Variable hidden from user" FORCE )
|
set ( ${var} ${${var}} CACHE INTERNAL "Variable hidden from user" FORCE )
|
||||||
endmacro()
|
endmacro()
|
||||||
|
|
||||||
|
macro( cache_set var value )
|
||||||
|
set ( ${var} ${value} CACHE INTERNAL "" FORCE )
|
||||||
|
endmacro()
|
||||||
|
|
||||||
|
macro( cache_get var )
|
||||||
|
set ( ${var} )
|
||||||
|
endmacro()
|
||||||
|
|
||||||
|
macro( add_to_cached_list listname item )
|
||||||
|
cache_get ( ${listname} )
|
||||||
|
cache_set ( ${listname} "${${listname}};${item}" )
|
||||||
|
endmacro()
|
||||||
|
|
||||||
macro( at list idx var )
|
macro( at list idx var )
|
||||||
list( LENGTH ${list} ${list}_length )
|
list( LENGTH ${list} ${list}_length )
|
||||||
if ( ${idx} LESS ${${list}_length} )
|
if ( ${idx} LESS ${${list}_length} )
|
||||||
|
|
|
||||||
|
|
@ -1,16 +1,19 @@
|
||||||
macro(create_single_source_cgal_program first )
|
macro(create_single_source_cgal_program first )
|
||||||
|
|
||||||
if(EXISTS ${CMAKE_SOURCE_DIR}/${first})
|
if(EXISTS ${CMAKE_CURRENT_SOURCE_DIR}/${first})
|
||||||
set( all ${CMAKE_SOURCE_DIR}/${first} )
|
|
||||||
|
set( all ${CMAKE_CURRENT_SOURCE_DIR}/${first} )
|
||||||
|
|
||||||
foreach( i ${ARGN} )
|
foreach( i ${ARGN} )
|
||||||
set( all ${all} ${CMAKE_SOURCE_DIR}/${i} )
|
set( all ${all} ${CMAKE_CURRENT_SOURCE_DIR}/${i} )
|
||||||
endforeach()
|
endforeach()
|
||||||
|
|
||||||
get_filename_component(exe_name ${first} NAME_WE)
|
get_filename_component(exe_name ${first} NAME_WE)
|
||||||
|
|
||||||
add_executable (${exe_name} ${all})
|
add_executable(${exe_name} ${all})
|
||||||
|
|
||||||
|
add_to_cached_list( CGAL_EXECUTABLES ${exe_name} )
|
||||||
|
|
||||||
# Link the executable to CGAL and third-party libraries
|
# Link the executable to CGAL and third-party libraries
|
||||||
if ( AUTO_LINK_ENABLED )
|
if ( AUTO_LINK_ENABLED )
|
||||||
target_link_libraries(${exe_name} ${CGAL_3RD_PARTY_LIBRARIES} )
|
target_link_libraries(${exe_name} ${CGAL_3RD_PARTY_LIBRARIES} )
|
||||||
|
|
|
||||||
|
|
@ -1,10 +1,10 @@
|
||||||
macro(create_single_source_cgal_qt3_program first )
|
macro(create_single_source_cgal_qt3_program first )
|
||||||
|
|
||||||
if(EXISTS ${CMAKE_SOURCE_DIR}/${first})
|
if(EXISTS ${CMAKE_CURRENT_SOURCE_DIR}/${first})
|
||||||
set( all ${CMAKE_SOURCE_DIR}/${first} )
|
set( all ${CMAKE_CURRENT_SOURCE_DIR}/${first} )
|
||||||
|
|
||||||
foreach( i ${ARGN} )
|
foreach( i ${ARGN} )
|
||||||
set( all ${all} ${CMAKE_SOURCE_DIR}/${i} )
|
set( all ${all} ${CMAKE_CURRENT_SOURCE_DIR}/${i} )
|
||||||
endforeach()
|
endforeach()
|
||||||
|
|
||||||
get_filename_component(exe_name ${first} NAME_WE)
|
get_filename_component(exe_name ${first} NAME_WE)
|
||||||
|
|
@ -18,6 +18,8 @@ macro(create_single_source_cgal_qt3_program first )
|
||||||
include_directories( ${QT_INCLUDE_DIR} )
|
include_directories( ${QT_INCLUDE_DIR} )
|
||||||
|
|
||||||
add_executable (${exe_name} ${all})
|
add_executable (${exe_name} ${all})
|
||||||
|
|
||||||
|
add_to_cached_list( CGAL_EXECUTABLES ${exe_name} )
|
||||||
|
|
||||||
# Link the executable to CGAL and third-party libraries
|
# Link the executable to CGAL and third-party libraries
|
||||||
if ( AUTO_LINK_ENABLED )
|
if ( AUTO_LINK_ENABLED )
|
||||||
|
|
|
||||||
|
|
@ -1,10 +1,10 @@
|
||||||
macro(create_single_source_cgal_qt4_program first )
|
macro(create_single_source_cgal_qt4_program first )
|
||||||
|
|
||||||
if(EXISTS ${CMAKE_SOURCE_DIR}/${first})
|
if(EXISTS ${CMAKE_CURRENT_SOURCE_DIR}/${first})
|
||||||
set( all ${CMAKE_SOURCE_DIR}/${first} )
|
set( all ${CMAKE_CURRENT_SOURCE_DIR}/${first} )
|
||||||
|
|
||||||
foreach( i ${ARGN} )
|
foreach( i ${ARGN} )
|
||||||
set( all ${all} ${CMAKE_SOURCE_DIR}/${i} )
|
set( all ${all} ${CMAKE_CURRENT_SOURCE_DIR}/${i} )
|
||||||
endforeach()
|
endforeach()
|
||||||
|
|
||||||
get_filename_component(exe_name ${first} NAME_WE)
|
get_filename_component(exe_name ${first} NAME_WE)
|
||||||
|
|
@ -17,6 +17,8 @@ macro(create_single_source_cgal_qt4_program first )
|
||||||
|
|
||||||
add_executable (${exe_name} ${all})
|
add_executable (${exe_name} ${all})
|
||||||
|
|
||||||
|
add_to_cached_list( CGAL_EXECUTABLES ${exe_name} )
|
||||||
|
|
||||||
# Link the executable to CGAL and third-party libraries
|
# Link the executable to CGAL and third-party libraries
|
||||||
if ( AUTO_LINK_ENABLED )
|
if ( AUTO_LINK_ENABLED )
|
||||||
target_link_libraries(${exe_name} ${CGAL_3RD_PARTY_LIBRARIES} ${QT_LIBRARIES} )
|
target_link_libraries(${exe_name} ${CGAL_3RD_PARTY_LIBRARIES} ${QT_LIBRARIES} )
|
||||||
|
|
|
||||||
|
|
@ -87,6 +87,8 @@ create_cmake_script()
|
||||||
|
|
||||||
echo "add_executable (${exe_name} ${all})"
|
echo "add_executable (${exe_name} ${all})"
|
||||||
echo
|
echo
|
||||||
|
echo "add_to_cached_list( CGAL_EXECUTABLES ${exe_name} )"
|
||||||
|
echo
|
||||||
|
|
||||||
echo '# Link the executable to CGAL and third-party libraries'
|
echo '# Link the executable to CGAL and third-party libraries'
|
||||||
echo 'if ( AUTO_LINK_ENABLED )'
|
echo 'if ( AUTO_LINK_ENABLED )'
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue