Skip to content

Commit

Permalink
CMakeList improved
Browse files Browse the repository at this point in the history
Now the user can choose to build the evaluator and/or the estimator with
real-time visualization
  • Loading branch information
MarianoJT88 committed Jan 14, 2015
1 parent bbcad8e commit 389e51f
Showing 1 changed file with 44 additions and 37 deletions.
81 changes: 44 additions & 37 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -1,54 +1,61 @@
PROJECT(PD-Flow)

CMAKE_MINIMUM_REQUIRED(VERSION 2.4)
CMAKE_MINIMUM_REQUIRED(VERSION 2.4) #I have no idea, mine is 3.0.2
if(COMMAND cmake_policy)
cmake_policy(SET CMP0003 NEW) # Required by CMake 2.7+
endif(COMMAND cmake_policy)


FIND_PACKAGE(MRPT REQUIRED base gui opengl slam maps)
FIND_PACKAGE(OpenCV REQUIRED)
FIND_PACKAGE(CUDA REQUIRED)

INCLUDE_DIRECTORIES($ENV{OPENNI2_INCLUDE})
LINK_DIRECTORIES($ENV{OPENNI2_LIB})
#SET(OpenNI_lib "/usr/lib/libOpenNI2.so")
SET(OpenNI_lib "C:/Users/Mariano/Programas/OpenNI2_32/Lib/OpenNI2.lib")

INCLUDE_DIRECTORIES(${CUDA_INCLUDE_DIRS})
#set(CUDA_NVCC_FLAGS "-arch=sm_30 -O3 -use_fast_math")
set(CUDA_NVCC_FLAGS "-arch=sm_30")
#set(CUDA_NVCC_FLAGS ${CUDA_NVCC_FLAGS};-gencode arch=compute_35,code=sm_35)
set(CUDA_NVCC_FLAGS "-arch=sm_20")

#Build scene flow CUDA lib
CUDA_ADD_LIBRARY(pdflow_cudalib pdflow_cudalib.h pdflow_cudalib.cu)
#message( ${CUDA_LIBRARIES} )


ADD_EXECUTABLE(Scene-Flow-Visualization
main_scene_flow_visualization.cpp
scene_flow_visualization.cpp
scene_flow_visualization.h
legend_pdflow.xpm)

TARGET_LINK_LIBRARIES(Scene-Flow-Visualization
${MRPT_LIBS}
${CUDA_LIBRARIES}
${OpenNI_lib}
pdflow_cudalib)

ADD_EXECUTABLE(Scene-Flow-Impair
main_scene_flow_impair.cpp
scene_flow_impair.cpp
scene_flow_impair.h
)
SET(DEFAULT_BUILD_EVALUATOR ON)
SET(BUILD_EVALUATOR ${DEFAULT_BUILD_EVALUATOR} CACHE BOOL "Build the scene flow evaluator for a RGB-D frame pair that uses OpenCV")

#Build the scene flow evaluator
IF (BUILD_EVALUATOR)
FIND_PACKAGE(OpenCV REQUIRED)

TARGET_LINK_LIBRARIES(Scene-Flow-Impair
${OpenCV_LIBS}
${CUDA_LIBRARIES}
${MRPT_LIBS}
pdflow_cudalib)
ADD_EXECUTABLE(Scene-Flow-Impair
main_scene_flow_impair.cpp
scene_flow_impair.cpp
scene_flow_impair.h)

TARGET_LINK_LIBRARIES(Scene-Flow-Impair
${OpenCV_LIBS}
${CUDA_LIBRARIES}
pdflow_cudalib)
ENDIF (BUILD_EVALUATOR)

SET(DEFAULT_BUILD_RT_VISUALIZATION ON)
SET(BUILD_RT_VISUALIZATION ${DEFAULT_BUILD_RT_VISUALIZATION} CACHE BOOL "Build the scene flow estimator with real-time visualization that uses MRPT and OpenNI2")

IF (BUILD_RT_VISUALIZATION)
FIND_PACKAGE(MRPT REQUIRED base gui opengl)

INCLUDE_DIRECTORIES($ENV{OPENNI2_INCLUDE})
LINK_DIRECTORIES($ENV{OPENNI2_LIB})
#SET(OpenNI_lib "/usr/lib/libOpenNI2.so")
SET(OpenNI_lib "C:/Users/Mariano/Programas/OpenNI2_32/Lib/OpenNI2.lib")

ADD_EXECUTABLE(Scene-Flow-Visualization
main_scene_flow_visualization.cpp
scene_flow_visualization.cpp
scene_flow_visualization.h
legend_pdflow.xpm)

TARGET_LINK_LIBRARIES(Scene-Flow-Visualization
${MRPT_LIBS}
${CUDA_LIBRARIES}
${OpenNI_lib}
pdflow_cudalib)
ENDIF (BUILD_RT_VISUALIZATION)



# Set optimized building:
IF(CMAKE_COMPILER_IS_GNUCXX AND NOT CMAKE_BUILD_TYPE MATCHES "Debug")
SET(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -O3 -mtune=native")
Expand Down

0 comments on commit 389e51f

Please sign in to comment.