From a3e7b70a7adcec946cbd7af77f4e1f023547b1b2 Mon Sep 17 00:00:00 2001 From: Jonathan Thomas Date: Sat, 7 Feb 2015 16:48:43 -0600 Subject: [PATCH] Improved build scripts and refactored some executibles, such as the example apps --- .cproject | 148 +++++++++--------- src/CMakeLists.txt | 14 +- src/{Main.cpp => examples/Example.cpp} | 6 +- .../ExampleBlackmagic.cpp} | 2 +- tests/CMakeLists.txt | 12 +- 5 files changed, 90 insertions(+), 92 deletions(-) rename src/{Main.cpp => examples/Example.cpp} (99%) rename src/{Main_Blackmagic.cpp => examples/ExampleBlackmagic.cpp} (99%) diff --git a/.cproject b/.cproject index 14e1236f..1028fe17 100644 --- a/.cproject +++ b/.cproject @@ -1,19 +1,17 @@ - - - + - + @@ -77,13 +75,13 @@ - + @@ -117,13 +115,13 @@ - + @@ -184,13 +182,13 @@ - + @@ -227,74 +225,6 @@ - - - - cmake - -G "Unix Makefiles" ../ -D"CMAKE_BUILD_TYPE:STRING=Release" - true - false - true - - - cmake - -G "Unix Makefiles" ../ -D"MAGICKCORE_HDRI_ENABLE=0" -D"MAGICKCORE_QUANTUM_DEPTH=16" -D"OPENSHOT_IMAGEMAGICK_COMPATIBILITY=0" -D"ENABLE_BLACKMAGIC=1" -D"CMAKE_BUILD_TYPE:STRING=Debug" -D"ENABLE_TESTS=1" - - true - false - true - - - make - test - true - false - true - - - make - help - true - false - true - - - make - doc - true - false - true - - - cmake - -DCMAKE_CXX_COMPILER=/usr/local/opt/gcc48/bin/g++-4.8 -DCMAKE_C_COMPILER=/usr/local/opt/gcc48/bin/gcc-4.8 -DCMAKE_PREFIX_PATH=/usr/local/Cellar/qt5/5.1.1/ -DPYTHON_INCLUDE_DIR=/usr/local/Cellar/python3/3.3.2/Frameworks/Python.framework/Versions/3.3/include/python3.3m/ -DPYTHON_LIBRARY=/usr/local/Cellar/python3/3.3.2/Frameworks/Python.framework/Versions/3.3/lib/libpython3.3.dylib -DPython_FRAMEWORKS=/usr/local/Cellar/python3/3.3.2/Frameworks/Python.framework/ ../ -D"CMAKE_BUILD_TYPE:STRING=Debug" - true - false - true - - - cmake - -DCMAKE_CXX_COMPILER=/usr/local/opt/gcc48/bin/g++-4.8 -DCMAKE_C_COMPILER=/usr/local/opt/gcc48/bin/gcc-4.8 -DCMAKE_PREFIX_PATH=/usr/local/Cellar/qt5/5.1.1/ -DPYTHON_INCLUDE_DIR=/usr/local/Cellar/python3/3.3.2/Frameworks/Python.framework/Versions/3.3/include/python3.3m/ -DPYTHON_LIBRARY=/usr/local/Cellar/python3/3.3.2/Frameworks/Python.framework/Versions/3.3/lib/libpython3.3.dylib -DPython_FRAMEWORKS=/usr/local/Cellar/python3/3.3.2/Frameworks/Python.framework/ ../ -D"CMAKE_BUILD_TYPE:STRING=Release" - true - false - true - - - cmake - -G "MinGW Makefiles" ../ -D"CMAKE_BUILD_TYPE:STRING=Debug" - true - false - true - - - cmake - -G "MinGW Makefiles" ../ -D"CMAKE_BUILD_TYPE:STRING=Release" - true - false - true - - - @@ -404,4 +334,72 @@ + + + + cmake + -G "Unix Makefiles" ../ -D"CMAKE_BUILD_TYPE:STRING=Release" + true + false + true + + + cmake + -G "Unix Makefiles" ../ -D"MAGICKCORE_HDRI_ENABLE=0" -D"MAGICKCORE_QUANTUM_DEPTH=16" -D"OPENSHOT_IMAGEMAGICK_COMPATIBILITY=0" -D"ENABLE_BLACKMAGIC=1" -D"CMAKE_BUILD_TYPE:STRING=Debug" -D"DISABLE_TESTS=0" + + true + false + true + + + make + test + true + false + true + + + make + help + true + false + true + + + make + doc + true + false + true + + + cmake + -DCMAKE_CXX_COMPILER=/usr/local/opt/gcc48/bin/g++-4.8 -DCMAKE_C_COMPILER=/usr/local/opt/gcc48/bin/gcc-4.8 -DCMAKE_PREFIX_PATH=/usr/local/Cellar/qt5/5.1.1/ -DPYTHON_INCLUDE_DIR=/usr/local/Cellar/python3/3.3.2/Frameworks/Python.framework/Versions/3.3/include/python3.3m/ -DPYTHON_LIBRARY=/usr/local/Cellar/python3/3.3.2/Frameworks/Python.framework/Versions/3.3/lib/libpython3.3.dylib -DPython_FRAMEWORKS=/usr/local/Cellar/python3/3.3.2/Frameworks/Python.framework/ ../ -D"CMAKE_BUILD_TYPE:STRING=Debug" + true + false + true + + + cmake + -DCMAKE_CXX_COMPILER=/usr/local/opt/gcc48/bin/g++-4.8 -DCMAKE_C_COMPILER=/usr/local/opt/gcc48/bin/gcc-4.8 -DCMAKE_PREFIX_PATH=/usr/local/Cellar/qt5/5.1.1/ -DPYTHON_INCLUDE_DIR=/usr/local/Cellar/python3/3.3.2/Frameworks/Python.framework/Versions/3.3/include/python3.3m/ -DPYTHON_LIBRARY=/usr/local/Cellar/python3/3.3.2/Frameworks/Python.framework/Versions/3.3/lib/libpython3.3.dylib -DPython_FRAMEWORKS=/usr/local/Cellar/python3/3.3.2/Frameworks/Python.framework/ ../ -D"CMAKE_BUILD_TYPE:STRING=Release" + true + false + true + + + cmake + -G "MinGW Makefiles" ../ -D"CMAKE_BUILD_TYPE:STRING=Debug" + true + false + true + + + cmake + -G "MinGW Makefiles" ../ -D"CMAKE_BUILD_TYPE:STRING=Release" + true + false + true + + + diff --git a/src/CMakeLists.txt b/src/CMakeLists.txt index 65085122..1dc8a70c 100644 --- a/src/CMakeLists.txt +++ b/src/CMakeLists.txt @@ -251,26 +251,26 @@ target_link_libraries(openshot ${REQUIRED_LIBRARIES}) ############### CLI EXECUTABLE ################ # Create test executable -add_executable(example Main.cpp) +add_executable(openshot-example examples/Example.cpp) # Link test executable to the new library -target_link_libraries(example openshot) +target_link_libraries(openshot-example openshot) ############### PLAYER EXECUTABLE ################ # Create test executable -add_executable(openshot_player Qt/demo/main.cpp) +add_executable(openshot-player Qt/demo/main.cpp) # Link test executable to the new library -target_link_libraries(openshot_player openshot) +target_link_libraries(openshot-player openshot) ############### TEST BLACKMAGIC CAPTURE APP ################ IF (BLACKMAGIC_FOUND) # Create test executable - add_executable(blackmagic - Main_Blackmagic.cpp) + add_executable(openshot-blackmagic + examples/ExampleBlackmagic.cpp) # Link test executable to the new library - target_link_libraries(blackmagic openshot) + target_link_libraries(openshot-blackmagic openshot) ENDIF (BLACKMAGIC_FOUND) ############### INCLUDE SWIG BINDINGS ################ diff --git a/src/Main.cpp b/src/examples/Example.cpp similarity index 99% rename from src/Main.cpp rename to src/examples/Example.cpp index 2c1baad9..530ad661 100644 --- a/src/Main.cpp +++ b/src/examples/Example.cpp @@ -1,6 +1,6 @@ /** * @file - * @brief Source file for Main class (example app for libopenshot) + * @brief Source file for Example Executable (example app for libopenshot) * @author Jonathan Thomas * * @section LICENSE @@ -30,8 +30,8 @@ #include #include #include -#include "../include/OpenShot.h" -#include "../include/Json.h" +#include "../../include/OpenShot.h" +#include "../../include/Json.h" #include #include #include diff --git a/src/Main_Blackmagic.cpp b/src/examples/ExampleBlackmagic.cpp similarity index 99% rename from src/Main_Blackmagic.cpp rename to src/examples/ExampleBlackmagic.cpp index 6f1a1d9a..bc9bf2ab 100644 --- a/src/Main_Blackmagic.cpp +++ b/src/examples/ExampleBlackmagic.cpp @@ -30,7 +30,7 @@ #include #include #include -#include "../include/OpenShot.h" +#include "../../include/OpenShot.h" #include #include diff --git a/tests/CMakeLists.txt b/tests/CMakeLists.txt index 47106f4b..9dd92bb2 100644 --- a/tests/CMakeLists.txt +++ b/tests/CMakeLists.txt @@ -144,7 +144,7 @@ include_directories("../thirdparty/jsoncpp/include") ############### SET TEST SOURCE FILES ################# SET ( OPENSHOT_TEST_FILES tests.cpp ) -IF (ENABLE_TESTS) +IF (NOT DISABLE_TESTS) SET ( OPENSHOT_TEST_FILES ${OPENSHOT_TEST_FILES} Cache_Tests.cpp Clip_Tests.cpp @@ -162,15 +162,15 @@ IF (ENABLE_TESTS) ENDIF (ENABLE_TESTS) ################ TESTER EXECUTABLE ################# -# Create unit test executable (tester) -add_executable(tester +# Create unit test executable (openshot-test) +add_executable(openshot-test tests.cpp ${OPENSHOT_TEST_FILES} ) # Link libraries to the new executable -target_link_libraries(tester openshot ${UNITTEST++_LIBRARY}) +target_link_libraries(openshot-test openshot ${UNITTEST++_LIBRARY}) #################### MAKE TEST ###################### -# Hook up the 'make test' target to the 'tester' executable -ADD_CUSTOM_TARGET(test ${CMAKE_CURRENT_BINARY_DIR}/tester) \ No newline at end of file +# Hook up the 'make test' target to the 'openshot-test' executable +ADD_CUSTOM_TARGET(test ${CMAKE_CURRENT_BINARY_DIR}/openshot-test) \ No newline at end of file