Commit 6083646b authored by David Partyka's avatar David Partyka

ENH: Apply changes to build QtTesting standalone.

parent 32adfdb9
CMAKE_MINIMUM_REQUIRED(VERSION 2.8)
PROJECT(QtTesting)
IF(NOT QT_FOUND)
FIND_PACKAGE(Qt4 REQUIRED)
INCLUDE( ${QT_USE_FILE} )
ENDIF()
IF(NOT DEFINED QT_TESTING_WITH_PYTHON)
OPTION(QT_TESTING_WITH_PYTHON "Enable Qt Testing with Python" OFF)
ENDIF()
IF(NOT DEFINED QtTesting_INSTALL_BIN_DIR)
SET(QtTesting_INSTALL_BIN_DIR bin)
ENDIF()
IF(NOT DEFINED QtTesting_INSTALL_LIB_DIR)
SET(QtTesting_INSTALL_LIB_DIR lib)
ENDIF()
IF(QT_TESTING_WITH_PYTHON)
INCLUDE(FindPythonLibs)
IF(NOT PythonLibs_FOUND)
FIND_PACKAGE(PythonLibs REQUIRED)
ENDIF()
IF(UNIX)
FIND_LIBRARY(PYTHON_UTIL_LIBRARY
......@@ -13,11 +35,11 @@ IF(QT_TESTING_WITH_PYTHON)
MARK_AS_ADVANCED(PYTHON_UTIL_LIBRARY)
IF(PYTHON_UTIL_LIBRARY)
SET(PYTHON_UTIL_LIBRARY_LIB ${PYTHON_UTIL_LIBRARY})
ENDIF(PYTHON_UTIL_LIBRARY)
ENDIF(UNIX)
ENDIF()
ENDIF()
INCLUDE_DIRECTORIES(
${VTK_INCLUDE_DIR}
# ${VTK_INCLUDE_DIR}
${PYTHON_INCLUDE_PATH}
)
SET(PYTHON_MOCS
......@@ -159,15 +181,15 @@ IF(QT_TESTING_WITH_PYTHON)
${PYTHON_LIBRARIES}
${PYTHON_UTIL_LIBRARY_LIB}
)
ENDIF(QT_TESTING_WITH_PYTHON)
ENDIF()
SET(QTTESTING_BUILD_SHARED_LIBS ${BUILD_SHARED_LIBS})
CONFIGURE_FILE(${QtTesting_SOURCE_DIR}/QtTestingConfigure.h.in
${QtTesting_BINARY_DIR}/QtTestingConfigure.h)
INSTALL(TARGETS QtTesting
RUNTIME DESTINATION ${PV_INSTALL_BIN_DIR} COMPONENT Runtime
LIBRARY DESTINATION ${PV_INSTALL_LIB_DIR} COMPONENT Runtime
ARCHIVE DESTINATION ${PV_INSTALL_LIB_DIR} COMPONENT Development)
RUNTIME DESTINATION ${QtTesting_INSTALL_BIN_DIR} COMPONENT Runtime
LIBRARY DESTINATION ${QtTesting_INSTALL_LIB_DIR} COMPONENT Runtime
ARCHIVE DESTINATION ${QtTesting_INSTALL_LIB_DIR} COMPONENT Development)
......@@ -30,9 +30,30 @@ SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
=========================================================================*/
// python header first
// TODO: Fix this so we don't depend on VTK
#include "vtkPython.h"
/*
Use the "documented" trick involving checking for _DEBUG
and undefined that symbol while we include Python headers.
Update: this method does not fool Microsoft Visual C++ 8 anymore; two
of its header files (crtdefs.h and use_ansi.h) check if _DEBUG was set
or not, and set flags accordingly (_CRT_MANIFEST_RETAIL,
_CRT_MANIFEST_DEBUG, _CRT_MANIFEST_INCONSISTENT). The next time the
check is performed in the same compilation unit, and the flags are found,
and error is triggered. Let's prevent that by setting _CRT_NOFORCE_MANIFEST.
*/
#ifdef _DEBUG
# undef _DEBUG
# if defined(_MSC_VER) && _MSC_VER >= 1400
# define _CRT_NOFORCE_MANIFEST 1
# endif
# include <Python.h>
# define _DEBUG
#else
# include <Python.h>
#endif
#ifndef PyMODINIT_FUNC
#define PyMODINIT_FUNC extern "C" void
#endif // PyMODINIT_FUNC
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment