2014-12-14 12:05:43 +00:00
|
|
|
|
2014-12-04 07:59:30 +00:00
|
|
|
#TODO: improve FindGecode.cmake to be similar to other Find*.cmake
|
|
|
|
#CHECK: GECODE
|
2014-12-14 12:05:43 +00:00
|
|
|
|
2014-12-04 07:59:30 +00:00
|
|
|
macro_optional_find_package (Gecode ON)
|
2015-02-03 02:37:25 +00:00
|
|
|
|
2014-12-04 07:59:30 +00:00
|
|
|
if (GECODE_FOUND)
|
|
|
|
#DEFINES:
|
|
|
|
# GECODE_INCLUDE_DIR
|
|
|
|
# GECODE_VERSION
|
|
|
|
# GECODE_LIBRARIES
|
|
|
|
|
|
|
|
#set (EXTRALIBS gecode)
|
|
|
|
|
2014-12-14 12:05:43 +00:00
|
|
|
string(SUBSTRING ${GECODE_VERSION} 0 1 GECODE_MAJOR )
|
|
|
|
|
2015-02-03 02:37:25 +00:00
|
|
|
set (GECODE_SOURCES gecode${GECODE_MAJOR}_yap.cc
|
2014-12-14 12:05:43 +00:00
|
|
|
gecode${GECODE_MAJOR}-common.icc
|
|
|
|
${GECODE_VERSION}/gecode_yap_cc_impl_auto_generated.icc
|
|
|
|
${GECODE_VERSION}/gecode_yap_cc_init_auto_generated.icc
|
|
|
|
${GECODE_VERSION}/gecode_yap_cc_forward_auto_generated.icc
|
|
|
|
disjunctor.icc
|
|
|
|
disjunctor.hh )
|
|
|
|
|
2015-06-19 01:25:12 +01:00
|
|
|
add_custom_target (gecodeyap ALL DEPENDS gecode${GECODE_MAJOR}_yap_hand_written.yap ${GECODE_VERSION}/gecode_yap_auto_generated.yap gecode_yap
|
2014-12-14 12:05:43 +00:00
|
|
|
) # WORKING_DIRECTORY ${CMAKE_BINARY_DIR} )
|
|
|
|
|
|
|
|
# create a startup.yss on the top directory.
|
|
|
|
add_custom_command (TARGET gecodeyap
|
|
|
|
COMMAND cat ${CMAKE_CURRENT_SOURCE_DIR}/gecode${GECODE_MAJOR}_yap_hand_written.yap ${CMAKE_CURRENT_SOURCE_DIR}/${GECODE_VERSION}/gecode_yap_auto_generated.yap > gecode.yap
|
|
|
|
VERBATIM
|
|
|
|
WORKING_DIRECTORY ${CMAKE_CURRENT_BINARY_DIR}
|
|
|
|
)
|
2015-02-03 02:37:25 +00:00
|
|
|
|
2017-09-06 01:09:46 +01:00
|
|
|
add_lib(gecode_yap ${GECODE_SOURCES})
|
2014-12-14 12:05:43 +00:00
|
|
|
|
2015-06-19 01:25:12 +01:00
|
|
|
target_link_libraries(gecode_yap libYap ${GECODE_LIBRARIES})
|
2014-12-14 12:05:43 +00:00
|
|
|
|
2017-05-19 09:53:58 +01:00
|
|
|
set_target_properties (gecode_yap PROPERTIES PREFIX "" CXX_STANDARD 11)
|
|
|
|
|
2014-12-14 12:05:43 +00:00
|
|
|
|
|
|
|
include_directories (${GECODE_INCLUDE_DIR} ${CMAKE_CURRENT_SOURCE_DIR} ${CMAKE_CURRENT_SOURCE_DIR}/${GECODE_VERSION})
|
2015-02-03 02:37:25 +00:00
|
|
|
|
2015-06-19 01:25:12 +01:00
|
|
|
install(TARGETS gecode_yap
|
2018-11-16 14:02:56 +00:00
|
|
|
LIBRARY DESTINATION ${YAP_INSTALL_LIBDIR}
|
|
|
|
RUNTIME DESTINATION ${YAP_INSTALL_LIBDIR}
|
|
|
|
ARCHIVE DESTINATION ${YAP_INSTALL_LIBDIR}
|
2014-12-14 12:05:43 +00:00
|
|
|
)
|
|
|
|
|
2016-12-16 09:37:59 +00:00
|
|
|
install(FILES ${CMAKE_CURRENT_BINARY_DIR}/gecode.yap
|
2018-11-16 14:02:56 +00:00
|
|
|
DESTINATION ${YAP_INSTALL_DATADIR}
|
2014-12-14 12:05:43 +00:00
|
|
|
)
|
|
|
|
|
|
|
|
install(FILES clpfd.yap
|
2018-11-16 14:02:56 +00:00
|
|
|
DESTINATION ${YAP_INSTALL_DATADIR}/gecode
|
2014-12-14 12:05:43 +00:00
|
|
|
)
|
|
|
|
|
2014-12-04 07:59:30 +00:00
|
|
|
endif (GECODE_FOUND)
|
2016-01-20 22:25:25 +00:00
|
|
|
|