This repository has been archived on 2023-08-20. You can view files and clone it, but cannot push or open issues or pull requests.
yap-6.3/packages/gecode/CMakeLists.txt

62 lines
1.9 KiB
CMake
Raw Normal View History

2014-12-14 12:05:43 +00:00
#TODO: change macro_log_feature to check both WITH_{$name} and ${name}_FOUND
#TODO: improve FindGecode.cmake to be similar to other Find*.cmake
#CHECK: GECODE
2014-12-14 12:05:43 +00:00
macro_optional_find_package (Gecode ON)
2015-02-03 02:37:25 +00:00
macro_log_feature (GECODE_FOUND "libgecode"
"Use Generic Constraint Development Environment (GECODE) library"
"http://www.gecode.org" FALSE)
2015-02-03 02:37:25 +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
2015-06-19 01:25:12 +01:00
add_library (gecode_yap SHARED ${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
2015-06-19 01:25:12 +01:00
set_target_properties (gecode_yap PROPERTIES PREFIX "")
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
2014-12-14 12:05:43 +00:00
LIBRARY DESTINATION ${dlls}
2016-01-20 22:25:25 +00:00
ARCHIVE DESTINATION ${dlls}
2014-12-14 12:05:43 +00:00
)
install(FILES gecode.yap
DESTINATION ${libpl}
)
install(FILES clpfd.yap
DESTINATION ${libpl}/gecode
)
endif (GECODE_FOUND)
2016-01-20 22:25:25 +00:00