Blame view

CMakeLists.txt 1.78 KB
bfdd8910   David Mayerich   initial commit
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
  #Specify the version being used aswell as the language
  cmake_minimum_required(VERSION 2.8)
  
  #Name your project here
  project(2netpbm)
  
  #set the module directory
  set(CMAKE_MODULE_PATH ${CMAKE_MODULE_PATH} "${CMAKE_SOURCE_DIR}")
  
  #build the executable in the binary directory on MS Visual Studio
  if ( MSVC )
  	SET( CMAKE_RUNTIME_OUTPUT_DIRECTORY_DEBUG "${OUTPUT_DIRECTORY}")
  	SET( CMAKE_RUNTIME_OUTPUT_DIRECTORY_RELEASE "${OUTPUT_DIRECTORY}")
  	SET( LIBRARY_OUTPUT_DIRECTORY_DEBUG "${OUTPUT_DIRECTORY}")
  	SET( LIBRARY_OUTPUT_DIRECTORY_RELEASE "${OUTPUT_DIRECTORY}")
  	add_definitions(-D_CRT_SECURE_NO_WARNINGS)
  	add_definitions(-D_SCL_SECURE_NO_WARNINGS)
  endif ( MSVC )
  
  #find packages-----------------------------------
  #find OpenCV
  find_package(OpenCV REQUIRED)
  
  #find the pthreads package
  find_package(Threads)
  
  #find the X11 package
  find_package(X11)
  
  #find the STIM library
  find_package(STIM)
  
  #find Boost for Unix-based file lists
  if( CMAKE_COMPILER_IS_GNUCC )
  	find_package(Boost COMPONENTS filesystem system)
  	if(Boost_FOUND)
  		add_definitions(-DBOOST_PRECOMPILED)
  		include_directories(${Boost_INCLUDE_DIR})
  	else(Boost_FOUND)
  		message(FATAL_ERROR "HSIproc requires Boost::filesystem and Boost::system when using GCC")
  	endif(Boost_FOUND)
  endif( CMAKE_COMPILER_IS_GNUCC )
  
  #set the STIM include directory (either user provided or downloaded)
  include_directories(${STIM_INCLUDE_DIRS})
  
  #Assign source files to the appropriate variables to easily associate them with executables
  file(GLOB SRC_CPP "*.cpp")
  file(GLOB SRC_H "*.h")
  
  #create an executable file
  add_executable(2netpbm
  		${SRC_CPP}
  		${SRC_H}
  )
  
  #set the link libraries
  target_link_libraries(2netpbm
  		${OpenCV_LIBS}
  		${X11_LIBRARIES}
  )
  
  #copy data files to the binary directory
  file(COPY data/skyrim.jpg DESTINATION .)
  file(COPY data/galaxy.jpg DESTINATION .)