Skip to content

Commit d9d6771

Browse files
committed
Added support to compile the source out of source tree
1 parent 828f925 commit d9d6771

File tree

1 file changed

+7
-5
lines changed

1 file changed

+7
-5
lines changed

CMakeLists.txt

Lines changed: 7 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,6 @@ INCLUDE(CheckFunctionExists)
66

77
PROJECT(ca_smoothing)
88

9-
109
find_package(VTK REQUIRED)
1110
include(${VTK_USE_FILE})
1211

@@ -16,13 +15,16 @@ INCLUDE(${SWIG_USE_FILE})
1615
FIND_PACKAGE(PythonLibs)
1716
INCLUDE_DIRECTORIES(${PYTHON_INCLUDE_PATH})
1817

18+
INCLUDE_DIRECTORIES(${CMAKE_CURRENT_SOURCE_DIR})
1919

2020
add_library(ca_smoothing SHARED ca_smoothing.cxx)
2121
add_executable(ca_smoothing_app ca_smoothing_app.cxx)
22+
23+
SET (Libraries vtkPythonCore)
2224

2325
if(VTK_LIBRARIES)
24-
target_link_libraries(ca_smoothing ${VTK_LIBRARIES})
25-
target_link_libraries(ca_smoothing_app ca_smoothing ${VTK_LIBRARIES})
26+
target_link_libraries(ca_smoothing ${VTK_LIBRARIES} ${Libraries})
27+
target_link_libraries(ca_smoothing_app ca_smoothing ${VTK_LIBRARIES} ${Libraries})
2628
else()
2729
target_link_libraries(ca_smoothing vtkHybrid )
2830
endif()
@@ -31,10 +33,10 @@ SET_SOURCE_FILES_PROPERTIES(ca_smoothing.i PROPERTIES CPLUSPLUS ON)
3133
#SET_SOURCE_FILES_PROPERTIES(ca_smoothing.i PROPERTIES SWIG_FLAGS "-includeall")
3234

3335
SWIG_ADD_MODULE(ca_smoothing python ca_smoothing.i ca_smoothing.cxx)
34-
SWIG_LINK_LIBRARIES(ca_smoothing ${PYTHON_LIBRARIES} ${VTK_LIBRARIES})
36+
SWIG_LINK_LIBRARIES(ca_smoothing ${PYTHON_LIBRARIES} ${VTK_LIBRARIES} ${Libraries})
3537

3638
IF (CMAKE_COMPILER_IS_GNUCXX)
37-
set (CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -Wall")
39+
set (CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -Wall -std=c++0x")
3840
ENDIF(CMAKE_COMPILER_IS_GNUCXX)
3941

4042
CHECK_INCLUDE_FILE_CXX (unordered_map HAVE_CXX0X)

0 commit comments

Comments
 (0)