2727# Collect and display summary of options/dependencies
2828include (FeatureSummary)
2929
30+ include (GNUInstallDirs)
3031
3132################ WINDOWS ##################
3233# Set some compiler options for Windows
3334# required for libopenshot-audio headers
34- IF (WIN32 )
35+ if (WIN32 )
3536 add_definitions ( -DIGNORE_JUCE_HYPOT=1 )
36- SET (CMAKE_CXX_FLAGS " ${CMAKE_CXX_FLAGS} -include cmath" )
37- ENDIF (WIN32 )
38- IF (APPLE )
37+ set (CMAKE_CXX_FLAGS " ${CMAKE_CXX_FLAGS} -include cmath" )
38+ endif ()
39+
40+ if (APPLE )
3941 # If you still get errors compiling with GCC 4.8, mac headers need to be patched: http://hamelot.co.uk/programming/osx-gcc-dispatch_block_t-has-not-been-declared-invalid-typedef/
40- SET_PROPERTY (GLOBAL PROPERTY JUCE_MAC "JUCE_MAC" )
41- ADD_DEFINITIONS (-DNDEBUG)
42- SET (EXTENSION "mm" )
42+ set_property (GLOBAL PROPERTY JUCE_MAC "JUCE_MAC" )
43+ add_definitions (-DNDEBUG)
44+ set (EXTENSION "mm" )
4345
44- SET (JUCE_PLATFORM_SPECIFIC_DIR build /macosx/platform_specific_code)
45- SET (JUCE_PLATFORM_SPECIFIC_LIBRARIES "-framework Carbon -framework Cocoa -framework CoreFoundation -framework CoreAudio -framework CoreMidi -framework IOKit -framework AGL -framework AudioToolbox -framework QuartzCore -lobjc -framework Accelerate" )
46- ENDIF ( APPLE )
46+ set (JUCE_PLATFORM_SPECIFIC_DIR build /macosx/platform_specific_code)
47+ set (JUCE_PLATFORM_SPECIFIC_LIBRARIES "-framework Carbon -framework Cocoa -framework CoreFoundation -framework CoreAudio -framework CoreMidi -framework IOKit -framework AGL -framework AudioToolbox -framework QuartzCore -lobjc -framework Accelerate" )
48+ endif ( )
4749
4850################ IMAGE MAGICK ##################
4951# Set the Quantum Depth that ImageMagick was built with (default to 16 bits)
@@ -64,39 +66,40 @@ ELSE (OPENSHOT_IMAGEMAGICK_COMPATIBILITY)
6466ENDIF (OPENSHOT_IMAGEMAGICK_COMPATIBILITY)
6567
6668# Find the ImageMagick++ library
67- FIND_PACKAGE (ImageMagick COMPONENTS Magick++ MagickWand MagickCore)
68- IF (ImageMagick_FOUND)
69+ find_package (ImageMagick COMPONENTS Magick++ MagickWand MagickCore)
70+ if (ImageMagick_FOUND)
6971 # Include ImageMagick++ headers (needed for compile)
7072 include_directories (${ImageMagick_INCLUDE_DIRS} )
7173
7274 # define a global var (used in the C++)
7375 add_definitions ( -DUSE_IMAGEMAGICK=1 )
74- SET (CMAKE_SWIG_FLAGS "-DUSE_IMAGEMAGICK=1" )
76+ set (CMAKE_SWIG_FLAGS "-DUSE_IMAGEMAGICK=1" )
7577
76- ENDIF (ImageMagick_FOUND )
78+ endif ( )
7779
7880################# LIBOPENSHOT-AUDIO ###################
7981# Find JUCE-based openshot Audio libraries
80- FIND_PACKAGE (OpenShotAudio 0.2.0 REQUIRED)
82+ find_package (OpenShotAudio 0.2.0 REQUIRED)
8183
8284# Include Juce headers (needed for compile)
8385include_directories (${LIBOPENSHOT_AUDIO_INCLUDE_DIRS} )
8486
8587################# BLACKMAGIC DECKLINK ###################
8688# Find BlackMagic DeckLinkAPI libraries
87- IF (ENABLE_BLACKMAGIC)
88- FIND_PACKAGE (BlackMagic)
89+ if (ENABLE_BLACKMAGIC)
90+
91+ find_package (BlackMagic)
8992
90- IF (BLACKMAGIC_FOUND)
93+ if (BLACKMAGIC_FOUND)
9194 # Include Blackmagic headers (needed for compile)
9295 include_directories (${BLACKMAGIC_INCLUDE_DIR} )
9396
9497 # define a global var (used in the C++)
9598 add_definitions ( -DUSE_BLACKMAGIC=1 )
96- SET (CMAKE_SWIG_FLAGS "-DUSE_BLACKMAGIC=1" )
99+ set (CMAKE_SWIG_FLAGS "-DUSE_BLACKMAGIC=1" )
100+ endif ()
97101
98- ENDIF (BLACKMAGIC_FOUND)
99- ENDIF (ENABLE_BLACKMAGIC)
102+ endif ()
100103
101104############### PROFILING #################
102105#set(PROFILER "/usr/lib/libprofiler.so.0.3.2")
@@ -193,7 +196,7 @@ set(QT_PLAYER_SOURCES
193196file (GLOB_RECURSE OPENSHOT_QT_HEADERS ${CMAKE_SOURCE_DIR} /include /Qt/*.h)
194197
195198# Disable RPATH
196- SET (CMAKE_MACOSX_RPATH 0)
199+ set (CMAKE_MACOSX_RPATH 0)
197200
198201############### CREATE LIBRARY #################
199202# Create shared openshot library
@@ -293,7 +296,7 @@ endforeach()
293296
294297################### FFMPEG #####################
295298# Find FFmpeg libraries (used for video encoding / decoding)
296- FIND_PACKAGE (FFmpeg REQUIRED COMPONENTS avcodec avdevice avformat avutil swscale)
299+ find_package (FFmpeg REQUIRED COMPONENTS avcodec avdevice avformat avutil swscale)
297300
298301foreach (ff_comp avcodec avdevice avformat avfilter avutil postproc swscale swresample avresample)
299302 if (TARGET FFmpeg::${ff_comp} )
@@ -389,9 +392,9 @@ add_executable(openshot-example examples/Example.cpp)
389392
390393# Define path to test input files
391394SET (TEST_MEDIA_PATH "${PROJECT_SOURCE_DIR} /src/examples/" )
392- IF (WIN32 )
395+ if (WIN32 )
393396 STRING (REPLACE "/" "\\\\ " TEST_MEDIA_PATH TEST_MEDIA_PATH)
394- ENDIF ( WIN32 )
397+ endif ( )
395398target_compile_definitions (openshot-example PRIVATE
396399 -DTEST_MEDIA_PATH="${TEST_MEDIA_PATH} " )
397400
@@ -409,42 +412,40 @@ add_executable(openshot-player Qt/demo/main.cpp)
409412target_link_libraries (openshot-player openshot)
410413
411414############### TEST BLACKMAGIC CAPTURE APP ################
412- IF (BLACKMAGIC_FOUND)
415+ if (BLACKMAGIC_FOUND)
413416 # Create test executable
414417 add_executable (openshot-blackmagic
415418 examples/ExampleBlackmagic.cpp)
416419
417420 # Link test executable to the new library
418421 target_link_libraries (openshot-blackmagic openshot)
419- ENDIF (BLACKMAGIC_FOUND )
422+ endif ( )
420423
421424############### INCLUDE SWIG BINDINGS ################
422425add_subdirectory (bindings)
423426
424427############### INSTALL HEADERS & LIBRARY ################
425- set (LIB_INSTALL_DIR lib${LIB_SUFFIX} ) # determine correct lib folder
426428
427429# Install primary library
428- INSTALL (TARGETS openshot
429- ARCHIVE DESTINATION ${LIB_INSTALL_DIR}
430- LIBRARY DESTINATION ${LIB_INSTALL_DIR}
431- RUNTIME DESTINATION ${LIB_INSTALL_DIR}
432- COMPONENT library )
430+ install (TARGETS openshot
431+ ARCHIVE DESTINATION ${CMAKE_INSTALL_LIBDIR}
432+ LIBRARY DESTINATION ${CMAKE_INSTALL_LIBDIR}
433+ RUNTIME DESTINATION ${CMAKE_INSTALL_LIBDIR} )
433434
434- INSTALL (DIRECTORY ${CMAKE_SOURCE_DIR} /include /
435- DESTINATION ${CMAKE_INSTALL_PREFIX} / include /libopenshot
436- FILES_MATCHING PATTERN "*.h" )
435+ install (DIRECTORY ${CMAKE_SOURCE_DIR} /include /
436+ DESTINATION ${CMAKE_INSTALL_INCLUDEDIR} /libopenshot
437+ FILES_MATCHING PATTERN "*.h" )
437438
438439############### CPACK PACKAGING ##############
439- IF (MINGW)
440- SET (CPACK_GENERATOR "NSIS" )
441- ENDIF (MINGW )
442- IF (UNIX AND NOT APPLE )
443- SET (CPACK_GENERATOR "DEB" )
444- ENDIF ( UNIX AND NOT APPLE )
445- #IF (UNIX AND APPLE)
446- # SET (CPACK_GENERATOR "DragNDrop")
447- #ENDIF(UNIX AND APPLE )
448- SET (CPACK_DEBIAN_PACKAGE_MAINTAINER "Jonathan Thomas" ) #required
449-
450- INCLUDE (CPack)
440+ if (MINGW)
441+ set (CPACK_GENERATOR "NSIS" )
442+ endif ( )
443+ if (UNIX AND NOT APPLE )
444+ set (CPACK_GENERATOR "DEB" )
445+ endif ( )
446+ #if (UNIX AND APPLE)
447+ # set (CPACK_GENERATOR "DragNDrop")
448+ #endif( )
449+ set (CPACK_DEBIAN_PACKAGE_MAINTAINER "Jonathan Thomas" ) #required
450+
451+ include (CPack)
0 commit comments