mirror of https://github.com/CGAL/cgal
fix to build demos and example properly, and even out-of-source now
This commit is contained in:
parent
9bcf77ab04
commit
4d457ba1ad
|
|
@ -17,9 +17,17 @@ foreach( entry ${list} )
|
|||
if ( IS_DIRECTORY ${entry} )
|
||||
|
||||
if ( EXISTS ${entry}/CMakeLists.txt )
|
||||
message( STATUS "Configuring ${entry} demo" )
|
||||
add_subdirectory( ${entry} )
|
||||
endif()
|
||||
|
||||
message( STATUS "Configuring demo in ${entry}" )
|
||||
|
||||
if( NOT "${CMAKE_SOURCE_DIR}" STREQUAL "${CMAKE_BINARY_DIR}") # out-of-source
|
||||
string( REGEX REPLACE "${CMAKE_SOURCE_DIR}/.*/demo/" "" DEMO_DIR "${entry}" )
|
||||
make_directory(${CMAKE_BINARY_DIR}/demo/${DEMO_DIR})
|
||||
endif()
|
||||
|
||||
add_subdirectory( ${entry} ${CMAKE_BINARY_DIR}/demo/${DEMO_DIR} )
|
||||
|
||||
Endif()
|
||||
|
||||
endif()
|
||||
|
||||
|
|
|
|||
|
|
@ -17,8 +17,16 @@ foreach( entry ${list} )
|
|||
if ( IS_DIRECTORY ${entry} )
|
||||
|
||||
if ( EXISTS ${entry}/CMakeLists.txt )
|
||||
message( STATUS "Configuring ${entry} example" )
|
||||
add_subdirectory( ${entry} )
|
||||
|
||||
message( STATUS "Configuring examples in ${entry}" )
|
||||
|
||||
if( NOT "${CMAKE_SOURCE_DIR}" STREQUAL "${CMAKE_BINARY_DIR}") # out-of-source
|
||||
string( REGEX REPLACE "${CMAKE_SOURCE_DIR}/.*/examples/" "" DEMO_DIR "${entry}" )
|
||||
make_directory(${CMAKE_BINARY_DIR}/demo/${DEMO_DIR})
|
||||
endif()
|
||||
|
||||
add_subdirectory( ${entry} ${CMAKE_BINARY_DIR}/examples/${DEMO_DIR} )
|
||||
|
||||
endif()
|
||||
|
||||
endif()
|
||||
|
|
|
|||
Loading…
Reference in New Issue