Skip to content

Commit

Permalink
fix build errors for boost/python and able to build w/o animlib
Browse files Browse the repository at this point in the history
  • Loading branch information
jberlin committed Jan 25, 2018
1 parent 24b4361 commit 8ef62bb
Show file tree
Hide file tree
Showing 4 changed files with 22 additions and 11 deletions.
2 changes: 1 addition & 1 deletion CMakeLists.txt
Expand Up @@ -88,7 +88,7 @@ set(LLVM_LIB "")
if (ENABLE_LLVM_BACKEND)
set(LLVM_DIR /usr/share/llvm/cmake CACHE PATH "Where to search for LLVM i.e. ")

find_package(LLVM CONFIG NAMES LLVM CONFIGS LLVMConfig.cmake)
find_package(LLVM CONFIG NAMES LLVM CONFIGS LLVM-Config.cmake LLVMConfig.cmake)
if (LLVM_FOUND)
set(SEEXPR_ENABLE_LLVM_BACKEND 1)
message(STATUS "Using LLVMConfig.cmake in: ${LLVM_DIR}")
Expand Down
6 changes: 5 additions & 1 deletion Makefile.config.example
Expand Up @@ -11,9 +11,13 @@ ifeq ($(uname_S),Linux)
EXTRA_CMAKE_ARGS += -DGTEST_DIR=/usr
endif

ifdef RP_animlib
# only build animlib if soure directory exists and env var set
CE_dir = $(wildcard "src/ui/CE")
ifneq ("$(CE_dir)", "")
ifdef RP_animlib
EXTRA_CMAKE_ARGS += -DANIMLIB_DIR=$(RP_animlib)
endif
endif

ifdef RP_boost_disney
EXTRA_CMAKE_ARGS += -DBOOST_DIR=$(RP_boost_disney)
Expand Down
4 changes: 3 additions & 1 deletion src/py/CMakeLists.txt
Expand Up @@ -75,12 +75,14 @@ if (USE_PYTHON)
if (NOT DEFINED BOOST_INCLUDE_DIR)
set(BOOST_INCLUDE_DIR ${BOOST_DIR}/include)
endif()
include_directories(SYSTEM ${BOOST_INCLUDE_DIR})
include_directories(SYSTEM ${BOOST_INCLUDE_DIR} ${PYTHON_INCLUDE_DIR})
message(STATUS "BOOST_INCLUDE_DIR = ${BOOST_INCLUDE_DIR}")

if (NOT DEFINED BOOST_LIB_DIR)
set(BOOST_LIB_DIR ${BOOST_DIR}/${CMAKE_INSTALL_LIBDIR})
endif()
link_directories(${BOOST_LIB_DIR})
message(STATUS "BOOST_LIB_DIR = ${BOOST_LIB_DIR}")

include_directories(../SeExpr/parser)
add_library(core SHARED SeExprPy.cpp ../SeExpr/parser/SeExprParse.cpp ../SeExpr/parser/SeExprLex.cpp)
Expand Down
21 changes: 13 additions & 8 deletions src/ui/CMakeLists.txt
Expand Up @@ -34,15 +34,18 @@ if (EXISTS "/usr/share/apps/cmake/modules")
list(APPEND CMAKE_MODULE_PATH "/usr/share/apps/cmake/modules")
endif()

if (NOT DEFINED PYQT_SIP_DIR)
message(FATAL_ERROR "PYQT_SIP_DIR must be defined")
endif()

if (NOT DEFINED PYQT_SIP_FLAGS)
get_build_info(pyqt-sip-flags PYQT_SIP_FLAGS)
separate_arguments(PYQT_SIP_FLAGS)
endif()

if (NOT DEFINED PYQT_SIP_DIR)
get_build_info(pyqt4-sip PYQT_SIP_DIR)
if (NOT DEFINED PYQT_SIP_DIR)
message(FATAL_ERROR "PYQT_SIP_DIR must be defined")
endif()
endif()

set(CMAKE_INSTALL_PYTHON "${PYTHON_SITE}/SeExpr2" )

# Other package dependencies...
Expand Down Expand Up @@ -73,6 +76,7 @@ if(Qt5_FOUND OR QT4_FOUND)
qt4_wrap_cpp(EDITOR_MOC_SRCS ${EDITOR_MOC_HDRS})
endif()

set(ANIMLIB_SRCS "")
if (DEFINED ANIMLIB_DIR)
set(CE_MOC_HDRS CE/CECurveListUI.h CE/CEDragHandlers.h CE/CEGraphCurve.h
CE/CEGraphKey.h CE/CEGraphSeg.h CE/CEGraphUI.h CE/CEMainUI.h
Expand All @@ -87,11 +91,12 @@ if(Qt5_FOUND OR QT4_FOUND)
else()
qt4_wrap_cpp(CE_MOC_SRCS ${CE_MOC_HDRS})
endif()
set(ANIMLIB_SRCS "${CE_CPPS} ${CE_MOC_SRCS}")
endif()

if (WIN32)
add_library(SeExpr2Editor ${EDITOR_CPPS} ${EDITOR_MOC_SRCS}
${CE_CPPS} ${CE_MOC_SRCS}
${ANIMLIB_SRCS}
${editor_parser_cpp})
generate_export_header(SeExpr2Editor
BASE_NAME SeExpr2Editor
Expand All @@ -100,12 +105,11 @@ if(Qt5_FOUND OR QT4_FOUND)
STATIC_DEFINE SeExpr2Editor_BUILT_AS_STATIC )
else()
add_library(SeExpr2Editor SHARED ${EDITOR_CPPS} ${EDITOR_MOC_SRCS}
${CE_CPPS} ${CE_MOC_SRCS}
${ANIMLIB_SRCS}
${editor_parser_cpp})
endif()

include_directories(${CMAKE_CURRENT_SOURCE_DIR}
${CMAKE_CURRENT_SOURCE_DIR}/CE)
include_directories(${CMAKE_CURRENT_SOURCE_DIR})
target_link_libraries(SeExpr2Editor SeExpr2)

if (ENABLE_QT5)
Expand All @@ -122,6 +126,7 @@ if(Qt5_FOUND OR QT4_FOUND)
target_link_libraries(SeExpr2Editor ${GLUT_LIBRARY})

if (DEFINED ANIMLIB_DIR)
include_directories(${CMAKE_CURRENT_SOURCE_DIR}/CE)
target_link_libraries(SeExpr2Editor animlib)
endif()

Expand Down

0 comments on commit 8ef62bb

Please sign in to comment.