Mercurial Hosting > traffic-intelligence
changeset 883:5852a3cdd455
added MacOS (Darwin) to Cpp Makefile and moved non-functional CMakeLists.txt
author | Nicolas Saunier <nicolas.saunier@polymtl.ca> |
---|---|
date | Thu, 16 Mar 2017 15:06:14 -0400 |
parents | 4749b71aa7fb |
children | ac4bcbcc9cda |
files | CMakeLists.txt c/Makefile samples/CMakeLists-nonfunctional.txt |
diffstat | 3 files changed, 62 insertions(+), 51 deletions(-) [+] |
line wrap: on
line diff
--- a/CMakeLists.txt Wed Mar 15 12:36:03 2017 -0400 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,49 +0,0 @@ -CMAKE_MINIMUM_REQUIRED( VERSION 2.6 ) - -FIND_PACKAGE( - OpenCV REQUIRED -) - -FIND_LIBRARY( - SQLite3_LIBS sqlite3 -) - -#FIND_PACKAGE(TrajectoryManagement) - -SET( - CMAKE_CXX_FLAGS "-g -Wall" -) - -set(CMAKE_RUNTIME_OUTPUT_DIRECTORY bin) - -add_executable(feature-based-tracking - c/cvutils.cpp - c/feature-based-tracking.cpp - c/Motion.cpp - c/Parameters.cpp - c/utils.cpp - c/InputFrameListModule.cpp - c/InputVideoFileModule.cpp - ) - -find_package(Boost REQUIRED program_options filesystem system) -find_library(TrajectoryManagement_LIBRARY TrajectoryManagementAndAnalysis) -find_path(TrajectoryManagement_INCLUDE_DIR src/Trajectory.h) - -add_definitions( - -DUSE_OPENCV - ) - -include_directories( - ${PROJECT_SOURCE_DIR}/include - ${TrajectoryManagement_INCLUDE_DIR} - ) - -target_link_libraries(feature-based-tracking - ${TrajectoryManagement_LIBRARY} - ${SQLite3_LIBS} - ${OpenCV_LIBS} - ${Boost_LIBRARIES} - ) - -install(TARGETS feature-based-tracking DESTINATION bin)
--- a/c/Makefile Wed Mar 15 12:36:03 2017 -0400 +++ b/c/Makefile Thu Mar 16 15:06:14 2017 -0400 @@ -31,6 +31,13 @@ LINUX_BOOST_PREFIX = /usr/local CFLAGS += -DLINUX EXE_EXTENSION='' +else ifeq ($(UNAME), Darwin) + OPENCV_HOME=/usr/local + INCLUDE+= -I$(OPENCV_HOME)/include -I$(OPENCV_HOME)/include/opencv + LIBS += -L$(OPENCV_HOME)/lib + LINUX_BOOST_PREFIX = /usr/local + CFLAGS += -DLINUX + EXE_EXTENSION='' else # windows MINGW_HOME = 'C:\MinGW' LDFLAGS += -mconsole -mwindows -lole32 -lwsock32 -luuid @@ -40,7 +47,11 @@ ifeq ($(DEBUG), 1) CFLAGS += -g -gstabs+ -DDEBUG else + ifeq ($(UNAME), Darwin) + CFLAGS += -O3 + else CFLAGS += -O3 --fast-math + endif CFLAGS += -DNDEBUG endif @@ -57,9 +68,9 @@ TESTS_OBJS = test_feature.o test_graph.o -default: builddir all +default: builddir tests feature-based-tracking -all: test-pixels optical-flow track-features +optional: test-pixels optical-flow track-features builddir: @$(SCRIPTS_DIR)/createdirectory.sh $(EXE_DIR)
--- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/samples/CMakeLists-nonfunctional.txt Thu Mar 16 15:06:14 2017 -0400 @@ -0,0 +1,49 @@ +CMAKE_MINIMUM_REQUIRED( VERSION 2.6 ) + +FIND_PACKAGE( + OpenCV REQUIRED +) + +FIND_LIBRARY( + SQLite3_LIBS sqlite3 +) + +#FIND_PACKAGE(TrajectoryManagement) + +SET( + CMAKE_CXX_FLAGS "-g -Wall" +) + +set(CMAKE_RUNTIME_OUTPUT_DIRECTORY bin) + +add_executable(feature-based-tracking + c/cvutils.cpp + c/feature-based-tracking.cpp + c/Motion.cpp + c/Parameters.cpp + c/utils.cpp + c/InputFrameListModule.cpp + c/InputVideoFileModule.cpp + ) + +find_package(Boost REQUIRED program_options filesystem system) +find_library(TrajectoryManagement_LIBRARY TrajectoryManagementAndAnalysis) +find_path(TrajectoryManagement_INCLUDE_DIR src/Trajectory.h) + +add_definitions( + -DUSE_OPENCV + ) + +include_directories( + ${PROJECT_SOURCE_DIR}/include + ${TrajectoryManagement_INCLUDE_DIR} + ) + +target_link_libraries(feature-based-tracking + ${TrajectoryManagement_LIBRARY} + ${SQLite3_LIBS} + ${OpenCV_LIBS} + ${Boost_LIBRARIES} + ) + +install(TARGETS feature-based-tracking DESTINATION bin)