2002-01-20 05:24:55 +03:00
|
|
|
#
|
|
|
|
# Wrapping
|
|
|
|
#
|
2008-03-25 18:27:18 +03:00
|
|
|
cmake_minimum_required (VERSION 2.6)
|
2012-08-13 21:47:32 +04:00
|
|
|
project (Wrapping)
|
2002-01-20 05:24:55 +03:00
|
|
|
|
2005-02-09 19:40:01 +03:00
|
|
|
# Disable cleaning of custom command outputs to preserve the hacks
|
|
|
|
# used to generate the files using CONFIGURE_FILE.
|
2012-08-13 21:47:32 +04:00
|
|
|
set_directory_properties(PROPERTIES CLEAN_NO_CUSTOM 1)
|
2005-02-09 19:40:01 +03:00
|
|
|
|
2002-01-20 05:24:55 +03:00
|
|
|
#
|
|
|
|
# Lib and exe path
|
|
|
|
#
|
2012-08-13 21:47:32 +04:00
|
|
|
set (LIBRARY_OUTPUT_PATH
|
2012-08-13 21:42:58 +04:00
|
|
|
${Wrapping_BINARY_DIR}/bin/ CACHE INTERNAL
|
2003-07-30 21:28:32 +04:00
|
|
|
"Single output directory for building all libraries.")
|
2002-01-20 05:24:55 +03:00
|
|
|
|
2012-08-13 21:47:32 +04:00
|
|
|
set (EXECUTABLE_OUTPUT_PATH
|
2012-08-13 21:42:58 +04:00
|
|
|
${Wrapping_BINARY_DIR}/bin/ CACHE INTERNAL
|
2003-07-30 21:28:32 +04:00
|
|
|
"Single output directory for building all executables.")
|
2002-01-20 05:24:55 +03:00
|
|
|
|
|
|
|
#
|
|
|
|
# Where will executable tests be written ?
|
|
|
|
#
|
2012-08-13 21:47:32 +04:00
|
|
|
if (EXECUTABLE_OUTPUT_PATH)
|
|
|
|
set (CXX_TEST_PATH ${EXECUTABLE_OUTPUT_PATH})
|
2012-08-13 21:50:14 +04:00
|
|
|
else ()
|
2012-08-13 21:47:32 +04:00
|
|
|
set (CXX_TEST_PATH .)
|
2012-08-13 21:50:14 +04:00
|
|
|
endif ()
|
2002-01-20 05:24:55 +03:00
|
|
|
|
2002-01-20 08:11:19 +03:00
|
|
|
#
|
|
|
|
# Add exe
|
|
|
|
#
|
2012-08-13 21:47:32 +04:00
|
|
|
add_executable (wrapping wrapping.cxx)
|
2002-01-20 05:24:55 +03:00
|
|
|
|
2012-08-13 21:47:32 +04:00
|
|
|
add_executable (Wrap Wrap.c)
|
|
|
|
if(WIN32)
|
|
|
|
set(EXE_EXT ".exe")
|
2012-08-13 21:50:14 +04:00
|
|
|
endif()
|
2012-08-13 21:47:32 +04:00
|
|
|
set(WRAP ${EXECUTABLE_OUTPUT_PATH}/${CMAKE_CFG_INTDIR}/Wrap${EXE_EXT})
|
2003-07-30 21:11:04 +04:00
|
|
|
|
2002-01-20 09:06:09 +03:00
|
|
|
#
|
2012-08-28 13:22:17 +04:00
|
|
|
# Qt Wrappers
|
2002-01-20 09:06:09 +03:00
|
|
|
#
|
2002-09-12 00:41:46 +04:00
|
|
|
|
2012-08-13 21:47:32 +04:00
|
|
|
set (QT_WRAP_CPP "On")
|
|
|
|
set (QT_MOC_EXE "echo")
|
|
|
|
include( FindQt3 )
|
2002-09-12 21:20:05 +04:00
|
|
|
|
2012-08-13 21:47:32 +04:00
|
|
|
if (QT_FOUND AND QT_WRAP_UI)
|
2012-08-28 13:22:17 +04:00
|
|
|
message("found Qt 3 test it...")
|
2012-08-13 21:47:32 +04:00
|
|
|
include_directories( ${QT_INCLUDE_DIR} )
|
|
|
|
include_directories( ${CMAKE_CURRENT_BINARY_DIR} )
|
2002-09-12 21:20:05 +04:00
|
|
|
|
2002-09-12 00:41:46 +04:00
|
|
|
|
2012-08-13 21:47:32 +04:00
|
|
|
configure_file(${CMAKE_CURRENT_SOURCE_DIR}/foo.ui.in
|
2013-11-13 12:50:56 +04:00
|
|
|
${CMAKE_CURRENT_BINARY_DIR}/foo.ui)
|
2002-09-12 00:41:46 +04:00
|
|
|
|
2012-08-13 21:47:32 +04:00
|
|
|
set (QT_WRAP_UI "On")
|
|
|
|
set (QT_UIC_EXE "${QT_UIC_EXECUTABLE}")
|
2003-09-25 01:51:13 +04:00
|
|
|
|
|
|
|
|
2012-08-13 21:47:32 +04:00
|
|
|
set (QTUI_SRCS
|
2003-07-30 21:28:32 +04:00
|
|
|
qtwrapping.ui
|
|
|
|
${CMAKE_CURRENT_BINARY_DIR}/foo.ui
|
|
|
|
)
|
2012-08-13 21:47:32 +04:00
|
|
|
qt_wrap_ui (myqtlib QTUI_H_SRCS QTUI_S_SRCS ${QTUI_SRCS})
|
|
|
|
qt_wrap_cpp (myqtlib QT_MOC_SRCS ${SRCS} vtkTestMoc.h)
|
2002-01-20 09:06:09 +03:00
|
|
|
|
2012-08-28 13:22:17 +04:00
|
|
|
message("Qt files are ${QTUI_S_SRCS}")
|
|
|
|
message("Qt other files are ${QTUI_H_SRCS}")
|
2012-08-13 21:47:32 +04:00
|
|
|
add_definitions(${QT_DEFINITIONS})
|
|
|
|
add_library(myqtlib ${QTUI_S_SRCS} ${QT_MOC_SRCS})
|
|
|
|
add_executable (qtwrapping qtwrappingmain.cxx)
|
|
|
|
target_link_libraries(qtwrapping myqtlib)
|
2002-01-20 09:06:09 +03:00
|
|
|
|
2012-08-13 21:47:32 +04:00
|
|
|
target_link_libraries( qtwrapping ${QT_LIBRARIES} )
|
2012-08-13 21:50:14 +04:00
|
|
|
else ()
|
2012-08-13 21:47:32 +04:00
|
|
|
add_executable (qtwrapping qtnoqtmain.cxx)
|
2012-08-13 21:50:14 +04:00
|
|
|
endif ()
|
2002-09-12 21:20:05 +04:00
|
|
|
|
2002-01-20 09:06:09 +03:00
|
|
|
#
|
|
|
|
# FLTK Wrappers
|
|
|
|
#
|
|
|
|
# Since FLTK_FLUID_EXE is supposed to create a .cxx/.h from a .fl/.fld,
|
|
|
|
# create an empty one so that the dependencies can be met.
|
|
|
|
#
|
2012-08-13 21:47:32 +04:00
|
|
|
add_executable(fakefluid fakefluid.cxx)
|
|
|
|
set (FLTK_WRAP_UI "On")
|
2013-11-18 20:49:20 +04:00
|
|
|
set (FLTK_FLUID_EXECUTABLE fakefluid)
|
2016-01-21 21:42:46 +03:00
|
|
|
fltk_wrap_ui (wraplibFLTK fltk1.fl)
|
2012-08-13 21:47:32 +04:00
|
|
|
add_library(wraplibFLTK ${wraplibFLTK_FLTK_UI_SRCS})
|
|
|
|
add_dependencies(wraplibFLTK fakefluid)
|
|
|
|
add_dependencies(fakefluid Wrap)
|
2016-01-21 21:42:46 +03:00
|
|
|
fltk_wrap_ui (wrapFLTK fltk2.fl)
|
2016-04-28 17:20:40 +03:00
|
|
|
add_executable(wrapFLTK wrapFLTK.cxx ${wrapFLTK_FLTK_UI_SRCS})
|
2016-01-21 21:42:46 +03:00
|
|
|
target_link_libraries(wrapFLTK wraplibFLTK)
|
|
|
|
add_dependencies(wrapFLTK fakefluid)
|
|
|
|
|
2002-01-20 09:06:09 +03:00
|
|
|
#
|
|
|
|
# Mangled Mesa
|
|
|
|
#
|
2012-08-13 21:47:32 +04:00
|
|
|
configure_file(
|
2002-03-26 22:42:10 +03:00
|
|
|
${Wrapping_SOURCE_DIR}/dummy
|
|
|
|
${Wrapping_BINARY_DIR}/gl.h
|
2013-11-13 12:50:56 +04:00
|
|
|
COPYONLY)
|
2012-08-13 21:47:32 +04:00
|
|
|
use_mangled_mesa (${Wrapping_BINARY_DIR} ${Wrapping_BINARY_DIR}/mangled_mesa)
|
2002-01-20 09:06:09 +03:00
|
|
|
|