Skip to content

Commit 8ef62bb

Browse files
committed
fix build errors for boost/python and able to build w/o animlib
1 parent 24b4361 commit 8ef62bb

File tree

4 files changed

+22
-11
lines changed

4 files changed

+22
-11
lines changed

CMakeLists.txt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -88,7 +88,7 @@ set(LLVM_LIB "")
8888
if (ENABLE_LLVM_BACKEND)
8989
set(LLVM_DIR /usr/share/llvm/cmake CACHE PATH "Where to search for LLVM i.e. ")
9090

91-
find_package(LLVM CONFIG NAMES LLVM CONFIGS LLVMConfig.cmake)
91+
find_package(LLVM CONFIG NAMES LLVM CONFIGS LLVM-Config.cmake LLVMConfig.cmake)
9292
if (LLVM_FOUND)
9393
set(SEEXPR_ENABLE_LLVM_BACKEND 1)
9494
message(STATUS "Using LLVMConfig.cmake in: ${LLVM_DIR}")

Makefile.config.example

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,9 +11,13 @@ ifeq ($(uname_S),Linux)
1111
EXTRA_CMAKE_ARGS += -DGTEST_DIR=/usr
1212
endif
1313

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

1822
ifdef RP_boost_disney
1923
EXTRA_CMAKE_ARGS += -DBOOST_DIR=$(RP_boost_disney)

src/py/CMakeLists.txt

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -75,12 +75,14 @@ if (USE_PYTHON)
7575
if (NOT DEFINED BOOST_INCLUDE_DIR)
7676
set(BOOST_INCLUDE_DIR ${BOOST_DIR}/include)
7777
endif()
78-
include_directories(SYSTEM ${BOOST_INCLUDE_DIR})
78+
include_directories(SYSTEM ${BOOST_INCLUDE_DIR} ${PYTHON_INCLUDE_DIR})
79+
message(STATUS "BOOST_INCLUDE_DIR = ${BOOST_INCLUDE_DIR}")
7980

8081
if (NOT DEFINED BOOST_LIB_DIR)
8182
set(BOOST_LIB_DIR ${BOOST_DIR}/${CMAKE_INSTALL_LIBDIR})
8283
endif()
8384
link_directories(${BOOST_LIB_DIR})
85+
message(STATUS "BOOST_LIB_DIR = ${BOOST_LIB_DIR}")
8486

8587
include_directories(../SeExpr/parser)
8688
add_library(core SHARED SeExprPy.cpp ../SeExpr/parser/SeExprParse.cpp ../SeExpr/parser/SeExprLex.cpp)

src/ui/CMakeLists.txt

Lines changed: 13 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -34,15 +34,18 @@ if (EXISTS "/usr/share/apps/cmake/modules")
3434
list(APPEND CMAKE_MODULE_PATH "/usr/share/apps/cmake/modules")
3535
endif()
3636

37-
if (NOT DEFINED PYQT_SIP_DIR)
38-
message(FATAL_ERROR "PYQT_SIP_DIR must be defined")
39-
endif()
40-
4137
if (NOT DEFINED PYQT_SIP_FLAGS)
4238
get_build_info(pyqt-sip-flags PYQT_SIP_FLAGS)
4339
separate_arguments(PYQT_SIP_FLAGS)
4440
endif()
4541

42+
if (NOT DEFINED PYQT_SIP_DIR)
43+
get_build_info(pyqt4-sip PYQT_SIP_DIR)
44+
if (NOT DEFINED PYQT_SIP_DIR)
45+
message(FATAL_ERROR "PYQT_SIP_DIR must be defined")
46+
endif()
47+
endif()
48+
4649
set(CMAKE_INSTALL_PYTHON "${PYTHON_SITE}/SeExpr2" )
4750

4851
# Other package dependencies...
@@ -73,6 +76,7 @@ if(Qt5_FOUND OR QT4_FOUND)
7376
qt4_wrap_cpp(EDITOR_MOC_SRCS ${EDITOR_MOC_HDRS})
7477
endif()
7578

79+
set(ANIMLIB_SRCS "")
7680
if (DEFINED ANIMLIB_DIR)
7781
set(CE_MOC_HDRS CE/CECurveListUI.h CE/CEDragHandlers.h CE/CEGraphCurve.h
7882
CE/CEGraphKey.h CE/CEGraphSeg.h CE/CEGraphUI.h CE/CEMainUI.h
@@ -87,11 +91,12 @@ if(Qt5_FOUND OR QT4_FOUND)
8791
else()
8892
qt4_wrap_cpp(CE_MOC_SRCS ${CE_MOC_HDRS})
8993
endif()
94+
set(ANIMLIB_SRCS "${CE_CPPS} ${CE_MOC_SRCS}")
9095
endif()
9196

9297
if (WIN32)
9398
add_library(SeExpr2Editor ${EDITOR_CPPS} ${EDITOR_MOC_SRCS}
94-
${CE_CPPS} ${CE_MOC_SRCS}
99+
${ANIMLIB_SRCS}
95100
${editor_parser_cpp})
96101
generate_export_header(SeExpr2Editor
97102
BASE_NAME SeExpr2Editor
@@ -100,12 +105,11 @@ if(Qt5_FOUND OR QT4_FOUND)
100105
STATIC_DEFINE SeExpr2Editor_BUILT_AS_STATIC )
101106
else()
102107
add_library(SeExpr2Editor SHARED ${EDITOR_CPPS} ${EDITOR_MOC_SRCS}
103-
${CE_CPPS} ${CE_MOC_SRCS}
108+
${ANIMLIB_SRCS}
104109
${editor_parser_cpp})
105110
endif()
106111

107-
include_directories(${CMAKE_CURRENT_SOURCE_DIR}
108-
${CMAKE_CURRENT_SOURCE_DIR}/CE)
112+
include_directories(${CMAKE_CURRENT_SOURCE_DIR})
109113
target_link_libraries(SeExpr2Editor SeExpr2)
110114

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

124128
if (DEFINED ANIMLIB_DIR)
129+
include_directories(${CMAKE_CURRENT_SOURCE_DIR}/CE)
125130
target_link_libraries(SeExpr2Editor animlib)
126131
endif()
127132

0 commit comments

Comments
 (0)