diff --git a/.gitignore b/.gitignore index 5dcc99756d9..0de188da7b0 100644 --- a/.gitignore +++ b/.gitignore @@ -31,8 +31,9 @@ apps/* # general ######################### -[Bb]uild/ +[Bb]uild*/ [Oo]bj/ +cmake-build-*/ *.o examples/**/[Dd]ebug*/ examples/**/[Rr]elease*/ diff --git a/CMAKE.md b/CMAKE.md new file mode 100644 index 00000000000..0b305a862af --- /dev/null +++ b/CMAKE.md @@ -0,0 +1,282 @@ + +# CMake Support + +## Using CMake in your project + +Setup steps for a completely new OF project: + + - Create the following file structure: + ![cmake-example-layout](assets/cmake-example-layout.png) + As you can see it is very concise. + - [CPM.cmake](https://github.com/cpm-cmake/CPM.cmake): Just [download the latest release](https://github.com/cpm-cmake/CPM.cmake/releases/latest) and place it in the cmake folder. + This is a 100% CMake-based package manager which allows us to easily add dependencies + - include/ and src/ files are taken from the [emptyExample](examples/templates/emptyExample/README.md) + - resources are optional + - .gitignore bare minimum: + ```gitignore + [Bb]uild/ + cmake-build-*/ + ``` + - CMakeLists.txt: + ```cmake + cmake_minimum_required(VERSION 3.16) + project(ofExample) + + # Include CPM.cmake, a 100% CMake-based dependency manager (https://github.com/cpm-cmake/CPM.cmake) + include(cmake/CPM.cmake) + + # CPMAddPackage("gh:openframeworks/openframeworks#v0.11.2") # Either the very short version (works for github/gitlab branches, tags and commit hashes) + CPMAddPackage("gh:HerrNamenlos123/openframeworks#master") # This line is to be removed from this example once the CMake support is merged into master + #CPMAddPackage("https://github.com/openframeworks/openFrameworks/archive/refs/tags/nightly.zip") # Or any URL or archive + + # CPM automatically downloads and extract our dependencies, and calls add_subdirectory() for us. + # This is the fastest and easiest way to pull in modern C++ libraries with good, modern CMake support (especially true for C++17 header-only libraries). + + set(SOURCE_FILES + src/main.cpp # Here, list all source files + src/ofApp.cpp + ) + + # In Visual Studio we must also add headers and resource files as sources, so they're listed in the IDE + if (MSVC) + file(GLOB_RECURSE HEADER_FILES include/**) + file(GLOB_RECURSE RESOURCE_FILES resources/**) + list(APPEND SOURCE_FILES ${HEADER_FILES} ${RESOURCE_FILES}) + endif() + + # The actual executable to build + add_executable(ofExample ${SOURCE_FILES}) + source_group(TREE "${CMAKE_CURRENT_LIST_DIR}/" PREFIX "" FILES ${SOURCE_FILES}) # Group into Folders in VS + + # C++ version of the project (independent from the version OF is built with) + target_compile_features(ofExample PUBLIC cxx_std_17) + set_target_properties(ofExample PROPERTIES CXX_EXTENSIONS OFF) # Disable non-standard compiler-specific extensions + + # Include directories + target_include_directories(ofExample PUBLIC include) + + # All Targets we depend upon, which pulls in all headers, definitions, libraries, ... + target_link_libraries(ofExample of::openframeworks of::ofxGui) + + # Setting up paths correctly + set(BIN_DIR "${CMAKE_CURRENT_BINARY_DIR}/bin/$,debug,release>") + set_target_properties(ofExample PROPERTIES RUNTIME_OUTPUT_DIRECTORY "${BIN_DIR}") # Where to place the compiled binary + set_target_properties(ofExample PROPERTIES VS_DEBUGGER_WORKING_DIRECTORY "${BIN_DIR}") # Where to run from when debugging with F5 in VS + of_copy_runtime_to_bin_dir_after_build(ofExample "${BIN_DIR}") # Copy all shared libraries to the target location after building + set_property(DIRECTORY ${CMAKE_CURRENT_SOURCE_DIR} PROPERTY VS_STARTUP_PROJECT ofExample) # Set the VS startup project to run when pressing F5 + + # And potentially also copy any resource files to the target location + if (EXISTS "${CMAKE_CURRENT_LIST_DIR}/resources") + add_custom_command(TARGET ofExample POST_BUILD COMMAND ${CMAKE_COMMAND} -E copy_directory "${CMAKE_CURRENT_LIST_DIR}/resources" "${BIN_DIR}/resources") + endif() + ``` + +#### Additionally, you can use a precompiled header to speed up the compilation: +```cmake +target_precompile_headers(ofExample PRIVATE "include/pch.hpp") +``` +And in `include/pch.hpp`: +```cpp +#ifndef PCH_HPP +#define PCH_HPP + +#include "ofMain.h" +// And any other common header files that do not change frequently + +#endif //PCH_HPP +``` +Here you can add other headers like openFrameworks headers, standard library headers and third-party libraries that do not change frequently. + +This has the effect that these libraries are 'precompiled', which is taking a long time once, but speeding up any subsequent build significantly. + + +#### And to build it: (Any compiler/toolchain) +```bash + mkdir build + cd build + cmake .. + cmake --build . + ``` + + - For Visual Studio IDE, skip the last command and open the generated `ofExample.sln` + - For CLion and vscode, just open the root `CMakeLists.txt` in CLion or vscode with CMake extension, no terminal commands needed. + +#### This results in: + +An output directory including all resources and shared libraries it depends on, ready to be released. (see known issues) + +![cmake-example-output](assets/cmake-example-output.png) + +## Choosing the target platform + +When not doing anything special, CMake will try to detect the target platform and then choose the correct binary package. However, in case it cannot determine it or if you want to choose a different target platform, this is how you can set it: + +```bash +cmake .. -DOF_TARGET_ARCHITECTURE= +``` + +Simply run the command with an arbitrary value and it will print an error message with all possible values. + +## Visual Studio (and multi-config build systems) + +`-j` has no effect in Visual Studio, it automatically uses all available cores. + +In the following examples, we always use the command `cmake ..` in the build folder. However, you can also use following signature: +`cmake -S source_dir -B build_dir`. This way the current working directory is irrelevant and the two directories can be anywhere (especially useful for CI toolchains). + +### Building inside the VS IDE + +Open the generated `openFrameworks.sln` in your build folder with Visual Studio. Then, just build it like any other VS project. Right-click a project and click on `Set as Startup Project` to be able to run it with F5. + +Remember not to change anything in the project setting, as it is overwritten by CMake. Every change must be done +in CMake to keep it cross-platform. + +### Building VS project from the terminal + +You can also build Visual Studio projects without actually opening Visual Studio, by the use of MSBuild. CMake does all of that for you. + +Note that configurations in Visual Studio work a bit different compared to makefiles, as VS is a multi-configuration build tool, makefiles are not. + +#### Build all examples +```bash +# either in root directory of openFrameworks, or setting -DBUILD_EXAMPLES=ON +mkdir build +cd build +cmake .. +cmake --build . --target=build_all_examples --config=Release # Or 'Debug' +``` + +#### Build specific example + +Replace `ofNodeExample` with the project name of the example. + +```bash +# either in root directory of openFrameworks, or setting -DBUILD_EXAMPLES=ON +mkdir build +cd build +cmake .. +cmake --build . --target=ofNodeExample --config=Release # Or 'Debug' +``` + +#### Run all tests + +```bash +# either in root directory of openFrameworks, or setting -DBUILD_TESTS=ON +mkdir build +cd build +cmake .. +cmake --build . --config=Release # Or 'Debug' +ctest -C Release # Or 'Debug' +``` + +In the VS IDE, building RUN_TESTS (in CMakePredefinedTargets folder) does the same thing. + +## Makefiles (and single-configuration build systems) + +#### Building all examples + +```bash +# either in root directory of openFrameworks, or setting -DBUILD_EXAMPLES=ON +mkdir build +cd build +cmake .. -DCMAKE_BUILD_TYPE=Release # Or 'Debug' +cmake --build . --target=build_all_examples -j +``` + +#### Building specific example + +```bash +# either in root directory of openFrameworks, or setting -DBUILD_EXAMPLES=ON +mkdir build +cd build +cmake .. -DCMAKE_BUILD_TYPE=Release # Or 'Debug' +cmake --build . --target=ofNodeExample -j +``` + +#### Run all tests + +```bash +# either in root directory of openFrameworks, or setting -DBUILD_TESTS=ON +mkdir build +cd build +cmake .. -DCMAKE_BUILD_TYPE=Release # Or 'Debug' +cmake --build . -j +ctest -C Release # Or 'Debug' +``` + +## Jetbrains CLion + +When starting with CLion, you do not generate anything with CMake. It's the opposite: You open your root CMakeLists.txt in CLion, +which then calls CMake for you. + +CLion is especially useful when it comes to unit tests due to its excellent support for CMake CTest. + +### CLion on Windows + +Currently, MinGW/MSYS2 is entirely unsupported. If you want to use CLion on Windows, you must use the Microsoft MSVC toolchain +(Visual Studio), which is also faster and more reliable than MinGW or MSYS. +If [Visual Studio](https://visualstudio.microsoft.com/de/downloads/) is installed, it is automatically recognized in the CLion toolchain settings. +Thus, you can build using CLion's excellent IDE, while the Visual Studio compiler is used under the hood. +This results in the most robust development experience on Windows. + +MinGW support is waiting to be implemented! + +## Visual Studio Code + +When working with Visual Studio Code, the default C++ extensions are recommended, as well as the CMake extension from Microsoft. +See the CLion section above, as the same applies to VS Code. The CMake extension simply invokes CMake, which then uses MSVC under the hood, just like CLion. + +The CMake extension's panel in the left bar allows you to build and execute targets directly in VS Code. + +# Known issues + + - Currently, all shared libraries are always copied to the target location, even if they are not linked (including both debug and release versions) + - And only shared libraries from apothecary dependencies are copied, libraries from other dependencies are not + +# Yet to be done + + - [ ] Test everything on all Apple platforms + - [ ] Add full support for Android & iOS + - [ ] Add support for Emscripten + - [ ] Add support for MinGW/MSYS2 + - [ ] Add CMake install targets, which would allow to: + - 1: Install the library globally, so that new OF projects can simply link to it instead of building from source. + - 2: Install projects derived from it into an installation directory, which in turn allows to: + - 3: Use CMake's CPack to bundle all installed files and create native installers for each platform. (e.g. .exe, .msi, .deb, .rpm, .dmg, etc.) + +CMake has excellent support for cross-compilation for all of these platforms, one just needs a working dev environment +to test everything. + +Feel free to contribute to make this list shorter, Happy Coding! + +### Some hints for a future Android cross-compilation implementer: + +> ```bash +> set(CMAKE_SYSTEM_NAME "Android") +> set(CMAKE_SYSTEM_VERSION 1) +> +> cmake .. -DCMAKE_C_COMPILER=x86_64-linux-android33-clang -DCMAKE_CXX_COMPILER=x86_64-linux-android33-clang++ +> +> cmake .. \ +> -DCMAKE_C_COMPILER=armv7a-linux-androideabi33-clang \ +> -DCMAKE_CXX_COMPILER=armv7a-linux-androideabi33-clang++ \ +> -DCMAKE_SYSTEM_NAME=Android \ +> -DCMAKE_SYSTEM_VERSION=25 +> +> cmake .. \ +> -DCMAKE_SYSTEM_NAME=Android \ +> -DCMAKE_SYSTEM_VERSION=25 \ +> -DCMAKE_ANDROID_STANDALONE_TOOLCHAIN=/home/${USER}/android-ndk-r25c/toolchains/llvm/prebuilt/linux-x86_64 +> +> +> +> https://developer.android.com/ndk/guides/cmake#command-line +> +> cmake .. -DCMAKE_TOOLCHAIN_FILE=/home/$USER/android-ndk-r25c/build/cmake/android.toolchain.cmake -DANDROID_ABI=x86_64 +> +> AT LEAST CMake 3.19 !!! (better latest which is 3.26 at the time of writing) +> +> To update cmake: +> deb http://deb.debian.org/debian bullseye-backports main # put this into /etc/apt/sources.list +> sudo apt update && sudo apt install cmake -t bullseye-backports +> ``` diff --git a/CMakeLists.txt b/CMakeLists.txt new file mode 100644 index 00000000000..5c4e0001eb5 --- /dev/null +++ b/CMakeLists.txt @@ -0,0 +1,92 @@ +cmake_minimum_required(VERSION 3.16) +project(openframeworks) + +include(${CMAKE_CURRENT_LIST_DIR}/cmake/utils.cmake) +set_property(GLOBAL PROPERTY USE_FOLDERS ON) + +if (CMAKE_CURRENT_SOURCE_DIR STREQUAL CMAKE_SOURCE_DIR) + set(OF_IS_MAIN_PROJECT ON) +else() + set(OF_IS_MAIN_PROJECT OFF) +endif() + +# Here are all the options you can set for customizing your build +# BUILD_SHARED_LIBS can be set to build a dll +option(BUILD_EXAMPLES "Add all OpenFrameworks examples to the project" ${OF_IS_MAIN_PROJECT}) +option(BUILD_TESTS "Add all OpenFrameworks examples to the project" ${OF_IS_MAIN_PROJECT}) + +# This defines the actual library +add_library(openframeworks) +add_library(of::openframeworks ALIAS openframeworks) + +# This is another CMake script that adds the header locations and source files +include(${CMAKE_CURRENT_LIST_DIR}/libs/openFrameworks/CMakeLists.txt) + +# find_package(unofficial-libtess2 CONFIG REQUIRED) +find_package(glm CONFIG REQUIRED) +find_package(utf8cpp CONFIG REQUIRED) +find_package(FreeImage CONFIG REQUIRED) +find_package(uriparser CONFIG REQUIRED) +find_package(curl CONFIG REQUIRED) +find_package(freetype CONFIG REQUIRED) +find_package(pugixml CONFIG REQUIRED) +find_package(nlohmann_json CONFIG REQUIRED) +find_package(glew CONFIG REQUIRED) +find_package(glfw3 CONFIG REQUIRED) +find_package(cairo CONFIG REQUIRED) +find_package(libtess2 CONFIG REQUIRED) + +target_link_libraries(openframeworks PUBLIC + glm::glm + utf8cpp + freeimage::freeimage + uriparser::uriparser + CURL::libcurl + Freetype::Freetype + pugixml::pugixml + nlohmann_json::nlohmann_json + GLEW::GLEW + glfw + cairo::cairo + libtess2::libtess2 +) +message(STATUS "glm_INCLUDE_DIRS_RELEASE: ${glm_INCLUDE_DIRS_RELEASE}") +target_include_directories(openframeworks PUBLIC ${glm_INCLUDE_DIRS_RELEASE}) + +# C++ standard version and disabling non-standard compiler specific features +target_compile_features(openframeworks PUBLIC cxx_std_17) +set_target_properties(openframeworks PROPERTIES CXX_EXTENSIONS OFF) +set_target_properties(openframeworks PROPERTIES FOLDER "openframeworks") + +# Preprocessor defines +target_compile_definitions(openframeworks PUBLIC + OF_USING_STD_FS # Use the new C++17 filesystem library instead of boost + UNICODE # WinAPI setup + _UNICODE +) + +# Compiler flags specific to MSVC +if(MSVC) + target_compile_options(openframeworks PUBLIC "/Zc:__cplusplus") # Force MSVC to set __cplusplus macro correctly + target_compile_options(openframeworks PUBLIC "/MP") # Enable multi-core compilation + # target_link_options(openframeworks PUBLIC "/ignore:4099") # Suppress compiler warning that no .pdb file is available for debugging (in third-party libraries) + # target_link_options(openframeworks PUBLIC "/NODEFAULTLIB:LIBCMT") # Don't link to the default C runtime library (Conflicting with third-party libraries) + # target_link_options(openframeworks PUBLIC "/NODEFAULTLIB:$,MSVCRT,MSVCRTd>") # Don't link to the default C++ standard library (Conflicting with third-party libraries) +endif() + +# Where compiled binaries should be placed +set_target_properties(openframeworks PROPERTIES + ARCHIVE_OUTPUT_DIRECTORY "${CMAKE_CURRENT_BINARY_DIR}/lib/$,debug,release>" + LIBRARY_OUTPUT_DIRECTORY "${CMAKE_CURRENT_BINARY_DIR}/lib/$,debug,release>" +) + +add_subdirectory(addons) + +if (BUILD_EXAMPLES) + add_subdirectory(examples) +endif() + +if (BUILD_TESTS) + enable_testing() + add_subdirectory(tests) +endif() diff --git a/README.md b/README.md index 4961160465e..198681dc728 100644 --- a/README.md +++ b/README.md @@ -65,6 +65,11 @@ if you have bugs or feature requests, consider opening an issue. If you are a d We also have a developer's mailing list, which is useful for discussing issues around the development and future of OF. +## Working with CMake + +CMake support is a new feature, which allows to build openFrameworks out of the box. It also allows CLion to be used as an IDE. +There is an entire page dedicated to [CMake support](CMAKE.md). + ## Developers To grab a copy of openFrameworks for your platform, check the [download page](http://openframeworks.cc/download) on the main site. diff --git a/addons/.gitignore b/addons/.gitignore index 78cd0281e3f..da510f55cdc 100644 --- a/addons/.gitignore +++ b/addons/.gitignore @@ -33,6 +33,7 @@ ofxAssimpModelLoader/libs ofxSvg/libs ofxPoco/libs ofxKinect/libs +!CMakeLists.txt # don't ignore the .gitignore file !.gitignore diff --git a/addons/CMakeLists.txt b/addons/CMakeLists.txt new file mode 100644 index 00000000000..103abc8ba7e --- /dev/null +++ b/addons/CMakeLists.txt @@ -0,0 +1,61 @@ +message(STATUS "[openframeworks] Configuring addons") + +function(define_interface_addon TARGET_NAME) + add_library(${TARGET_NAME} INTERFACE) + add_library(of::${TARGET_NAME} ALIAS ${TARGET_NAME}) + target_link_libraries(${TARGET_NAME} INTERFACE of::openframeworks) + + target_include_directories(${TARGET_NAME} INTERFACE ${CMAKE_CURRENT_LIST_DIR}/include) + target_include_directories(${TARGET_NAME} INTERFACE ${CMAKE_CURRENT_LIST_DIR}/src) +endfunction() + +function(define_addon_without_paths TARGET_NAME) + add_library(${TARGET_NAME} STATIC EXCLUDE_FROM_ALL) + add_library(of::${TARGET_NAME} ALIAS ${TARGET_NAME}) + target_link_libraries(${TARGET_NAME} of::openframeworks) + + target_compile_features(${TARGET_NAME} PRIVATE cxx_std_17) + set_target_properties(${TARGET_NAME} PROPERTIES CXX_EXTENSIONS OFF) + set_target_properties(${TARGET_NAME} PROPERTIES FOLDER "openframeworks/addons") + + set_target_properties(${TARGET_NAME} PROPERTIES + ARCHIVE_OUTPUT_DIRECTORY "${CMAKE_CURRENT_BINARY_DIR}/lib/$,debug,release>" + LIBRARY_OUTPUT_DIRECTORY "${CMAKE_CURRENT_BINARY_DIR}/lib/$,debug,release>" + ) +endfunction() + +function(define_addon TARGET_NAME) + define_addon_without_paths(${TARGET_NAME}) + + file(GLOB_RECURSE SOURCES ${CMAKE_CURRENT_LIST_DIR}/**) + target_sources(${TARGET_NAME} PRIVATE ${SOURCES}) + target_include_directories(${TARGET_NAME} PUBLIC ${CMAKE_CURRENT_LIST_DIR}/include) + target_include_directories(${TARGET_NAME} PUBLIC ${CMAKE_CURRENT_LIST_DIR}/src) + source_group(TREE "${CMAKE_CURRENT_LIST_DIR}/" PREFIX "" FILES ${SOURCES}) +endfunction() + +add_subdirectory(ofxAccelerometer) + +if (OF_TARGET_ARCHITECTURE MATCHES "android") + add_subdirectory(ofxAndroid) +endif() + +add_subdirectory(ofxAssimpModelLoader) + +if (OF_TARGET_ARCHITECTURE MATCHES "emscripten") + add_subdirectory(ofxEmscripten) +endif() + +add_subdirectory(ofxGPS) +add_subdirectory(ofxGui) +# add_subdirectory(ofxiOS) # Not implemented yet, please contribute! +add_subdirectory(ofxKinect) +add_subdirectory(ofxNetwork) +add_subdirectory(ofxOpenCv) +add_subdirectory(ofxOsc) +add_subdirectory(ofxPoco) +# add_subdirectory(ofxSvg) +add_subdirectory(ofxThreadedImageLoader) +add_subdirectory(ofxUnitTests) +add_subdirectory(ofxVectorGraphics) +# add_subdirectory(ofxXmlSettings) diff --git a/addons/ofxAccelerometer/CMakeLists.txt b/addons/ofxAccelerometer/CMakeLists.txt new file mode 100644 index 00000000000..6e23c748a65 --- /dev/null +++ b/addons/ofxAccelerometer/CMakeLists.txt @@ -0,0 +1 @@ +define_addon(ofxAccelerometer) \ No newline at end of file diff --git a/addons/ofxAccelerometer/src/ofxAccelerometer.h b/addons/ofxAccelerometer/src/ofxAccelerometer.h index 81e60f18a99..89e6ba0270d 100644 --- a/addons/ofxAccelerometer/src/ofxAccelerometer.h +++ b/addons/ofxAccelerometer/src/ofxAccelerometer.h @@ -158,7 +158,7 @@ class ofxAccelerometerHandler { if(length < 0.1) return; //Clear matrix to be used to rotate from the current referential to one based on the gravity vector - bzero(matrix, sizeof(matrix)); + memset(matrix, 0, sizeof(matrix)); matrix[3][3] = 1.0; //Setup first matrix column as gravity vector diff --git a/addons/ofxAndroid/CMakeLists.txt b/addons/ofxAndroid/CMakeLists.txt new file mode 100644 index 00000000000..5d5c4fb9fc7 --- /dev/null +++ b/addons/ofxAndroid/CMakeLists.txt @@ -0,0 +1 @@ +define_addon(ofxAndroid) \ No newline at end of file diff --git a/addons/ofxAssimpModelLoader/CMakeLists.txt b/addons/ofxAssimpModelLoader/CMakeLists.txt new file mode 100644 index 00000000000..a430b701460 --- /dev/null +++ b/addons/ofxAssimpModelLoader/CMakeLists.txt @@ -0,0 +1,4 @@ +define_addon(ofxAssimpModelLoader) + +find_package(assimp CONFIG REQUIRED) +target_link_libraries(ofxAssimpModelLoader assimp::assimp) \ No newline at end of file diff --git a/addons/ofxGPS/CMakeLists.txt b/addons/ofxGPS/CMakeLists.txt new file mode 100644 index 00000000000..b47fc5942dd --- /dev/null +++ b/addons/ofxGPS/CMakeLists.txt @@ -0,0 +1,25 @@ + +if (OF_TARGET_ARCHITECTURE MATCHES "android" OR OF_TARGET_ARCHITECTURE MATCHES "ios") + + define_addon_without_paths(ofxGPS) + + file(GLOB_RECURSE SOURCES ${CMAKE_CURRENT_LIST_DIR}/src/common/**) + target_sources(ofxGPS PRIVATE ${SOURCES}) + target_include_directories(ofxGPS PUBLIC ${CMAKE_CURRENT_LIST_DIR}/src/common) + source_group(TREE "${CMAKE_CURRENT_LIST_DIR}/" PREFIX "" FILES ${SOURCES}) + + if (OF_TARGET_ARCHITECTURE MATCHES "android") + file(GLOB_RECURSE SOURCES ${CMAKE_CURRENT_LIST_DIR}/src/android/**) + target_sources(ofxGPS PRIVATE ${SOURCES}) + target_include_directories(ofxGPS PUBLIC ${CMAKE_CURRENT_LIST_DIR}/src/android) + source_group(TREE "${CMAKE_CURRENT_LIST_DIR}/" PREFIX "" FILES ${SOURCES}) + endif() + + if (OF_TARGET_ARCHITECTURE MATCHES "ios") + file(GLOB_RECURSE SOURCES ${CMAKE_CURRENT_LIST_DIR}/src/ios/**) + target_sources(ofxGPS PRIVATE ${SOURCES}) + target_include_directories(ofxGPS PUBLIC ${CMAKE_CURRENT_LIST_DIR}/src/ios) + source_group(TREE "${CMAKE_CURRENT_LIST_DIR}/" PREFIX "" FILES ${SOURCES}) + endif() + +endif() \ No newline at end of file diff --git a/addons/ofxGui/CMakeLists.txt b/addons/ofxGui/CMakeLists.txt new file mode 100644 index 00000000000..84cea294201 --- /dev/null +++ b/addons/ofxGui/CMakeLists.txt @@ -0,0 +1 @@ +define_addon(ofxGui) \ No newline at end of file diff --git a/addons/ofxKinect/CMakeLists.txt b/addons/ofxKinect/CMakeLists.txt new file mode 100644 index 00000000000..7c52e6607c8 --- /dev/null +++ b/addons/ofxKinect/CMakeLists.txt @@ -0,0 +1,12 @@ +define_addon(ofxKinect) + +target_include_directories(ofxKinect PUBLIC libs/libfreenect/include) +target_include_directories(ofxKinect PUBLIC libs/libfreenect/src) +target_include_directories(ofxKinect PUBLIC src/extra) + +if (WIN32) + target_include_directories(ofxKinect PUBLIC libs/libfreenect/platform/windows) +endif () + +find_package(libusb REQUIRED) +target_link_libraries(ofxKinect libusb::libusb) \ No newline at end of file diff --git a/addons/ofxNetwork/CMakeLists.txt b/addons/ofxNetwork/CMakeLists.txt new file mode 100644 index 00000000000..4725f2579eb --- /dev/null +++ b/addons/ofxNetwork/CMakeLists.txt @@ -0,0 +1 @@ +define_addon(ofxNetwork) \ No newline at end of file diff --git a/addons/ofxOpenCv/CMakeLists.txt b/addons/ofxOpenCv/CMakeLists.txt new file mode 100644 index 00000000000..99eb211fc68 --- /dev/null +++ b/addons/ofxOpenCv/CMakeLists.txt @@ -0,0 +1,8 @@ +define_addon(ofxOpenCv) + +find_package(OpenCV REQUIRED) +target_link_libraries(ofxOpenCv opencv::opencv) + +# if (WIN32) # We only need ippicv on Windows +# target_link_libraries(ofxOpenCv opencv::ippicv) +# endif() diff --git a/addons/ofxOsc/CMakeLists.txt b/addons/ofxOsc/CMakeLists.txt new file mode 100644 index 00000000000..f7d300749ed --- /dev/null +++ b/addons/ofxOsc/CMakeLists.txt @@ -0,0 +1,4 @@ +define_addon(ofxOsc) +target_include_directories(ofxOsc PUBLIC ${CMAKE_CURRENT_LIST_DIR}/libs/oscpack/src/osc) +target_include_directories(ofxOsc PUBLIC ${CMAKE_CURRENT_LIST_DIR}/libs/oscpack/src/ip) +target_include_directories(ofxOsc PUBLIC ${CMAKE_CURRENT_LIST_DIR}/libs/oscpack/src) \ No newline at end of file diff --git a/addons/ofxOsc/libs/oscpack/src/ip/posix/NetworkingUtils.cpp b/addons/ofxOsc/libs/oscpack/src/ip/posix/NetworkingUtils.cpp index c669a775755..1bfc0e72d21 100644 --- a/addons/ofxOsc/libs/oscpack/src/ip/posix/NetworkingUtils.cpp +++ b/addons/ofxOsc/libs/oscpack/src/ip/posix/NetworkingUtils.cpp @@ -34,6 +34,9 @@ requested that these non-binding requests be included whenever the above license is reproduced. */ + +#ifndef _WIN32 + #include "ip/NetworkingUtils.h" #include @@ -64,3 +67,5 @@ unsigned long GetHostByName( const char *name ) return result; } } + +#endif // _WIN32 diff --git a/addons/ofxOsc/libs/oscpack/src/ip/posix/UdpSocket.cpp b/addons/ofxOsc/libs/oscpack/src/ip/posix/UdpSocket.cpp index 7e27bd1c0b1..1943d576882 100644 --- a/addons/ofxOsc/libs/oscpack/src/ip/posix/UdpSocket.cpp +++ b/addons/ofxOsc/libs/oscpack/src/ip/posix/UdpSocket.cpp @@ -34,6 +34,9 @@ requested that these non-binding requests be included whenever the above license is reproduced. */ + +#ifndef _WIN32 + #include "ip/UdpSocket.h" #include @@ -624,3 +627,5 @@ void SocketReceiveMultiplexer::AsynchronousBreak() } } + +#endif // _WIN32 diff --git a/addons/ofxOsc/libs/oscpack/src/ip/win32/NetworkingUtils.cpp b/addons/ofxOsc/libs/oscpack/src/ip/win32/NetworkingUtils.cpp index 22621294b87..46486092d98 100644 --- a/addons/ofxOsc/libs/oscpack/src/ip/win32/NetworkingUtils.cpp +++ b/addons/ofxOsc/libs/oscpack/src/ip/win32/NetworkingUtils.cpp @@ -34,6 +34,9 @@ requested that these non-binding requests be included whenever the above license is reproduced. */ + +#ifdef _WIN32 + #include "ip/NetworkingUtils.h" #include // this must come first to prevent errors with MSVC7 @@ -95,3 +98,5 @@ unsigned long GetHostByName( const char *name ) return result; } } + +#endif // _WIN32 diff --git a/addons/ofxOsc/libs/oscpack/src/ip/win32/UdpSocket.cpp b/addons/ofxOsc/libs/oscpack/src/ip/win32/UdpSocket.cpp index a16f74a78c4..56643c2b37c 100644 --- a/addons/ofxOsc/libs/oscpack/src/ip/win32/UdpSocket.cpp +++ b/addons/ofxOsc/libs/oscpack/src/ip/win32/UdpSocket.cpp @@ -35,6 +35,8 @@ above license is reproduced. */ +#ifdef _WIN32 + #include // this must come first to prevent errors with MSVC7 #include #include // for timeGetTime() @@ -589,3 +591,5 @@ void SocketReceiveMultiplexer::AsynchronousBreak() } } + +#endif // _WIN32 diff --git a/addons/ofxPoco/CMakeLists.txt b/addons/ofxPoco/CMakeLists.txt new file mode 100644 index 00000000000..89c71222cc1 --- /dev/null +++ b/addons/ofxPoco/CMakeLists.txt @@ -0,0 +1,4 @@ +define_addon(ofxPoco) + +find_package(Poco REQUIRED COMPONENTS Foundation Util Net XML JSON Zip) +target_link_libraries(ofxPoco Poco::Foundation Poco::Util Poco::Net Poco::XML Poco::JSON Poco::Zip) \ No newline at end of file diff --git a/addons/ofxSvg/CMakeLists.txt b/addons/ofxSvg/CMakeLists.txt new file mode 100644 index 00000000000..ec7fd75629a --- /dev/null +++ b/addons/ofxSvg/CMakeLists.txt @@ -0,0 +1,5 @@ +define_addon(ofxSvg) + +find_package(svgtiny REQUIRED) +find_package(libxml2 REQUIRED) +target_link_libraries(ofxSvg svgtiny::svgtiny libxml2::libxml2) \ No newline at end of file diff --git a/addons/ofxThreadedImageLoader/CMakeLists.txt b/addons/ofxThreadedImageLoader/CMakeLists.txt new file mode 100644 index 00000000000..40bcbb44327 --- /dev/null +++ b/addons/ofxThreadedImageLoader/CMakeLists.txt @@ -0,0 +1 @@ +define_addon(ofxThreadedImageLoader) \ No newline at end of file diff --git a/addons/ofxUnitTests/CMakeLists.txt b/addons/ofxUnitTests/CMakeLists.txt new file mode 100644 index 00000000000..cfa455074f4 --- /dev/null +++ b/addons/ofxUnitTests/CMakeLists.txt @@ -0,0 +1 @@ +define_interface_addon(ofxUnitTests) \ No newline at end of file diff --git a/addons/ofxVectorGraphics/CMakeLists.txt b/addons/ofxVectorGraphics/CMakeLists.txt new file mode 100644 index 00000000000..67cf0b372a2 --- /dev/null +++ b/addons/ofxVectorGraphics/CMakeLists.txt @@ -0,0 +1,3 @@ +define_addon(ofxVectorGraphics) +target_sources(ofxVectorGraphics PRIVATE libs/CreEPS.cpp) +target_include_directories(ofxVectorGraphics PUBLIC libs) \ No newline at end of file diff --git a/addons/ofxXmlSettings/CMakeLists.txt b/addons/ofxXmlSettings/CMakeLists.txt new file mode 100644 index 00000000000..b0792417e2b --- /dev/null +++ b/addons/ofxXmlSettings/CMakeLists.txt @@ -0,0 +1,4 @@ +define_addon(ofxXmlSettings) +target_sources(ofxXmlSettings PRIVATE libs/tinyxml.cpp libs/tinyxmlerror.cpp libs/tinyxmlparser.cpp) +target_include_directories(ofxXmlSettings PUBLIC libs) +target_link_libraries(ofxXmlSettings of::svgtiny) \ No newline at end of file diff --git a/assets/cmake-example-layout.png b/assets/cmake-example-layout.png new file mode 100644 index 00000000000..94b3af17ee5 Binary files /dev/null and b/assets/cmake-example-layout.png differ diff --git a/assets/cmake-example-output.png b/assets/cmake-example-output.png new file mode 100644 index 00000000000..4c0c32a7837 Binary files /dev/null and b/assets/cmake-example-output.png differ diff --git a/cmake/download_and_link_deps.cmake b/cmake/download_and_link_deps.cmake new file mode 100644 index 00000000000..1118ee74c1c --- /dev/null +++ b/cmake/download_and_link_deps.cmake @@ -0,0 +1,233 @@ +include(FetchContent) +include(${CMAKE_CURRENT_LIST_DIR}/utils.cmake) +include(${CMAKE_CURRENT_LIST_DIR}/import_deps.cmake) +include(${CMAKE_CURRENT_LIST_DIR}/CPM.cmake) + +# list(APPEND CMAKE_MODULE_PATH ${CMAKE_CURRENT_LIST_DIR}/modules) + +# set(OF_TARGET_ARCHITECTURE "auto" CACHE STRING "The target platform for openFrameworks. 'auto' to detect automatically") +# option(OF_VERBOSE "Enable verbose printing while downloading the compiled binaries for OF" OFF) + +# set(_AVAILABLE_ARCHITECTURES "msvc, androidarmeabi, androidarm64, androidx86, ios, tvos, macos, msys-mingw, msys-clang, msys-ucrt, mingw, linux64, linuxarmv6l, linuxarmv7l, emscripten") + +# if(OF_TARGET_ARCHITECTURE STREQUAL "auto") +# if(NOT CMAKE_SIZEOF_VOID_P EQUAL 8) +# message(FATAL_ERROR "OpenFrameworks no longer supports 32-bit build systems. Please upgrade your compiler to 64-bit.") +# endif() + +# message(STATUS "[openframeworks] Auto-detecting platform...") + +# if (MSVC) +# set(OF_TARGET_ARCHITECTURE "msvc" CACHE STRING "" FORCE) +# elseif (EMSCRIPTEN) +# set(OF_TARGET_ARCHITECTURE "emscripten" CACHE STRING "" FORCE) +# elseif (ANDROID) +# if (CMAKE_ANDROID_ARCH_ABI MATCHES "arm64") +# set(OF_TARGET_ARCHITECTURE "androidarm64" CACHE STRING "" FORCE) +# else () +# if (CMAKE_ANDROID_ARCH_ABI MATCHES "armeabi") +# set(OF_TARGET_ARCHITECTURE "androidarmeabi" CACHE STRING "" FORCE) +# else () +# if (CMAKE_ANDROID_ARCH_ABI MATCHES "x86") +# set(OF_TARGET_ARCHITECTURE "androidx86" CACHE STRING "" FORCE) +# else () +# message(FATAL_ERROR "The target platform could not be detected automatically. Please specify it manually using '-DOF_TARGET_ARCHITECTURE= to your cmake call'. Possible values are: ${_AVAILABLE_ARCHITECTURES}.") +# endif () +# endif () +# endif () +# elseif (APPLE) +# if (CMAKE_SYSTEM_NAME STREQUAL "iOS") +# set(OF_TARGET_ARCHITECTURE "ios" CACHE STRING "" FORCE) +# elseif (CMAKE_SYSTEM_NAME STREQUAL "tvOS") +# set(OF_TARGET_ARCHITECTURE "tvos" CACHE STRING "" FORCE) +# else() +# set(OF_TARGET_ARCHITECTURE "macos" CACHE STRING "" FORCE) +# endif() +# elseif (MSYS) +# set(OF_TARGET_ARCHITECTURE "msys-mingw" CACHE STRING "" FORCE) +# # msys-clang and msys-ucrt must be specified manually +# elseif (MINGW) +# set(OF_TARGET_ARCHITECTURE "mingw" CACHE STRING "" FORCE) +# elseif (CMAKE_SYSTEM_NAME STREQUAL "Linux") +# set(OF_TARGET_ARCHITECTURE "linux64" CACHE STRING "" FORCE) +# # 'linuxarmv6l' and 'linuxarmv7l' must be specified manually +# else () +# message(FATAL_ERROR "The target platform could not be detected automatically. Please specify it manually using '-DOF_TARGET_ARCHITECTURE= to your cmake call'. Possible values are: ${_AVAILABLE_ARCHITECTURES}.") +# endif() + +# endif() + +# function(get_packages_and_link) +# if (OF_VERBOSE) +# Set(FETCHCONTENT_QUIET FALSE) +# endif() +# message(STATUS "[openframeworks] Using ${OF_TARGET_ARCHITECTURE} toolchain, downloading dependencies (-DOF_VERBOSE=ON for progress)") +# foreach(dependency IN LISTS ARGN) + +# # Download and extract the compressed archive +# if (NOT of-deps-${dependency}_CONFIGURED) +# set(_URL "http://ci.openframeworks.cc/libs/openFrameworksLibs_master_${dependency}") +# message(STATUS "[openframeworks] Fetching ${_URL}") +# CPMAddPackage( +# NAME of-deps-${dependency} +# DOWNLOAD_EXTRACT_TIMESTAMP TRUE +# DOWNLOAD_ONLY YES +# URL ${_URL} +# ) +# set(of-deps-${dependency}_SOURCE_DIR ${of-deps-${dependency}_SOURCE_DIR} CACHE BOOL "" FORCE) +# set(of-deps-${dependency}_CONFIGURED ON CACHE BOOL "" FORCE) +# else() +# message(STATUS "[openframeworks] Skipping check of ${dependency} to save build time. To force a re-download, delete CMakeCache.txt and re-run cmake.") +# endif() + +# if (NOT ${dependency} STREQUAL "osx4.tar.bz2") # All normal packages +# # Now, create the targets and link all files to them +# file(GLOB deps "${of-deps-${dependency}_SOURCE_DIR}/**") +# foreach(DEP_ROOT IN LISTS deps) +# get_filename_component(DEP_NAME ${DEP_ROOT} NAME) # vvv This is called for each dependency in each downloaded package + +# if (OF_TARGET_ARCHITECTURE MATCHES "linux" AND DEP_NAME STREQUAL "poco") # We do not want to use the embedded poco on linux as it's deprecated. We use the system's package instead +# continue() +# endif () + +# import_dependency(${DEP_NAME} ${DEP_ROOT}) +# endforeach() +# else() # osx4.tar.bz2 is another huge exception, it contains just opencv in *NOT* a subfolder +# import_dependency("opencv" "${of-deps-${dependency}_SOURCE_DIR}") +# endif() + +# endforeach() +# if (OF_VERBOSE) +# Set(FETCHCONTENT_QUIET TRUE) +# endif() +# endfunction() + +# And now download the archives, depending on the platform we're on +# if (OF_TARGET_ARCHITECTURE STREQUAL "msvc") +# get_packages_and_link("vs2017_64_1.zip" "vs2017_64_2.zip" "vs2017_64_3.zip" "vs2017_64_4.zip") + +# elseif (OF_TARGET_ARCHITECTURE STREQUAL "emscripten") # TODO: Implement Emscripten dependencies +# message(SEND_ERROR "Emscripten is not yet implemented in CMake! You are welcome to contribute!") +# get_packages_and_link() + +# elseif (OF_TARGET_ARCHITECTURE STREQUAL "androidarmeabi") +# get_packages_and_link("androidarmv7.tar.bz2") + +# elseif (OF_TARGET_ARCHITECTURE STREQUAL "androidarm64") +# get_packages_and_link("androidarm64.tar.bz2") + +# elseif (OF_TARGET_ARCHITECTURE STREQUAL "androidx86") +# get_packages_and_link("androidx86.tar.bz2") + +# elseif (OF_TARGET_ARCHITECTURE STREQUAL "ios") +# get_packages_and_link("ios1.tar.bz2" "ios2.tar.bz2" "ios3.tar.bz2" "ios4.tar.bz2") + +# elseif (OF_TARGET_ARCHITECTURE STREQUAL "tvos") +# get_packages_and_link("tvos1.tar.bz2" "tvos2.tar.bz2" "tvos3.tar.bz2" "tvos4.tar.bz2") + +# elseif (OF_TARGET_ARCHITECTURE STREQUAL "macos") +# get_packages_and_link("osx1.tar.bz2" "osx2.tar.bz2" "osx3.tar.bz2" "osx4.tar.bz2") + +# elseif (OF_TARGET_ARCHITECTURE STREQUAL "msys-mingw") +# message(SEND_ERROR "MSYS2/MinGW is not yet implemented in CMake! You are welcome to contribute!") +# # get_packages_and_link("msys2_mingw64.zip") + +# elseif (OF_TARGET_ARCHITECTURE STREQUAL "msys-ucrt") +# message(SEND_ERROR "MSYS2/ucrt64 is not yet implemented in CMake! You are welcome to contribute!") +# # get_packages_and_link("msys2_ucrt64.zip") + +# elseif (OF_TARGET_ARCHITECTURE STREQUAL "msys-clang") +# message(SEND_ERROR "MSYS2/clang64 is not yet implemented in CMake! You are welcome to contribute!") +# # get_packages_and_link("msys2_clang64.zip") + +# elseif (OF_TARGET_ARCHITECTURE STREQUAL "mingw") +# message(SEND_ERROR "Raw MinGW is not yet implemented in CMake! You are welcome to contribute!") +# # get_packages_and_link("msys2_mingw64.zip") + +# elseif (OF_TARGET_ARCHITECTURE STREQUAL "linux64") +# get_packages_and_link("linux64gcc6.tar.bz2") + +# elseif (OF_TARGET_ARCHITECTURE STREQUAL "linuxarmv6l") +# get_packages_and_link("linuxarmv6l.tar.bz2") + +# elseif (OF_TARGET_ARCHITECTURE STREQUAL "linuxarmv7l") +# get_packages_and_link("linuxarmv7l.tar.bz2") + +# else () +# message(FATAL_ERROR "No target platform was chosen. Please specify it manually using ' -DOF_TARGET_ARCHITECTURE='. Possible values are: ${_AVAILABLE_ARCHITECTURES}.") +# endif() + + +# Find system packages +if (NOT OF_TARGET_ARCHITECTURE MATCHES "android") + find_package(OpenGL) + if (NOT OpenGL_FOUND) + if (WIN32) + message(SEND_ERROR "Dependency OpenGL not found. Please try to update your graphics drivers!") + else() + message(SEND_ERROR "Dependency OpenGL not found. Please install it using your system's equivalent of 'sudo apt install libgl1-mesa-dev'") + endif() + endif() + target_include_directories(openframeworks PUBLIC ${OPENGL_INCLUDE_DIRS}) + target_link_libraries(openframeworks ${OPENGL_LIBRARIES}) +endif() + + + +# TODO: Now, download glut since it's somehow not part of the apothecary. Glut support seems to be deprecated +# if (WIN32) +# if (NOT of-deps-glut_CONFIGURED) +# CPMAddPackage( +# NAME of-deps-glut +# GIT_REPOSITORY "https://github.com/markkilgard/glut" +# GIT_TAG "8cd96cb440f1f2fac3a154227937be39d06efa53" +# DOWNLOAD_EXTRACT_TIMESTAMP TRUE +# DOWNLOAD_ONLY YES +# ) +# set(of-deps-glut_SOURCE_DIR ${of-deps-glut_SOURCE_DIR} CACHE PATH "" FORCE) +# set(of-deps-glut_CONFIGURED ON CACHE BOOL "" FORCE) +# else() +# message(STATUS "[openframeworks] Skipping check of of-deps-glut to save build time. To force a re-download, delete CMakeCache.txt and and re-run cmake.") +# endif() + +# add_library(of-deps-glut INTERFACE) +# add_library(of::glut ALIAS of-deps-glut) +# target_include_directories(of-deps-glut INTERFACE ${of-deps-glut_SOURCE_DIR}/include) +# target_include_directories(of-deps-glut INTERFACE ${of-deps-glut_SOURCE_DIR}/include/GL) +# endif() + +# And link to all the dependencies we depend upon +# target_link_libraries(openframeworks +# of::tess2 +# of::glm +# of::utf8 +# of::FreeImage +# of::uriparser +# of::openssl +# of::curl +# of::freetype +# of::pugixml +# of::json +# ) + +# Conditional dependencies +# if(WIN32) # Linking to WinAPI system libraries +# target_link_libraries(openframeworks of::videoInput of::glut) # videoInput library is Windows-only +# target_link_libraries(openframeworks winmm ws2_32 wldap32 crypt32 dsound setupapi) +# endif() + +# if (OF_TARGET_ARCHITECTURE MATCHES "linux") +# target_link_libraries(openframeworks of::OpenAL of::KissFFT of::sndfile of::gstreamer of::glib of::fontconfig of::udev) +# target_link_libraries(openframeworks -lX11) +# find_linux_deps() # All Linux-only packages (that are part of apothecary on all other platforms, but not on Linux) +# endif() + +# if (OF_TARGET_ARCHITECTURE STREQUAL "msvc" OR # GLEW is only a requirement on these systems +# OF_TARGET_ARCHITECTURE STREQUAL "macos" OR +# OF_TARGET_ARCHITECTURE MATCHES "linux") +# target_link_libraries(openframeworks of::rtAudio of::fmod of::glfw of::cairo of::glew) +# endif() + +# And finally find all shared libraries that are part of the dependencies, to be used later +# file(GLOB_RECURSE _OF_DEPS_SHARED_LIBS "${CMAKE_BINARY_DIR}/_deps/**/${CMAKE_SHARED_LIBRARY_PREFIX}**${CMAKE_SHARED_LIBRARY_SUFFIX}") +# set(OF_DEPS_SHARED_LIBS ${_OF_DEPS_SHARED_LIBS} CACHE INTERNAL "") diff --git a/cmake/find_linux_deps.cmake b/cmake/find_linux_deps.cmake new file mode 100644 index 00000000000..58de65dcf62 --- /dev/null +++ b/cmake/find_linux_deps.cmake @@ -0,0 +1,206 @@ +function(find_linux_deps) + + find_package(assimp) + if (NOT assimp_FOUND) + message(SEND_ERROR "Dependency Assimp not found. Please install it using your system's equivalent of 'sudo apt install libassimp-dev'") + endif() + add_library(of-deps-assimp INTERFACE) + add_library(of::assimp ALIAS of-deps-assimp) + target_include_directories(of-deps-assimp INTERFACE ${ASSIMP_INCLUDE_DIRS}) + target_link_libraries(of-deps-assimp INTERFACE ${ASSIMP_LIBRARIES}) + + find_package(OpenCV) + if (NOT OpenCV_FOUND) + message(SEND_ERROR "Dependency OpenCV not found. Please install it using your system's equivalent of 'sudo apt install libopencv-dev'") + endif() + add_library(of-deps-opencv INTERFACE) + add_library(of::opencv ALIAS of-deps-opencv) + target_include_directories(of-deps-opencv INTERFACE ${OpenCV_INCLUDE_DIRS}) + target_link_libraries(of-deps-opencv INTERFACE ${OpenCV_LIBS}) + + find_package(Cairo) + if (NOT Cairo_FOUND) + message(SEND_ERROR "Dependency Cairo not found. Please install it using your system's equivalent of 'sudo apt install libcairo-dev'") + endif() + add_library(of-deps-cairo INTERFACE) + add_library(of::cairo ALIAS of-deps-cairo) + target_include_directories(of-deps-cairo INTERFACE ${CAIRO_INCLUDE_DIRS}) + target_link_libraries(of-deps-cairo INTERFACE ${CAIRO_LIBRARIES}) + + find_package(GLFW3) + if (NOT GLFW3_FOUND) + message(SEND_ERROR "Dependency GLFW not found. Please install it using your system's equivalent of 'sudo apt install libglfw3-dev'") + endif() + add_library(of-deps-glfw INTERFACE) + add_library(of::glfw ALIAS of-deps-glfw) + target_include_directories(of-deps-glfw INTERFACE ${GLFW3_INCLUDE_DIRS}) + target_link_libraries(of-deps-glfw INTERFACE ${GLFW3_LIBRARIES}) + + find_package(OpenSSL) + if (NOT OPENSSL_FOUND) + message(SEND_ERROR "Dependency OpenSSL not found. Please install it using your system's equivalent of 'sudo apt install libssl-dev'") + endif() + add_library(of-deps-openssl INTERFACE) + add_library(of::openssl ALIAS of-deps-openssl) + target_link_libraries(of-deps-openssl INTERFACE OpenSSL::SSL OpenSSL::Crypto) + + find_package(CURL) + if (NOT CURL_FOUND) + message(SEND_ERROR "Dependency CURL not found. Please install it using your system's equivalent of 'sudo apt install libcurl-dev'") + endif() + add_library(of-deps-curl INTERFACE) + add_library(of::curl ALIAS of-deps-curl) + target_link_libraries(of-deps-curl INTERFACE CURL::libcurl) + + find_package(Freetype) + if (NOT FREETYPE_FOUND) + message(SEND_ERROR "Dependency FreeType not found. Please install it using your system's equivalent of 'sudo apt install libfreetype-dev'") + endif() + add_library(of-deps-freetype INTERFACE) + add_library(of::freetype ALIAS of-deps-freetype) + target_link_libraries(of-deps-freetype INTERFACE Freetype::Freetype) + + find_package(pugixml) + if (NOT TARGET pugixml::pugixml) + message(SEND_ERROR "Dependency pugixml not found. Please install it using your system's equivalent of 'sudo apt install libpugixml-dev'") + endif() + add_library(of-deps-pugixml INTERFACE) + add_library(of::pugixml ALIAS of-deps-pugixml) + target_link_libraries(of-deps-pugixml INTERFACE pugixml::pugixml) + + set(URIPARSER_FIND_QUIETLY ON) + find_package(uriparser) + if (NOT URIPARSER_FOUND) + message(SEND_ERROR "Dependency uriparser not found. Please install it using your system's equivalent of 'sudo apt install liburiparser-dev'") + endif() + add_library(of-deps-uriparser INTERFACE) + add_library(of::uriparser ALIAS of-deps-uriparser) + target_include_directories(of-deps-uriparser INTERFACE ${URIPARSER_INCLUDE_DIR}) + target_link_libraries(of-deps-uriparser INTERFACE ${URIPARSER_LIBRARY}) + + find_package(RtAudio) + if (NOT RTAUDIO_FOUND) + message(SEND_ERROR "Dependency RtAudio not found. Please install it using your system's equivalent of 'sudo apt install librtaudio-dev'") + endif() + add_library(of-deps-rtAudio INTERFACE) + add_library(of::rtAudio ALIAS of-deps-rtAudio) + target_include_directories(of-deps-rtAudio INTERFACE ${RTAUDIO_INCLUDE_DIR}) + target_link_libraries(of-deps-rtAudio INTERFACE ${RTAUDIO_LIBRARIES}) + + find_package(FreeImage) + if (NOT FREEIMAGE_FOUND) + message(SEND_ERROR "Dependency FreeImage not found. Please install it using your system's equivalent of 'sudo apt install libfreeimage-dev'") + endif() + add_library(of-deps-freeimage INTERFACE) + add_library(of::FreeImage ALIAS of-deps-freeimage) + target_include_directories(of-deps-freeimage INTERFACE ${FREEIMAGE_INCLUDE_DIR}) + target_link_libraries(of-deps-freeimage INTERFACE ${FREEIMAGE_LIBRARIES}) + + find_package(GLEW) + if (NOT GLEW_FOUND) + message(SEND_ERROR "Dependency GLEW not found. Please install it using your system's equivalent of 'sudo apt install libglew-dev'") + endif() + add_library(of-deps-glew INTERFACE) + add_library(of::glew ALIAS of-deps-glew) + target_link_libraries(of-deps-glew INTERFACE GLEW::GLEW) + + find_package(GLUT) + if (NOT GLUT_FOUND) + message(SEND_ERROR "Dependency GLUT not found. Please install it using your system's equivalent of 'sudo apt install freeglut3-dev'") + endif() + add_library(of-deps-glut INTERFACE) + add_library(of::glut ALIAS of-deps-glut) + target_link_libraries(of-deps-glut INTERFACE GLUT::GLUT) + + find_package(KissFFT) + if (NOT KISSFFT_FOUND) + message(SEND_ERROR "Dependency KissFFT not found. Please install it using your system's equivalent of 'sudo apt install libkissfft-dev'") + endif() + add_library(of-deps-kissfft INTERFACE) + add_library(of::KissFFT ALIAS of-deps-kissfft) + target_include_directories(of-deps-kissfft INTERFACE ${KISSFFT_INCLUDE_DIRS}) + target_link_libraries(of-deps-kissfft INTERFACE ${KISSFFT_LIBRARIES}) + + find_package(OpenAL) + if (NOT OPENAL_FOUND) + message(SEND_ERROR "Dependency OpenAL not found. Please install it using your system's equivalent of 'sudo apt install libopenal-dev'") + endif() + add_library(of-deps-openal INTERFACE) + add_library(of::OpenAL ALIAS of-deps-openal) + target_include_directories(of-deps-openal INTERFACE ${OPENAL_INCLUDE_DIR}) + target_link_libraries(of-deps-openal INTERFACE ${OPENAL_LIBRARY}) + + find_package(sndfile) + if (NOT SNDFILE_FOUND) + message(SEND_ERROR "Dependency sndfile not found. Please install it using your system's equivalent of 'sudo apt install libsndfile-dev'") + endif() + add_library(of-deps-sndfile INTERFACE) + add_library(of::sndfile ALIAS of-deps-sndfile) + target_include_directories(of-deps-sndfile INTERFACE ${SNDFILE_INCLUDE_DIR}) + target_link_libraries(of-deps-sndfile INTERFACE ${SNDFILE_LIBRARIES}) + + find_package(GLIB COMPONENTS gobject) + if (NOT GLIB_FOUND) + message(SEND_ERROR "Dependency GLIB not found. Please install it using your system's equivalent of 'sudo apt install libglib2.0-dev'") + endif() + add_library(of-deps-glib INTERFACE) + add_library(of::glib ALIAS of-deps-glib) + target_include_directories(of-deps-glib INTERFACE ${GLIB_INCLUDE_DIR} ${GLIBCONFIG_INCLUDE_DIR}) + target_link_libraries(of-deps-glib INTERFACE ${GLIB_LIBRARIES} ${GLIB_GOBJECT_LIBRARIES}) + + find_package(GStreamer) + if (NOT GSTREAMER_FOUND) + message(SEND_ERROR "Dependency GStreamer not found. Please install it using your system's equivalent of 'sudo apt install libgstreamer1.0-dev'") + endif() + add_library(of-deps-gstreamer INTERFACE) + add_library(of::gstreamer ALIAS of-deps-gstreamer) + target_include_directories(of-deps-gstreamer INTERFACE ${GSTREAMER_INCLUDE_DIR}) + target_link_libraries(of-deps-gstreamer INTERFACE ${GSTREAMER_LIBRARY} ${GSTREAMERBASE_LIBRARY}) + + find_package(GStreamerPluginsBase COMPONENTS video app) + if (NOT GSTREAMER_VIDEO_LIBRARY_FOUND) + message(SEND_ERROR "Dependency GStreamerPluginsBase not found (Video component). \nHint: 'sudo apt install libgstreamer-plugins-base1.0-dev' might do the trick") + endif() + if (NOT GSTREAMER_APP_LIBRARY_FOUND) + message(SEND_ERROR "Dependency GStreamerPluginsBase not found (App component). \nHint: 'sudo apt install libgstreamer-plugins-base1.0-dev' might do the trick") + endif() + target_include_directories(of-deps-gstreamer INTERFACE ${GSTREAMER_VIDEO_INCLUDE_DIR} ${GSTREAMER_APP_INCLUDE_DIR}) + target_link_libraries(of-deps-gstreamer INTERFACE ${GSTREAMER_VIDEO_LIBRARY} ${GSTREAMER_APP_LIBRARY}) + + find_package(Fontconfig) + if (NOT GLUT_FOUND) + message(SEND_ERROR "Dependency Fontconfig not found. Please install it using your system's equivalent of 'sudo apt install libfontconfig-dev'") + endif() + add_library(of-deps-fontconfig INTERFACE) + add_library(of::fontconfig ALIAS of-deps-fontconfig) + target_link_libraries(of-deps-fontconfig INTERFACE Fontconfig::Fontconfig) + + find_package(UDev) + if (NOT UDEV_FOUND) + message(SEND_ERROR "Dependency UDev not found. Please install it using your system's equivalent of 'sudo apt install libudev-dev'") + endif() + add_library(of-deps-udev INTERFACE) + add_library(of::udev ALIAS of-deps-udev) + target_include_directories(of-deps-udev INTERFACE ${UDEV_INCLUDE_DIRS}) + target_link_libraries(of-deps-udev INTERFACE ${UDEV_LIBRARIES}) + + find_package(libusb-1.0) + if (NOT LIBUSB_1_FOUND) + message(SEND_ERROR "Dependency libusb-1.0 not found. Please install it using your system's equivalent of 'sudo apt install libusb-1.0-0-dev'") + endif() + add_library(of-deps-libusb INTERFACE) + add_library(of::libusb ALIAS of-deps-libusb) + target_include_directories(of-deps-libusb INTERFACE ${LIBUSB_1_INCLUDE_DIRS}) + target_link_libraries(of-deps-libusb INTERFACE ${LIBUSB_1_LIBRARIES}) + target_compile_definitions(of-deps-libusb INTERFACE ${LIBUSB_1_DEFINITIONS}) + + find_package(Poco COMPONENTS Data Foundation Net NetSSL Util XML) + if (NOT Poco_FOUND) + message(SEND_ERROR "Dependency Poco or any of its modules not found. Please install them using your system's equivalent of 'sudo apt install libpoco-dev'") + endif() + add_library(of-deps-poco INTERFACE) + add_library(of::poco ALIAS of-deps-poco) + target_include_directories(of-deps-poco INTERFACE ${Poco_INCLUDE_DIRS}) + target_link_libraries(of-deps-poco INTERFACE ${Poco_LIBRARIES}) + +endfunction() diff --git a/cmake/import_deps.cmake b/cmake/import_deps.cmake new file mode 100644 index 00000000000..e455d597625 --- /dev/null +++ b/cmake/import_deps.cmake @@ -0,0 +1,79 @@ + +function(add_libraries_to_dependency LIB_DIR_NAME LIB_NAME DEP_NAME LIB_PATH) + + set(CONFIG "ALL") + if (LIB_DIR_NAME STREQUAL "Debug") + set(CONFIG "Debug") + elseif(LIB_DIR_NAME STREQUAL "Release") + set(CONFIG "Release") + endif() + + if (DEP_NAME STREQUAL "pugixml") + if (LIB_NAME STREQUAL "${CMAKE_STATIC_LIBRARY_PREFIX}pugixmld${CMAKE_STATIC_LIBRARY_SUFFIX}") + set(CONFIG "Debug") + else() + set(CONFIG "Release") + endif() + endif() + + if (DEP_NAME STREQUAL "videoInput") + if (LIB_NAME STREQUAL "${CMAKE_STATIC_LIBRARY_PREFIX}videoInputD${CMAKE_STATIC_LIBRARY_SUFFIX}") + set(CONFIG "Debug") + else() + set(CONFIG "Release") + endif() + endif() + + if (DEP_NAME STREQUAL "rtAudio") + if (LIB_NAME STREQUAL "${CMAKE_STATIC_LIBRARY_PREFIX}rtAudioD${CMAKE_STATIC_LIBRARY_SUFFIX}") + set(CONFIG "Debug") + else() + set(CONFIG "Release") + endif() + endif() + + if (CONFIG STREQUAL "Debug") + target_link_libraries(${TARGET_NAME} INTERFACE $,${LIB_PATH},>) + elseif(CONFIG STREQUAL "Release") + target_link_libraries(${TARGET_NAME} INTERFACE $,,${LIB_PATH}>) + else() + target_link_libraries(${TARGET_NAME} INTERFACE ${LIB_PATH}) + endif() +endfunction() + +# This function is called for every dependency in every package, e.g. 'boost', 'freetype', 'libcurl', etc. +# It creates the CMake target for each dependency and adds the library files to the targets +function(import_dependency DEP_NAME DEP_ROOT) + + # Find all the library files in one dependency + file(GLOB_RECURSE libraries "${DEP_ROOT}/**/${CMAKE_STATIC_LIBRARY_PREFIX}**${CMAKE_STATIC_LIBRARY_SUFFIX}") + + set(TARGET_NAME of-deps-${DEP_NAME}) + add_library(${TARGET_NAME} INTERFACE) + + if (libraries) + # Some Libraries were found -> Link all of them into a single target + foreach(LIB_PATH IN LISTS libraries) # Loop over all found library files + + get_filename_component(LIB_DIR ${LIB_PATH} DIRECTORY) + get_filename_component(LIB_DIR_NAME ${LIB_DIR} NAME) + get_filename_component(LIB_NAME ${LIB_PATH} NAME) + get_filename_component(LIB_EXTENSION ${LIB_PATH} LAST_EXT) + + add_libraries_to_dependency(${LIB_DIR_NAME} ${LIB_NAME} ${DEP_NAME} ${LIB_PATH}) + + endforeach() + + endif() + add_library(of::${DEP_NAME} ALIAS of-deps-${DEP_NAME}) + + # Header file directories + if (${DEP_NAME} STREQUAL "cairo") # Unfortunately cairo and freetype are inconsistent in the apothecary + target_include_directories(of-deps-${DEP_NAME} INTERFACE ${DEP_ROOT}/include/cairo) + elseif(${DEP_NAME} STREQUAL "freetype") + target_include_directories(of-deps-${DEP_NAME} INTERFACE ${DEP_ROOT}/include/freetype2) + else() + target_include_directories(of-deps-${DEP_NAME} INTERFACE ${DEP_ROOT}/include) + endif() + +endfunction() diff --git a/cmake/modules/FindCairo.cmake b/cmake/modules/FindCairo.cmake new file mode 100644 index 00000000000..934f3adb06e --- /dev/null +++ b/cmake/modules/FindCairo.cmake @@ -0,0 +1,81 @@ +# - Try to find Cairo +# Once done, this will define +# +# CAIRO_FOUND - system has Cairo +# CAIRO_INCLUDE_DIRS - the Cairo include directories +# CAIRO_LIBRARIES - link these to use Cairo +# +# Copyright (C) 2012 Raphael Kubo da Costa +# +# Redistribution and use in source and binary forms, with or without +# modification, are permitted provided that the following conditions +# are met: +# 1. Redistributions of source code must retain the above copyright +# notice, this list of conditions and the following disclaimer. +# 2. Redistributions in binary form must reproduce the above copyright +# notice, this list of conditions and the following disclaimer in the +# documentation and/or other materials provided with the distribution. +# +# THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDER AND ITS CONTRIBUTORS ``AS +# IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, +# THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR +# PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR ITS +# CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, +# EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, +# PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; +# OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, +# WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR +# OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF +# ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + +FIND_PACKAGE(PkgConfig) +PKG_CHECK_MODULES(PC_CAIRO cairo) # FIXME: After we require CMake 2.8.2 we can pass QUIET to this call. + +FIND_PATH(CAIRO_INCLUDE_DIRS + NAMES cairo.h + HINTS ${PC_CAIRO_INCLUDEDIR} + ${PC_CAIRO_INCLUDE_DIRS} + PATH_SUFFIXES cairo +) + +FIND_LIBRARY(CAIRO_LIBRARIES + NAMES cairo + HINTS ${PC_CAIRO_LIBDIR} + ${PC_CAIRO_LIBRARY_DIRS} +) + +IF (CAIRO_INCLUDE_DIRS) + IF (EXISTS "${CAIRO_INCLUDE_DIRS}/cairo-version.h") + FILE(READ "${CAIRO_INCLUDE_DIRS}/cairo-version.h" CAIRO_VERSION_CONTENT) + + STRING(REGEX MATCH "#define +CAIRO_VERSION_MAJOR +([0-9]+)" _dummy "${CAIRO_VERSION_CONTENT}") + SET(CAIRO_VERSION_MAJOR "${CMAKE_MATCH_1}") + + STRING(REGEX MATCH "#define +CAIRO_VERSION_MINOR +([0-9]+)" _dummy "${CAIRO_VERSION_CONTENT}") + SET(CAIRO_VERSION_MINOR "${CMAKE_MATCH_1}") + + STRING(REGEX MATCH "#define +CAIRO_VERSION_MICRO +([0-9]+)" _dummy "${CAIRO_VERSION_CONTENT}") + SET(CAIRO_VERSION_MICRO "${CMAKE_MATCH_1}") + + SET(CAIRO_VERSION "${CAIRO_VERSION_MAJOR}.${CAIRO_VERSION_MINOR}.${CAIRO_VERSION_MICRO}") + ENDIF () +ENDIF () + +# FIXME: Should not be needed anymore once we start depending on CMake 2.8.3 +SET(VERSION_OK TRUE) +IF (Cairo_FIND_VERSION) + IF (Cairo_FIND_VERSION_EXACT) + IF ("${Cairo_FIND_VERSION}" VERSION_EQUAL "${CAIRO_VERSION}") + # FIXME: Use IF (NOT ...) with CMake 2.8.2+ to get rid of the ELSE block + ELSE () + SET(VERSION_OK FALSE) + ENDIF () + ELSE () + IF ("${Cairo_FIND_VERSION}" VERSION_GREATER "${CAIRO_VERSION}") + SET(VERSION_OK FALSE) + ENDIF () + ENDIF () +ENDIF () + +INCLUDE(FindPackageHandleStandardArgs) +FIND_PACKAGE_HANDLE_STANDARD_ARGS(Cairo DEFAULT_MSG CAIRO_INCLUDE_DIRS CAIRO_LIBRARIES VERSION_OK) \ No newline at end of file diff --git a/cmake/modules/FindFreeImage.cmake b/cmake/modules/FindFreeImage.cmake new file mode 100644 index 00000000000..8415416d364 --- /dev/null +++ b/cmake/modules/FindFreeImage.cmake @@ -0,0 +1,71 @@ +# +# Find FreeImage +# +# Try to find FreeImage. +# This module defines the following variables: +# - FREEIMAGE_INCLUDE_DIRS +# - FREEIMAGE_LIBRARIES +# - FREEIMAGE_FOUND +# +# The following variables can be set as arguments for the module. +# - FREEIMAGE_ROOT_DIR : Root library directory of FreeImage +# + +# Additional modules +include(FindPackageHandleStandardArgs) + +if (WIN32) + # Find include files + find_path( + FREEIMAGE_INCLUDE_DIR + NAMES FreeImage.h + PATHS + $ENV{PROGRAMFILES}/include + ${FREEIMAGE_ROOT_DIR}/include + DOC "The directory where FreeImage.h resides") + + # Find library files + find_library( + FREEIMAGE_LIBRARY + NAMES FreeImage + PATHS + $ENV{PROGRAMFILES}/lib + ${FREEIMAGE_ROOT_DIR}/lib) +else() + # Find include files + find_path( + FREEIMAGE_INCLUDE_DIR + NAMES FreeImage.h + PATHS + /usr/include + /usr/local/include + /sw/include + /opt/local/include + DOC "The directory where FreeImage.h resides") + + # Find library files + find_library( + FREEIMAGE_LIBRARY + NAMES freeimage + PATHS + /usr/lib64 + /usr/lib + /usr/local/lib64 + /usr/local/lib + /sw/lib + /opt/local/lib + ${FREEIMAGE_ROOT_DIR}/lib + DOC "The FreeImage library") +endif() + +# Handle REQUIRD argument, define *_FOUND variable +find_package_handle_standard_args(FreeImage DEFAULT_MSG FREEIMAGE_INCLUDE_DIR FREEIMAGE_LIBRARY) + +# Define GLFW_LIBRARIES and GLFW_INCLUDE_DIRS +if (FREEIMAGE_FOUND) + set(FREEIMAGE_LIBRARIES ${FREEIMAGE_LIBRARY}) + set(FREEIMAGE_INCLUDE_DIRS ${FREEIMAGE_INCLUDE_DIR}) +endif() + +# Hide some variables +mark_as_advanced(FREEIMAGE_INCLUDE_DIR FREEIMAGE_LIBRARY) \ No newline at end of file diff --git a/cmake/modules/FindGLFW3.cmake b/cmake/modules/FindGLFW3.cmake new file mode 100644 index 00000000000..487ef94b366 --- /dev/null +++ b/cmake/modules/FindGLFW3.cmake @@ -0,0 +1,86 @@ +# +# Find GLFW +# +# Try to find GLFW library. +# This module defines the following variables: +# - GLFW_INCLUDE_DIRS +# - GLFW_LIBRARIES +# - GLFW_FOUND +# +# The following variables can be set as arguments for the module. +# - GLFW_ROOT_DIR : Root library directory of GLFW +# - GLFW_USE_STATIC_LIBS : Specifies to use static version of GLFW library (Windows only) +# +# References: +# - https://github.com/progschj/OpenGL-Examples/blob/master/cmake_modules/FindGLFW.cmake +# - https://bitbucket.org/Ident8/cegui-mk2-opengl3-renderer/src/befd47200265/cmake/FindGLFW.cmake +# + +# Additional modules +include(FindPackageHandleStandardArgs) + +if (WIN32) + # Find include files + find_path( + GLFW3_INCLUDE_DIR + NAMES GLFW/glfw3.h + PATHS + $ENV{PROGRAMFILES}/include + ${GLFW3_ROOT_DIR}/include + DOC "The directory where GLFW/glfw3.h resides") + + # Use glfw3.lib for static library + if (GLFW3_USE_STATIC_LIBS) + set(GLFW3_LIBRARY_NAME glfw3) + else() + set(GLFW3_LIBRARY_NAME glfw3dll) + endif() + + # Find library files + find_library( + GLFW3_LIBRARY + NAMES ${GLFW3_LIBRARY_NAME} + PATHS + $ENV{PROGRAMFILES}/lib + ${GLFW3_ROOT_DIR}/lib) + + unset(GLFW3_LIBRARY_NAME) +else() + # Find include files + find_path( + GLFW3_INCLUDE_DIR + NAMES GLFW/glfw3.h + PATHS + /usr/include + /usr/local/include + /sw/include + /opt/local/include + DOC "The directory where GL/glfw3.h resides") + + # Find library files + # Try to use static libraries + find_library( + GLFW3_LIBRARY + NAMES glfw + PATHS + /usr/lib64 + /usr/lib + /usr/local/lib64 + /usr/local/lib + /sw/lib + /opt/local/lib + ${GLFW_ROOT_DIR}/lib + DOC "The GLFW library") +endif() + +# Handle REQUIRED argument, define *_FOUND variable +find_package_handle_standard_args(GLFW3 DEFAULT_MSG GLFW3_INCLUDE_DIR GLFW3_LIBRARY) + +# Define GLFW3_LIBRARIES and GLFW3_INCLUDE_DIRS +if (GLFW3_FOUND) + set(GLFW3_LIBRARIES ${OPENGL_LIBRARIES} ${GLFW3_LIBRARY}) + set(GLFW3_INCLUDE_DIRS ${GLFW3_INCLUDE_DIR}) +endif() + +# Hide some variables +mark_as_advanced(GLFW3_INCLUDE_DIR GLFW3_LIBRARY) \ No newline at end of file diff --git a/cmake/modules/FindGLIB.cmake b/cmake/modules/FindGLIB.cmake new file mode 100644 index 00000000000..dba84496176 --- /dev/null +++ b/cmake/modules/FindGLIB.cmake @@ -0,0 +1,122 @@ +# - Try to find Glib and its components (gio, gobject etc) +# Once done, this will define +# +# GLIB_FOUND - system has Glib +# GLIB_INCLUDE_DIRS - the Glib include directories +# GLIB_LIBRARIES - link these to use Glib +# +# Optionally, the COMPONENTS keyword can be passed to find_package() +# and Glib components can be looked for. Currently, the following +# components can be used, and they define the following variables if +# found: +# +# gio: GLIB_GIO_LIBRARIES +# gobject: GLIB_GOBJECT_LIBRARIES +# gmodule: GLIB_GMODULE_LIBRARIES +# gthread: GLIB_GTHREAD_LIBRARIES +# +# Note that the respective _INCLUDE_DIR variables are not set, since +# all headers are in the same directory as GLIB_INCLUDE_DIRS. +# +# Copyright (C) 2012 Raphael Kubo da Costa +# +# Redistribution and use in source and binary forms, with or without +# modification, are permitted provided that the following conditions +# are met: +# 1. Redistributions of source code must retain the above copyright +# notice, this list of conditions and the following disclaimer. +# 2. Redistributions in binary form must reproduce the above copyright +# notice, this list of conditions and the following disclaimer in the +# documentation and/or other materials provided with the distribution. +# +# THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDER AND ITS CONTRIBUTORS ``AS +# IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, +# THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR +# PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR ITS +# CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, +# EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, +# PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; +# OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, +# WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR +# OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF +# ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + +find_package(PkgConfig QUIET) +pkg_check_modules(PC_GLIB QUIET glib-2.0) + +find_library(GLIB_LIBRARIES + NAMES glib-2.0 + HINTS ${PC_GLIB_LIBDIR} + ${PC_GLIB_LIBRARY_DIRS} +) + +# Files in glib's main include path may include glibconfig.h, which, +# for some odd reason, is normally in $LIBDIR/glib-2.0/include. +get_filename_component(_GLIB_LIBRARY_DIR ${GLIB_LIBRARIES} PATH) +find_path(GLIBCONFIG_INCLUDE_DIR + NAMES glibconfig.h + HINTS ${PC_LIBDIR} ${PC_LIBRARY_DIRS} ${_GLIB_LIBRARY_DIR} + ${PC_GLIB_INCLUDEDIR} ${PC_GLIB_INCLUDE_DIRS} + PATH_SUFFIXES glib-2.0/include +) + +find_path(GLIB_INCLUDE_DIR + NAMES glib.h + HINTS ${PC_GLIB_INCLUDEDIR} + ${PC_GLIB_INCLUDE_DIRS} + PATH_SUFFIXES glib-2.0 +) + +set(GLIB_INCLUDE_DIRS ${GLIB_INCLUDE_DIR} ${GLIBCONFIG_INCLUDE_DIR}) + +# Version detection +if (EXISTS "${GLIBCONFIG_INCLUDE_DIR}/glibconfig.h") + file(READ "${GLIBCONFIG_INCLUDE_DIR}/glibconfig.h" GLIBCONFIG_H_CONTENTS) + string(REGEX MATCH "#define GLIB_MAJOR_VERSION ([0-9]+)" _dummy "${GLIBCONFIG_H_CONTENTS}") + set(GLIB_VERSION_MAJOR "${CMAKE_MATCH_1}") + string(REGEX MATCH "#define GLIB_MINOR_VERSION ([0-9]+)" _dummy "${GLIBCONFIG_H_CONTENTS}") + set(GLIB_VERSION_MINOR "${CMAKE_MATCH_1}") + string(REGEX MATCH "#define GLIB_MICRO_VERSION ([0-9]+)" _dummy "${GLIBCONFIG_H_CONTENTS}") + set(GLIB_VERSION_MICRO "${CMAKE_MATCH_1}") + set(GLIB_VERSION "${GLIB_VERSION_MAJOR}.${GLIB_VERSION_MINOR}.${GLIB_VERSION_MICRO}") +endif () + +# Additional Glib components. We only look for libraries, as not all of them +# have corresponding headers and all headers are installed alongside the main +# glib ones. +foreach (_component ${GLIB_FIND_COMPONENTS}) + if (${_component} STREQUAL "gio") + find_library(GLIB_GIO_LIBRARIES NAMES gio-2.0 HINTS ${_GLIB_LIBRARY_DIR}) + set(ADDITIONAL_REQUIRED_VARS ${ADDITIONAL_REQUIRED_VARS} GLIB_GIO_LIBRARIES) + elseif (${_component} STREQUAL "gobject") + find_library(GLIB_GOBJECT_LIBRARIES NAMES gobject-2.0 HINTS ${_GLIB_LIBRARY_DIR}) + set(ADDITIONAL_REQUIRED_VARS ${ADDITIONAL_REQUIRED_VARS} GLIB_GOBJECT_LIBRARIES) + elseif (${_component} STREQUAL "gmodule") + find_library(GLIB_GMODULE_LIBRARIES NAMES gmodule-2.0 HINTS ${_GLIB_LIBRARY_DIR}) + set(ADDITIONAL_REQUIRED_VARS ${ADDITIONAL_REQUIRED_VARS} GLIB_GMODULE_LIBRARIES) + elseif (${_component} STREQUAL "gthread") + find_library(GLIB_GTHREAD_LIBRARIES NAMES gthread-2.0 HINTS ${_GLIB_LIBRARY_DIR}) + set(ADDITIONAL_REQUIRED_VARS ${ADDITIONAL_REQUIRED_VARS} GLIB_GTHREAD_LIBRARIES) + elseif (${_component} STREQUAL "gio-unix") + # gio-unix is compiled as part of the gio library, but the include paths + # are separate from the shared glib ones. Since this is currently only used + # by WebKitGTK we don't go to extraordinary measures beyond pkg-config. + pkg_check_modules(GIO_UNIX QUIET gio-unix-2.0) + endif () +endforeach () + +include(FindPackageHandleStandardArgs) +FIND_PACKAGE_HANDLE_STANDARD_ARGS(GLIB REQUIRED_VARS GLIB_INCLUDE_DIRS GLIB_LIBRARIES ${ADDITIONAL_REQUIRED_VARS} + VERSION_VAR GLIB_VERSION) + +mark_as_advanced( + GLIBCONFIG_INCLUDE_DIR + GLIB_GIO_LIBRARIES + GLIB_GIO_UNIX_LIBRARIES + GLIB_GMODULE_LIBRARIES + GLIB_GOBJECT_LIBRARIES + GLIB_GTHREAD_LIBRARIES + GLIB_INCLUDE_DIR + GLIB_INCLUDE_DIRS + GLIB_LIBRARIES +) \ No newline at end of file diff --git a/cmake/modules/FindGStreamer.cmake b/cmake/modules/FindGStreamer.cmake new file mode 100644 index 00000000000..98d708ff3b6 --- /dev/null +++ b/cmake/modules/FindGStreamer.cmake @@ -0,0 +1,127 @@ +# - Try to find GStreamer +# Once done this will define +# +# GSTREAMER_FOUND - system has GStreamer +# GSTREAMER_INCLUDE_DIR - the GStreamer main include directory +# GSTREAMER_INCLUDE_DIRS - the GStreamer include directories +# GSTREAMER_LIBRARY - the main GStreamer library +# GSTREAMER_PLUGIN_DIR - the GStreamer plugin directory +# +# And for all the plugin libraries specified in the COMPONENTS +# of find_package, this module will define: +# +# GSTREAMER__LIBRARY_FOUND - system has +# GSTREAMER__LIBRARY - the library +# GSTREAMER__INCLUDE_DIR - the include directory +# +# Copyright (c) 2010, Collabora Ltd. +# @author George Kiagiadakis +# +# Redistribution and use is allowed according to the terms of the BSD license. +# For details see the accompanying COPYING-CMAKE-SCRIPTS file. + +if (GSTREAMER_INCLUDE_DIR AND GSTREAMER_LIBRARY) + set(GStreamer_FIND_QUIETLY TRUE) +else() + set(GStreamer_FIND_QUIETLY FALSE) +endif() + +set(GSTREAMER_ABI_VERSION "1.0") + + +# Find the main library +find_package(PkgConfig) + +if (PKG_CONFIG_FOUND) + pkg_check_modules(PKG_GSTREAMER QUIET gstreamer-${GSTREAMER_ABI_VERSION}) + if(PKG_GSTREAMER_FOUND) + exec_program(${PKG_CONFIG_EXECUTABLE} + ARGS --variable pluginsdir gstreamer-${GSTREAMER_ABI_VERSION} + OUTPUT_VARIABLE PKG_GSTREAMER_PLUGIN_DIR) + endif() + set(GSTREAMER_DEFINITIONS ${PKG_GSTREAMER_CFLAGS}) +endif() + +find_library(GSTREAMER_LIBRARY + NAMES gstreamer-${GSTREAMER_ABI_VERSION} + HINTS ${PKG_GSTREAMER_LIBRARY_DIRS} ${PKG_GSTREAMER_LIBDIR}) + +find_library(GSTREAMERBASE_LIBRARY + NAMES gstbase-${GSTREAMER_ABI_VERSION} + HINTS ${PKG_GSTREAMER_LIBRARY_DIRS} ${PKG_GSTREAMER_LIBDIR}) + +find_path(GSTREAMER_INCLUDE_DIR + gst/gst.h + HINTS ${PKG_GSTREAMER_INCLUDE_DIRS} ${PKG_GSTREAMER_INCLUDEDIR} + PATH_SUFFIXES gstreamer-${GSTREAMER_ABI_VERSION}) + +find_path(GSTREAMER_gstconfig_INCLUDE_DIR + gst/gstconfig.h + HINTS ${PKG_GSTREAMER_INCLUDE_DIRS} ${PKG_GSTREAMER_INCLUDEDIR} + PATH_SUFFIXES gstreamer-${GSTREAMER_ABI_VERSION}) + +set(GSTREAMER_INCLUDE_DIRS ${GSTREAMER_INCLUDE_DIR} ${GSTREAMER_gstconfig_INCLUDE_DIR}) +list(REMOVE_DUPLICATES GSTREAMER_INCLUDE_DIRS) + +if (PKG_GSTREAMER_PLUGIN_DIR) + set(_GSTREAMER_PLUGIN_DIR ${PKG_GSTREAMER_PLUGIN_DIR}) +else() + get_filename_component(_GSTREAMER_LIB_DIR ${GSTREAMER_LIBRARY} PATH) + set(_GSTREAMER_PLUGIN_DIR ${_GSTREAMER_LIB_DIR}/gstreamer-${GSTREAMER_ABI_VERSION}) +endif() + +set(GSTREAMER_PLUGIN_DIR ${_GSTREAMER_PLUGIN_DIR} + CACHE PATH "The path to the gstreamer plugins installation directory") + +mark_as_advanced(GSTREAMER_LIBRARY + GSTREAMER_INCLUDE_DIR + GSTREAMER_gstconfig_INCLUDE_DIR + GSTREAMER_PLUGIN_DIR) + +# Version check +if (GStreamer_FIND_VERSION) + if (PKG_GSTREAMER_FOUND) + if("${PKG_GSTREAMER_VERSION}" VERSION_LESS "${GStreamer_FIND_VERSION}") + if(NOT GStreamer_FIND_QUIETLY) + message(STATUS "Found GStreamer version ${PKG_GSTREAMER_VERSION}, but at least version ${GStreamer_FIND_VERSION} is required") + endif() + set(GSTREAMER_VERSION_COMPATIBLE FALSE) + else() + set(GSTREAMER_VERSION_COMPATIBLE TRUE) + endif() + elseif(GSTREAMER_INCLUDE_DIR) + include(CheckCXXSourceCompiles) + + set(CMAKE_REQUIRED_INCLUDES ${GSTREAMER_INCLUDE_DIR}) + string(REPLACE "." "," _comma_version ${GStreamer_FIND_VERSION}) + # Hack to invalidate the cached value + set(GSTREAMER_VERSION_COMPATIBLE GSTREAMER_VERSION_COMPATIBLE) + + check_cxx_source_compiles(" +#define G_BEGIN_DECLS +#define G_END_DECLS +#include +#if GST_CHECK_VERSION(${_comma_version}) +int main() { return 0; } +#else +# error \"GStreamer version incompatible\" +#endif +" GSTREAMER_VERSION_COMPATIBLE) + + if (NOT GSTREAMER_VERSION_COMPATIBLE AND NOT GStreamer_FIND_QUIETLY) + message(STATUS "GStreamer ${GStreamer_FIND_VERSION} is required, but the version found is older") + endif() + else() + # We didn't find gstreamer at all + set(GSTREAMER_VERSION_COMPATIBLE FALSE) + endif() +else() + # No version constrain was specified, thus we consider the version compatible + set(GSTREAMER_VERSION_COMPATIBLE TRUE) +endif() + + +include(FindPackageHandleStandardArgs) +find_package_handle_standard_args(GStreamer DEFAULT_MSG + GSTREAMER_LIBRARY GSTREAMER_INCLUDE_DIRS + GSTREAMER_VERSION_COMPATIBLE ${_GSTREAMER_EXTRA_VARIABLES}) \ No newline at end of file diff --git a/cmake/modules/FindGStreamerPluginsBase.cmake b/cmake/modules/FindGStreamerPluginsBase.cmake new file mode 100644 index 00000000000..b4602e22982 --- /dev/null +++ b/cmake/modules/FindGStreamerPluginsBase.cmake @@ -0,0 +1,94 @@ +# - Try to find gst-plugins-base +# Once done this will define +# +# GSTREAMER_PLUGINS_BASE_FOUND - system has gst-plugins-base +# +# And for all the plugin libraries specified in the COMPONENTS +# of find_package, this module will define: +# +# GSTREAMER__LIBRARY_FOUND - system has +# GSTREAMER__LIBRARY - the library +# GSTREAMER__INCLUDE_DIR - the include directory +# +# Copyright (c) 2010, Collabora Ltd. +# @author George Kiagiadakis +# +# Redistribution and use is allowed according to the terms of the BSD license. +# For details see the accompanying COPYING-CMAKE-SCRIPTS file. + +set(GSTREAMER_ABI_VERSION "1.0") + + +# Find the pkg-config file for doing the version check +find_package(PkgConfig) + +if (PKG_CONFIG_FOUND) + pkg_check_modules(PKG_GSTREAMER_PLUGINS_BASE QUIET gstreamer-plugins-base-${GSTREAMER_ABI_VERSION}) +endif() + + +# Find the plugin libraries +include(MacroFindGStreamerLibrary) + +if (NOT DEFINED GStreamerPluginsBase_FIND_QUIETLY) + set(GStreamerPluginsBase_FIND_QUIETLY 0) +endif() + +macro(_find_gst_plugins_base_component _name _header) + find_gstreamer_library(${_name} ${_header} ${GSTREAMER_ABI_VERSION} ${GStreamerPluginsBase_FIND_QUIETLY}) + set(_GSTREAMER_PLUGINS_BASE_EXTRA_VARIABLES ${_GSTREAMER_PLUGINS_BASE_EXTRA_VARIABLES} + GSTREAMER_${_name}_LIBRARY GSTREAMER_${_name}_INCLUDE_DIR) +endmacro() + +foreach(_component ${GStreamerPluginsBase_FIND_COMPONENTS}) + if (${_component} STREQUAL "app") + _find_gst_plugins_base_component(APP gstappsrc.h) + elseif (${_component} STREQUAL "audio") + _find_gst_plugins_base_component(AUDIO audio.h) + elseif (${_component} STREQUAL "fft") + _find_gst_plugins_base_component(FFT gstfft.h) + elseif (${_component} STREQUAL "riff") + _find_gst_plugins_base_component(RIFF riff-ids.h) + elseif (${_component} STREQUAL "rtp") + _find_gst_plugins_base_component(RTP gstrtpbuffer.h) + elseif (${_component} STREQUAL "rtsp") + _find_gst_plugins_base_component(RTSP gstrtspdefs.h) + elseif (${_component} STREQUAL "sdp") + _find_gst_plugins_base_component(SDP gstsdp.h) + elseif (${_component} STREQUAL "tag") + _find_gst_plugins_base_component(TAG tag.h) + elseif (${_component} STREQUAL "pbutils") + _find_gst_plugins_base_component(PBUTILS pbutils.h) + elseif (${_component} STREQUAL "video") + _find_gst_plugins_base_component(VIDEO video.h) + else() + message (AUTHOR_WARNING "FindGStreamer.cmake: Invalid component \"${_component}\" was specified") + endif() +endforeach() + + +# Version check +if (GStreamerPluginsBase_FIND_VERSION) + if (PKG_GSTREAMER_PLUGINS_BASE_FOUND) + if("${PKG_GSTREAMER_PLUGINS_BASE_VERSION}" VERSION_LESS "${GStreamerPluginsBase_FIND_VERSION}") + if (NOT GStreamerPluginsBase_FIND_QUIETLY) + message(STATUS "Found gst-plugins-base version ${PKG_GSTREAMER_PLUGINS_BASE_VERSION}, but at least version ${GStreamerPluginsBase_FIND_VERSION} is required") + endif() + set(GSTREAMER_PLUGINS_BASE_VERSION_COMPATIBLE FALSE) + else() + set(GSTREAMER_PLUGINS_BASE_VERSION_COMPATIBLE TRUE) + endif() + else() + # We can't make any version checks without pkg-config, just assume version is compatible and hope... + set(GSTREAMER_PLUGINS_BASE_VERSION_COMPATIBLE TRUE) + endif() +else() + # No version constrain was specified, thus we consider the version compatible + set(GSTREAMER_PLUGINS_BASE_VERSION_COMPATIBLE TRUE) +endif() + + +include(FindPackageHandleStandardArgs) +find_package_handle_standard_args(GStreamerPluginsBase DEFAULT_MSG + GSTREAMER_PLUGINS_BASE_VERSION_COMPATIBLE + ${_GSTREAMER_PLUGINS_BASE_EXTRA_VARIABLES}) \ No newline at end of file diff --git a/cmake/modules/FindKissFFT.cmake b/cmake/modules/FindKissFFT.cmake new file mode 100644 index 00000000000..b4b10a8f318 --- /dev/null +++ b/cmake/modules/FindKissFFT.cmake @@ -0,0 +1,46 @@ +#.rst: +# FindKissFFT +# ------------ +# Finds the KissFFT as a Fast Fourier Transformation (FFT) library +# +# This will define the following variables: +# +# KISSFFT_FOUND - System has KissFFT +# KISSFFT_INCLUDE_DIRS - the KissFFT include directory +# KISSFFT_LIBRARIES - the KissFFT libraries +# + +if(ENABLE_INTERNAL_KISSFFT) + # KissFFT is located in xbmc/contrib/kissfft + set(KISSFFT_FOUND TRUE) + set(KISSFFT_INCLUDE_DIRS "${CMAKE_SOURCE_DIR}/xbmc/contrib") + message(STATUS "Found KissFFT: ${KISSFFT_INCLUDE_DIRS}") +else() + find_package(PkgConfig) + if(PKG_CONFIG_FOUND) + pkg_check_modules(PC_KISSFFT kissfft QUIET) + endif() + + find_path(KISSFFT_INCLUDE_DIR kissfft/kiss_fft.h kissfft/kiss_fftr.h + PATHS ${PC_KISSFFT_INCLUDEDIR}) + find_library(KISSFFT_LIBRARY NAMES kissfft-float kissfft-int32 kissfft-int16 kissfft-simd + PATHS ${PC_KISSFFT_LIBDIR}) + + # Check if all REQUIRED_VARS are satisfied and set KISSFFT_FOUND + include(FindPackageHandleStandardArgs) + find_package_handle_standard_args(KissFFT REQUIRED_VARS KISSFFT_INCLUDE_DIR KISSFFT_LIBRARY) + + if(KISSFFT_FOUND) + set(KISSFFT_INCLUDE_DIRS ${KISSFFT_INCLUDE_DIR}/kissfft) + set(KISSFFT_LIBRARIES ${KISSFFT_LIBRARY}) + + if(NOT TARGET kissfft) + add_library(kissfft UNKNOWN IMPORTED) + set_target_properties(kissfft PROPERTIES + IMPORTED_LOCATION "${KISSFFT_LIBRARY}" + INTERFACE_INCLUDE_DIRECTORIES "${KISSFFT_INCLUDE_DIR}") + endif() + endif() + + mark_as_advanced(KISSFFT_INCLUDE_DIR KISSFFT_LIBRARY) +endif() \ No newline at end of file diff --git a/cmake/modules/FindRtAudio.cmake b/cmake/modules/FindRtAudio.cmake new file mode 100644 index 00000000000..50dde38b17a --- /dev/null +++ b/cmake/modules/FindRtAudio.cmake @@ -0,0 +1,47 @@ +# https://github.com/idiap/juicer/blob/master/cmake/FindRtAudio.cmake +# +# Copyright 2015 by Idiap Research Institute +# +# Licensed under 3-clause BSD. +# +# Author(s): +# Phil Garner, November 2015 +# +# ...but basically copied from FindSndFile in libube, in turn from the examples +# on the web. +# + +# +# Try to find RtAudio +# Once done this will define +# RTAUDIO_FOUND - System has RtAudio +# RTAUDIO_INCLUDE_DIR - The RtAudio include directories +# RTAUDIO_LIBRARIES - The libraries needed to use RtAudio +# RTAUDIO_DEFINITIONS - Compiler switches required for using RtAudio +# RTAUDIO_VERSION_STRING - the version of RtAudio found +# + +find_package(PkgConfig) +pkg_check_modules(PC_RTAUDIO rtaudio) + +set(RTAUDIO_DEFINITIONS ${PC_RTAUDIO_CFLAGS_OTHER}) +set(RTAUDIO_VERSION_STRING ${PC_RTAUDIO_VERSION}) + +find_path( + RTAUDIO_INCLUDE_DIR RtAudio.h + HINTS ${PC_RTAUDIO_INCLUDEDIR} ${PC_RTAUDIO_INCLUDE_DIRS} +) + +find_library( + RTAUDIO_LIBRARIES NAMES rtaudio + HINTS ${PC_RTAUDIO_LIBDIR} ${PC_RTAUDIO_LIBRARY_DIRS} +) + +include(FindPackageHandleStandardArgs) +find_package_handle_standard_args( + RtAudio + REQUIRED_VARS RTAUDIO_LIBRARIES RTAUDIO_INCLUDE_DIR + VERSION_VAR RTAUDIO_VERSION_STRING +) + +#mark_as_advanced(RTAUDIO_INCLUDE_DIR RTAUDIO_LIBRARIES) \ No newline at end of file diff --git a/cmake/modules/FindUDev.cmake b/cmake/modules/FindUDev.cmake new file mode 100644 index 00000000000..0ee4a76dfc7 --- /dev/null +++ b/cmake/modules/FindUDev.cmake @@ -0,0 +1,85 @@ +# - try to find the udev library +# +# Cache Variables: (probably not for direct use in your scripts) +# UDEV_INCLUDE_DIR +# UDEV_SOURCE_DIR +# UDEV_LIBRARY +# +# Non-cache variables you might use in your CMakeLists.txt: +# UDEV_FOUND +# UDEV_INCLUDE_DIRS +# UDEV_LIBRARIES +# +# Requires these CMake modules: +# FindPackageHandleStandardArgs (known included with CMake >=2.6.2) +# +# Original Authors: +# 2014, Kevin M. Godby +# 2021, Ryan Pavlik +# +# Copyright 2014, Kevin M. Godby +# Copyright 2021, Collabora, Ltd. +# +# SPDX-License-Identifier: BSL-1.0 +# +# Distributed under the Boost Software License, Version 1.0. +# (See accompanying file LICENSE_1_0.txt or copy at +# http://www.boost.org/LICENSE_1_0.txt) + +set(UDEV_ROOT_DIR + "${UDEV_ROOT_DIR}" + CACHE + PATH + "Directory to search for udev") + +if(NOT ANDROID) + find_package(PkgConfig QUIET) + if(PKG_CONFIG_FOUND) + pkg_check_modules(PC_LIBUDEV QUIET libudev) + endif() +endif() + +find_library(UDEV_LIBRARY + NAMES + udev + PATHS + ${PC_LIBUDEV_LIBRARY_DIRS} + ${PC_LIBUDEV_LIBDIR} + HINTS + "${UDEV_ROOT_DIR}" + PATH_SUFFIXES + lib + ) + +get_filename_component(_libdir "${UDEV_LIBRARY}" PATH) + +find_path(UDEV_INCLUDE_DIR + NAMES + libudev.h + PATHS + ${PC_LIBUDEV_INCLUDE_DIRS} + ${PC_LIBUDEV_INCLUDEDIR} + HINTS + "${_libdir}" + "${_libdir}/.." + "${UDEV_ROOT_DIR}" + PATH_SUFFIXES + include + ) + +include(FindPackageHandleStandardArgs) +find_package_handle_standard_args(UDev + DEFAULT_MSG + UDEV_LIBRARY + UDEV_INCLUDE_DIR + ) + +if(UDEV_FOUND) + list(APPEND UDEV_LIBRARIES ${UDEV_LIBRARY}) + list(APPEND UDEV_INCLUDE_DIRS ${UDEV_INCLUDE_DIR}) + mark_as_advanced(UDEV_ROOT_DIR) +endif() + +mark_as_advanced(UDEV_INCLUDE_DIR + UDEV_LIBRARY) + diff --git a/cmake/modules/Findlibusb-1.0.cmake b/cmake/modules/Findlibusb-1.0.cmake new file mode 100644 index 00000000000..bc63763ec65 --- /dev/null +++ b/cmake/modules/Findlibusb-1.0.cmake @@ -0,0 +1,98 @@ +# - Try to find libusb-1.0 +# Once done this will define +# +# LIBUSB_1_FOUND - system has libusb +# LIBUSB_1_INCLUDE_DIRS - the libusb include directory +# LIBUSB_1_LIBRARIES - Link these to use libusb +# LIBUSB_1_DEFINITIONS - Compiler switches required for using libusb +# +# Adapted from cmake-modules Google Code project +# +# Copyright (c) 2006 Andreas Schneider +# +# (Changes for libusb) Copyright (c) 2008 Kyle Machulis +# +# Redistribution and use is allowed according to the terms of the New BSD license. +# +# CMake-Modules Project New BSD License +# +# Redistribution and use in source and binary forms, with or without +# modification, are permitted provided that the following conditions are met: +# +# * Redistributions of source code must retain the above copyright notice, this +# list of conditions and the following disclaimer. +# +# * Redistributions in binary form must reproduce the above copyright notice, +# this list of conditions and the following disclaimer in the +# documentation and/or other materials provided with the distribution. +# +# * Neither the name of the CMake-Modules Project nor the names of its +# contributors may be used to endorse or promote products derived from this +# software without specific prior written permission. +# +# THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND +# ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED +# WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE +# DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR +# ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES +# (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; +# LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON +# ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT +# (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS +# SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. +# + + +if (LIBUSB_1_LIBRARIES AND LIBUSB_1_INCLUDE_DIRS) + # in cache already + set(LIBUSB_FOUND TRUE) +else (LIBUSB_1_LIBRARIES AND LIBUSB_1_INCLUDE_DIRS) + find_path(LIBUSB_1_INCLUDE_DIR + NAMES + libusb.h + PATHS + /usr/include + /usr/local/include + /opt/local/include + /sw/include + PATH_SUFFIXES + libusb-1.0 + ) + + find_library(LIBUSB_1_LIBRARY + NAMES + usb-1.0 usb + PATHS + /usr/lib + /usr/local/lib + /opt/local/lib + /sw/lib + ) + + set(LIBUSB_1_INCLUDE_DIRS + ${LIBUSB_1_INCLUDE_DIR} + ) + set(LIBUSB_1_LIBRARIES + ${LIBUSB_1_LIBRARY} +) + + if (LIBUSB_1_INCLUDE_DIRS AND LIBUSB_1_LIBRARIES) + set(LIBUSB_1_FOUND TRUE) + endif (LIBUSB_1_INCLUDE_DIRS AND LIBUSB_1_LIBRARIES) + + if (LIBUSB_1_FOUND) + if (NOT libusb_1_FIND_QUIETLY) + message(STATUS "Found libusb-1.0:") + message(STATUS " - Includes: ${LIBUSB_1_INCLUDE_DIRS}") + message(STATUS " - Libraries: ${LIBUSB_1_LIBRARIES}") + endif (NOT libusb_1_FIND_QUIETLY) + else (LIBUSB_1_FOUND) + if (libusb_1_FIND_REQUIRED) + message(FATAL_ERROR "Could not find libusb") + endif (libusb_1_FIND_REQUIRED) + endif (LIBUSB_1_FOUND) + + # show the LIBUSB_1_INCLUDE_DIRS and LIBUSB_1_LIBRARIES variables only in the advanced view + mark_as_advanced(LIBUSB_1_INCLUDE_DIRS LIBUSB_1_LIBRARIES) + +endif (LIBUSB_1_LIBRARIES AND LIBUSB_1_INCLUDE_DIRS) \ No newline at end of file diff --git a/cmake/modules/Findsndfile.cmake b/cmake/modules/Findsndfile.cmake new file mode 100644 index 00000000000..76edbe1c221 --- /dev/null +++ b/cmake/modules/Findsndfile.cmake @@ -0,0 +1,36 @@ +# +# Try to find libsndfile +# Once done this will define +# +# SNDFILE_FOUND - libsndfile was found +# SNDFILE_INCLUDE_DIR - the libsndfile include directory +# SNDFILE_LIBRARIES - libsndfile libraries to link to +# +# SPDX-FileCopyrightText: 2008 Sebastian Trueg +# SPDX-License-Identifier: BSD-3-Clause + +if ( SNDFILE_INCLUDE_DIR AND SNDFILE_LIBRARIES ) + # in cache already + SET(Sndfile_FIND_QUIETLY TRUE) +endif ( SNDFILE_INCLUDE_DIR AND SNDFILE_LIBRARIES ) + +IF (NOT WIN32) + pkg_check_modules(_pc_SNDFILE sndfile) +ENDIF (NOT WIN32) + + +FIND_PATH(SNDFILE_INCLUDE_DIR + NAMES sndfile.h + HINTS ${_pc_SNDFILE_INCLUDE_DIRS} +) + +FIND_LIBRARY(SNDFILE_LIBRARIES + NAMES sndfile + HINTS ${_pc_SNDFILE_LIBRARY_DIRS} +) + +include(FindPackageHandleStandardArgs) +FIND_PACKAGE_HANDLE_STANDARD_ARGS(sndfile DEFAULT_MSG SNDFILE_INCLUDE_DIR SNDFILE_LIBRARIES ) + +# show the SNDFILE_INCLUDE_DIR and SNDFILE_LIBRARIES variables only in the advanced view +MARK_AS_ADVANCED(SNDFILE_INCLUDE_DIR SNDFILE_LIBRARIES ) \ No newline at end of file diff --git a/cmake/modules/Finduriparser.cmake b/cmake/modules/Finduriparser.cmake new file mode 100644 index 00000000000..90addfa7be7 --- /dev/null +++ b/cmake/modules/Finduriparser.cmake @@ -0,0 +1,35 @@ +# Find the UriParser library +# Defines: + +# URIPARSER_INCLUDE_DIR - uriparser include directory +# URIPARSER_LIBRARY - uriparser library file +# URIPARSER_FOUND - TRUE if uriparser is found + +if (URIPARSER_INCLUDE_DIR) + #check cache + set(URIPARSER_FIND_QUIETLY TRUE) +endif () + +if (NOT URIPARSER_INCLUDE_DIR) + find_path(URIPARSER_INCLUDE_DIR NAMES Uri.h PATH_SUFFIXES uriparser) + set(URIPARSER_INCLUDE_DIR ${URIPARSER_INCLUDE_DIR}/uriparser CACHE PATH "uriparser includes") +endif () + +find_library(URIPARSER_LIBRARY NAMES uriparser) + +if (URIPARSER_INCLUDE_DIR AND URIPARSER_LIBRARY) + set(URIPARSER_FOUND TRUE) + set(UriParser_FOUND TRUE) +endif () + +if (URIPARSER_FOUND) + if (NOT URIPARSER_FIND_QUIETLY) + message(STATUS "Found UriParser library: ${URIPARSER_LIBRARY}") + endif () +else () + if (NOT URIPARSER_FIND_QUIETLY) + message(FATAL_ERROR "Could NOT find UriParser library") + else () + message(STATUS "Could NOT find UriParser library") + endif () +endif () \ No newline at end of file diff --git a/cmake/modules/MacroFindGStreamerLibrary.cmake b/cmake/modules/MacroFindGStreamerLibrary.cmake new file mode 100644 index 00000000000..4f7ba737265 --- /dev/null +++ b/cmake/modules/MacroFindGStreamerLibrary.cmake @@ -0,0 +1,57 @@ +# - macro find_gstreamer_library +# +# Copyright (c) 2010, Collabora Ltd. +# @author George Kiagiadakis +# +# Redistribution and use is allowed according to the terms of the BSD license. +# For details see the accompanying COPYING-CMAKE-SCRIPTS file. + +macro(find_gstreamer_library _name _header _abi_version _quiet) + string(TOLOWER ${_name} _lower_name) + string(TOUPPER ${_name} _upper_name) + + if (GSTREAMER_${_upper_name}_LIBRARY AND GSTREAMER_${_upper_name}_INCLUDE_DIR) + set(_GSTREAMER_${_upper_name}_QUIET TRUE) + else() + set(_GSTREAMER_${_upper_name}_QUIET FALSE) + endif() + + if (PKG_CONFIG_FOUND) + pkg_check_modules(PKG_GSTREAMER_${_upper_name} QUIET gstreamer-${_lower_name}-${_abi_version}) + endif() + + find_library(GSTREAMER_${_upper_name}_LIBRARY + NAMES gst${_lower_name}-${_abi_version} + HINTS ${PKG_GSTREAMER_${_upper_name}_LIBRARY_DIRS} + ${PKG_GSTREAMER_${_upper_name}_LIBDIR} + ) + + find_path(GSTREAMER_${_upper_name}_INCLUDE_DIR + gst/${_lower_name}/${_header} + HINTS ${PKG_GSTREAMER_${_upper_name}_INCLUDE_DIRS} + ${PKG_GSTREAMER_${_upper_name}_INCLUDEDIR} + PATH_SUFFIXES gstreamer-${_abi_version} + ) + + if (GSTREAMER_${_upper_name}_LIBRARY AND GSTREAMER_${_upper_name}_INCLUDE_DIR) + set(GSTREAMER_${_upper_name}_LIBRARY_FOUND TRUE) + else() + set(GSTREAMER_${_upper_name}_LIBRARY_FOUND FALSE) + endif() + + if (NOT _GSTREAMER_${_upper_name}_QUIET AND NOT _quiet) + if (GSTREAMER_${_upper_name}_LIBRARY) + message(STATUS "Found GSTREAMER_${_upper_name}_LIBRARY: ${GSTREAMER_${_upper_name}_LIBRARY}") + else() + message(STATUS "Could NOT find GSTREAMER_${_upper_name}_LIBRARY") + endif() + + if (GSTREAMER_${_upper_name}_INCLUDE_DIR) + message(STATUS "Found GSTREAMER_${_upper_name}_INCLUDE_DIR: ${GSTREAMER_${_upper_name}_INCLUDE_DIR}") + else() + message(STATUS "Could NOT find GSTREAMER_${_upper_name}_INCLUDE_DIR") + endif() + endif() + + mark_as_advanced(GSTREAMER_${_upper_name}_LIBRARY GSTREAMER_${_upper_name}_INCLUDE_DIR) +endmacro() \ No newline at end of file diff --git a/cmake/utils.cmake b/cmake/utils.cmake new file mode 100644 index 00000000000..a8bd097f552 --- /dev/null +++ b/cmake/utils.cmake @@ -0,0 +1,41 @@ + +if (CMAKE_SOURCE_DIR STREQUAL CMAKE_BINARY_DIR) + message(FATAL_ERROR "In-source builds are a really bad idea. If you don't know what you're doing, please create a 'build' folder and call 'cmake ..' from within.") +endif() + +# This function test-compiles a tiny program to see if a definition is defined or not (compiler internal) +function(TEST_IF_DEFINED OUTPUT_VAR DEFINE) + + set(SOURCE " + #ifndef ${DEFINE} + #error + #endif + int main() {}" + ) + + file(WRITE ${CMAKE_CURRENT_BINARY_DIR}/try_compile/main.cpp ${SOURCE}) + + try_compile( + ${OUTPUT_VAR} + ${CMAKE_CURRENT_BINARY_DIR}/try_compile/ + ${CMAKE_CURRENT_BINARY_DIR}/try_compile/main.cpp + ) + + file(REMOVE_RECURSE ${CMAKE_CURRENT_BINARY_DIR}/try_compile) + +endfunction() + +function(copy_file_after_build TARGET_NAME SOURCE_FILE TARGET_FILE) + add_custom_command(TARGET ${TARGET_NAME} POST_BUILD COMMAND ${CMAKE_COMMAND} -E copy_if_different "${SOURCE_FILE}" "${TARGET_FILE}") +endfunction() + +# After compilation copy the dll files to the binary dir +# function(of_copy_runtime_to_bin_dir_after_build TARGET BIN_DIR) +# if (NOT DEFINED OF_DEPS_SHARED_LIBS) +# message(FATAL_ERROR "INTERNAL ERROR: of_copy_runtime_to_bin_dir_after_build: OF_DEPS_SHARED_LIBS is not defined") +# endif() +# foreach(lib_path IN LISTS OF_DEPS_SHARED_LIBS) +# get_filename_component(lib_name ${lib_path} NAME) +# add_custom_command(TARGET ${TARGET} POST_BUILD COMMAND ${CMAKE_COMMAND} -E copy_if_different "${lib_path}" "${BIN_DIR}/${lib_name}") +# endforeach() +# endfunction() diff --git a/conan/libdom/CMakeLists.txt b/conan/libdom/CMakeLists.txt new file mode 100644 index 00000000000..ce54d95b185 --- /dev/null +++ b/conan/libdom/CMakeLists.txt @@ -0,0 +1,219 @@ +cmake_minimum_required(VERSION 3.16) +project(libdom) + +set(LIBDOM_CORE_SOURCES + source/src/core/attr.c + source/src/core/attr.h + source/src/core/cdatasection.c + source/src/core/cdatasection.h + source/src/core/characterdata.c + source/src/core/characterdata.h + source/src/core/comment.c + source/src/core/comment.h + source/src/core/document.c + source/src/core/document.h + source/src/core/document_type.c + source/src/core/document_type.h + source/src/core/doc_fragment.c + source/src/core/doc_fragment.h + source/src/core/element.c + source/src/core/element.h + source/src/core/entity_ref.c + source/src/core/entity_ref.h + source/src/core/implementation.c + source/src/core/namednodemap.c + source/src/core/namednodemap.h + source/src/core/node.c + source/src/core/node.h + source/src/core/nodelist.c + source/src/core/nodelist.h + source/src/core/pi.c + source/src/core/pi.h + source/src/core/string.c + source/src/core/string.h + source/src/core/text.c + source/src/core/text.h + source/src/core/typeinfo.c +) + +set(LIBDOM_EVENTS_SOURCES + source/src/events/custom_event.c + source/src/events/custom_event.h + source/src/events/dispatch.c + source/src/events/dispatch.h + source/src/events/document_event.c + source/src/events/document_event.h + source/src/events/event.c + source/src/events/event.h + source/src/events/event_listener.c + source/src/events/event_listener.h + source/src/events/event_target.c + source/src/events/event_target.h + source/src/events/keyboard_event.c + source/src/events/keyboard_event.h + source/src/events/mouse_event.c + source/src/events/mouse_event.h + source/src/events/mouse_multi_wheel_event.c + source/src/events/mouse_multi_wheel_event.h + source/src/events/mouse_wheel_event.c + source/src/events/mouse_wheel_event.h + source/src/events/mutation_event.c + source/src/events/mutation_event.h + source/src/events/mutation_name_event.c + source/src/events/mutation_name_event.h + source/src/events/text_event.c + source/src/events/text_event.h + source/src/events/ui_event.c + source/src/events/ui_event.h +) + +set(LIBDOM_HTML_SOURCES + source/src/html/html_anchor_element.c + source/src/html/html_anchor_element.h + source/src/html/html_applet_element.c + source/src/html/html_applet_element.h + source/src/html/html_area_element.c + source/src/html/html_area_element.h + source/src/html/html_basefont_element.c + source/src/html/html_basefont_element.h + source/src/html/html_base_element.c + source/src/html/html_base_element.h + source/src/html/html_body_element.c + source/src/html/html_body_element.h + source/src/html/html_br_element.c + source/src/html/html_br_element.h + source/src/html/html_button_element.c + source/src/html/html_button_element.h + source/src/html/html_canvas_element.c + source/src/html/html_canvas_element.h + source/src/html/html_collection.c + source/src/html/html_collection.h + source/src/html/html_directory_element.c + source/src/html/html_directory_element.h + source/src/html/html_div_element.c + source/src/html/html_div_element.h + source/src/html/html_dlist_element.c + source/src/html/html_dlist_element.h + source/src/html/html_document.c + source/src/html/html_document.h + source/src/html/html_document_strings.h + source/src/html/html_element.c + source/src/html/html_element.h + source/src/html/html_fieldset_element.c + source/src/html/html_fieldset_element.h + source/src/html/html_font_element.c + source/src/html/html_font_element.h + source/src/html/html_form_element.c + source/src/html/html_form_element.h + source/src/html/html_frameset_element.c + source/src/html/html_frameset_element.h + source/src/html/html_frame_element.c + source/src/html/html_frame_element.h + source/src/html/html_heading_element.c + source/src/html/html_heading_element.h + source/src/html/html_head_element.c + source/src/html/html_head_element.h + source/src/html/html_hr_element.c + source/src/html/html_hr_element.h + source/src/html/html_html_element.c + source/src/html/html_html_element.h + source/src/html/html_iframe_element.c + source/src/html/html_iframe_element.h + source/src/html/html_image_element.c + source/src/html/html_image_element.h + source/src/html/html_input_element.c + source/src/html/html_input_element.h + source/src/html/html_isindex_element.c + source/src/html/html_isindex_element.h + source/src/html/html_label_element.c + source/src/html/html_label_element.h + source/src/html/html_legend_element.c + source/src/html/html_legend_element.h + source/src/html/html_link_element.c + source/src/html/html_link_element.h + source/src/html/html_li_element.c + source/src/html/html_li_element.h + source/src/html/html_map_element.c + source/src/html/html_map_element.h + source/src/html/html_menu_element.c + source/src/html/html_menu_element.h + source/src/html/html_meta_element.c + source/src/html/html_meta_element.h + source/src/html/html_mod_element.c + source/src/html/html_mod_element.h + source/src/html/html_object_element.c + source/src/html/html_object_element.h + source/src/html/html_olist_element.c + source/src/html/html_olist_element.h + source/src/html/html_options_collection.c + source/src/html/html_options_collection.h + source/src/html/html_option_element.c + source/src/html/html_option_element.h + source/src/html/html_opt_group_element.c + source/src/html/html_opt_group_element.h + source/src/html/html_paragraph_element.c + source/src/html/html_paragraph_element.h + source/src/html/html_param_element.c + source/src/html/html_param_element.h + source/src/html/html_pre_element.c + source/src/html/html_pre_element.h + source/src/html/html_quote_element.c + source/src/html/html_quote_element.h + source/src/html/html_script_element.c + source/src/html/html_script_element.h + source/src/html/html_select_element.c + source/src/html/html_select_element.h + source/src/html/html_style_element.c + source/src/html/html_style_element.h + source/src/html/html_tablecaption_element.c + source/src/html/html_tablecaption_element.h + source/src/html/html_tablecell_element.c + source/src/html/html_tablecell_element.h + source/src/html/html_tablecol_element.c + source/src/html/html_tablecol_element.h + source/src/html/html_tablerow_element.c + source/src/html/html_tablerow_element.h + source/src/html/html_tablesection_element.c + source/src/html/html_tablesection_element.h + source/src/html/html_table_element.c + source/src/html/html_table_element.h + source/src/html/html_text_area_element.c + source/src/html/html_text_area_element.h + source/src/html/html_title_element.c + source/src/html/html_title_element.h + source/src/html/html_ulist_element.c + source/src/html/html_ulist_element.h +) + +set(LIBDOM_UTILS_SOURCES + source/src/utils/character_valid.c + source/src/utils/character_valid.h + source/src/utils/hashtable.c + source/src/utils/hashtable.h + source/src/utils/list.h + source/src/utils/namespace.c + source/src/utils/namespace.h + source/src/utils/utils.h + source/src/utils/validate.c + source/src/utils/validate.h +) + +add_library(libdom_core STATIC ${LIBDOM_CORE_SOURCES}) +add_library(libdom_events STATIC ${LIBDOM_EVENTS_SOURCES}) +add_library(libdom_html STATIC ${LIBDOM_HTML_SOURCES}) +add_library(libdom_utils STATIC ${LIBDOM_UTILS_SOURCES}) + +add_library(libdom::core ALIAS libdom_core) +add_library(libdom::events ALIAS libdom_events) +add_library(libdom::html ALIAS libdom_html) +add_library(libdom::utils ALIAS libdom_utils) + +target_include_directories(libdom_core PUBLIC source/include) +target_include_directories(libdom_events PUBLIC source/include) +target_include_directories(libdom_html PUBLIC source/include) +target_include_directories(libdom_utils PUBLIC source/include) + +target_compile_features(libdom_core PUBLIC c_std_99) +target_compile_features(libdom_events PUBLIC c_std_99) +target_compile_features(libdom_html PUBLIC c_std_99) +target_compile_features(libdom_utils PUBLIC c_std_99) diff --git a/conan/libdom/conanfile.py b/conan/libdom/conanfile.py new file mode 100644 index 00000000000..86a92eae8e2 --- /dev/null +++ b/conan/libdom/conanfile.py @@ -0,0 +1,31 @@ +from conan import ConanFile +from conan.tools.scm import Git +from conan.tools.files import copy +from conan.tools.cmake import CMake +import os + +class LibDomConan(ConanFile): + name = "libdom" + version = "0.4.1" + package_type = "python-require" + exports = "*" + settings = "os", "compiler", "build_type", "arch" + generators = "CMakeDeps", "CMakeToolchain" + + def export_sources(self): + copy(self, "CMakeLists.txt", self.recipe_folder, self.export_sources_folder) + + def source(self): + git = Git(self) + git.clone(url="git://git.netsurf-browser.org/libdom.git", target="source") + git.folder = "source" + git.checkout("release/0.4.1") + + def requirements(self): + self.requires("libparserutils/0.2.4@user/stable") + + def build(self): + cmake = CMake(self) + cmake.configure(build_script_folder=self.export_sources_folder) + cmake.build() + diff --git a/conan/libparserutils/CMakeLists.txt b/conan/libparserutils/CMakeLists.txt new file mode 100644 index 00000000000..dc3ad3beb07 --- /dev/null +++ b/conan/libparserutils/CMakeLists.txt @@ -0,0 +1,35 @@ +cmake_minimum_required(VERSION 3.16) +project(libparserutils) + +set(LIBPARSERUTILS_SOURCES + source/src/charset/codecs/8859_tables.h + source/src/charset/codecs/codec_8859.c + source/src/charset/codecs/codec_ascii.c + source/src/charset/codecs/codec_ext8.c + source/src/charset/codecs/codec_impl.h + source/src/charset/codecs/codec_utf8.c + source/src/charset/codecs/codec_utf16.c + source/src/charset/codecs/ext8_tables.h + source/src/charset/encodings/utf8.c + source/src/charset/encodings/utf8impl.h + source/src/charset/encodings/utf16.c + source/src/charset/aliases.c + source/src/charset/aliases.h + source/src/charset/codec.c + source/src/input/filter.c + source/src/input/filter.h + source/src/input/inputstream.c + source/src/utils/buffer.c + source/src/utils/endian.h + source/src/utils/errors.c + source/src/utils/stack.c + source/src/utils/utils.h + source/src/utils/vector.c +) + + +add_library(libparserutils STATIC ${LIBPARSERUTILS_SOURCES}) +add_library(libparserutils::libparserutils ALIAS libparserutils) +target_include_directories(libparserutils PUBLIC source/include) +target_include_directories(libparserutils PUBLIC source/src) +target_compile_features(libparserutils PUBLIC c_std_99) diff --git a/conan/libparserutils/conanfile.py b/conan/libparserutils/conanfile.py new file mode 100644 index 00000000000..abce9f00aeb --- /dev/null +++ b/conan/libparserutils/conanfile.py @@ -0,0 +1,28 @@ +from conan import ConanFile +from conan.tools.scm import Git +from conan.tools.files import copy +from conan.tools.cmake import CMake +import os + +class LibParserUtilsConan(ConanFile): + name = "libparserutils" + version = "0.2.4" + package_type = "python-require" + exports = "*" + settings = "os", "compiler", "build_type", "arch" + generators = "CMakeDeps", "CMakeToolchain" + + def export_sources(self): + copy(self, "CMakeLists.txt", self.recipe_folder, self.export_sources_folder) + + def source(self): + git = Git(self) + git.clone(url="git://git.netsurf-browser.org/libparserutils.git", target="source") + git.folder = "source" + git.checkout("release/0.2.4") + + def build(self): + cmake = CMake(self) + cmake.configure(build_script_folder=self.export_sources_folder) + cmake.build() + diff --git a/conan/libtess2/CMakeLists.txt b/conan/libtess2/CMakeLists.txt new file mode 100644 index 00000000000..3bbcf6f9eed --- /dev/null +++ b/conan/libtess2/CMakeLists.txt @@ -0,0 +1,34 @@ +cmake_minimum_required(VERSION 3.16) +project(libtess2) + +set(LIBTESS2_SOURCES + source/Source/bucketalloc.c + source/Source/bucketalloc.h + source/Source/dict.c + source/Source/dict.h + source/Source/geom.c + source/Source/geom.h + source/Source/mesh.c + source/Source/mesh.h + source/Source/priorityq.c + source/Source/priorityq.h + source/Source/sweep.c + source/Source/sweep.h + source/Source/tess.c + source/Source/tess.h +) +add_library(libtess2 STATIC ${LIBTESS2_SOURCES}) +add_library(libtess2::libtess2 ALIAS libtess2) +target_include_directories(libtess2 PUBLIC source/Source source/Include) +target_compile_features(libtess2 PUBLIC c_std_99) + +set_target_properties(libtess2 PROPERTIES + ARCHIVE_OUTPUT_DIRECTORY_DEBUG ${CMAKE_BINARY_DIR}/lib + ARCHIVE_OUTPUT_DIRECTORY_RELEASE ${CMAKE_BINARY_DIR}/lib + ARCHIVE_OUTPUT_DIRECTORY_MINSIZEREL ${CMAKE_BINARY_DIR}/lib + ARCHIVE_OUTPUT_DIRECTORY_RELWITHDEBINFO ${CMAKE_BINARY_DIR}/lib + LIBRARY_OUTPUT_DIRECTORY_DEBUG ${CMAKE_BINARY_DIR}/lib + LIBRARY_OUTPUT_DIRECTORY_RELEASE ${CMAKE_BINARY_DIR}/lib + LIBRARY_OUTPUT_DIRECTORY_MINSIZEREL ${CMAKE_BINARY_DIR}/lib + LIBRARY_OUTPUT_DIRECTORY_RELWITHDEBINFO ${CMAKE_BINARY_DIR}/lib +) diff --git a/conan/libtess2/conanfile.py b/conan/libtess2/conanfile.py new file mode 100644 index 00000000000..2e72962e844 --- /dev/null +++ b/conan/libtess2/conanfile.py @@ -0,0 +1,33 @@ +from conan import ConanFile +from conan.tools.scm import Git +from conan.tools.files import copy +from conan.tools.cmake import CMake +from os.path import join + +class LibTess2Conan(ConanFile): + name = "libtess2" + version = "1.0.2" + package_type = "python-require" + exports = "*" + settings = "os", "compiler", "build_type", "arch" + generators = "CMakeDeps", "CMakeToolchain" + + def export_sources(self): + copy(self, "CMakeLists.txt", self.recipe_folder, self.export_sources_folder) + + def source(self): + git = Git(self) + git.clone(url="https://github.com/memononen/libtess2.git", target="source") + git.folder = "source" + git.checkout("v1.0.2") + + def build(self): + cmake = CMake(self) + cmake.configure(build_script_folder=self.export_sources_folder) + cmake.build() + + def package(self): + copy(self, "*.h", join(self.source_folder, "source", "Include"), join(self.package_folder, "include")) + copy(self, "*.lib", join(self.source_folder, "lib"), join(self.package_folder, "lib")) + copy(self, "*.pdb", join(self.source_folder, "lib"), join(self.package_folder, "lib")) + copy(self, "*.a", join(self.source_folder, "lib"), join(self.package_folder, "lib")) diff --git a/conan/svgtiny/CMakeLists.txt b/conan/svgtiny/CMakeLists.txt new file mode 100644 index 00000000000..e69de29bb2d diff --git a/conan/svgtiny/conanfile.py b/conan/svgtiny/conanfile.py new file mode 100644 index 00000000000..1bb64803904 --- /dev/null +++ b/conan/svgtiny/conanfile.py @@ -0,0 +1,27 @@ +from conan import ConanFile +from conan.tools.scm import Git +from conan.tools.cmake import CMake +from conan.tools.files import copy +import os + +class SvgTinyConan(ConanFile): + name = "svgtiny" + version = "0.1.7" + package_type = "python-require" + exports = "*" + + def export_sources(self): + copy(self, "CMakeLists.txt", self.recipe_folder, self.export_sources_folder) + + def source(self): + git = Git(self) + git.clone(url="git://git.netsurf-browser.org/libsvgtiny.git", target=".") + git.checkout("release/0.1.7") + + def requirements(self): + self.requires("libdom/0.4.1@user/stable") + + def build(self): + cmake = CMake(self) + cmake.configure(build_script_folder=os.path.join(self.source_folder, os.pardir)) + cmake.build() diff --git a/conanfile.py b/conanfile.py new file mode 100644 index 00000000000..6a3f714a76a --- /dev/null +++ b/conanfile.py @@ -0,0 +1,52 @@ +from conan import ConanFile +from conan.tools.cmake import CMakeToolchain +from conan.tools.cmake import CMake +import os + +class OFConan(ConanFile): + name = "openFrameworks" + version = "0.11.2" + license = "MIT" + url = "https://openframeworks.cc/" + generators = "CMakeDeps", "CMakeToolchain" + settings = "os", "compiler", "build_type", "arch" + + def include_package(self, name): + thisfilepath = os.path.dirname(os.path.realpath(__file__)) + recipes_path = os.path.join(thisfilepath, "conan", name) + self.run("conan export --user=user --channel=stable conanfile.py", cwd=recipes_path) + + def configure(self): + self.settings.compiler.cppstd = "17" + + self.options["poco/*"].enable_data_sqlite = False + self.options["poco/*"].enable_data_postgresql = False + self.options["poco/*"].enable_data_mysql = False + + def requirements(self): + self.requires("libtiff/4.6.0", force=True) # Unfortunately we have to override these versions and hope they work + self.requires("libwebp/1.3.2", force=True) # This is a conflict between OpenCV and FreeImage + self.requires("freeimage/3.18.0") + self.requires("opencv/3.4.17") + + self.requires("glm/cci.20230113") + self.requires("utfcpp/3.2.3") + self.requires("uriparser/0.9.7") + self.requires("libcurl/8.5.0") + self.requires("freetype/2.13.2") + self.requires("pugixml/1.13") + self.requires("nlohmann_json/3.11.3") + self.requires("assimp/5.2.2") + self.requires("libusb/1.0.26") + self.requires("poco/1.12.5p2") + self.requires("libxml2/2.12.2") + self.requires("glew/2.2.0") + self.requires("glfw/3.3.8") + self.requires("cairo/1.18.0") + + # self.include_package("svgtiny") + # self.include_package("libdom") + # self.include_package("libparserutils") + self.include_package("libtess2") + self.requires("libtess2/1.0.2@user/stable") + #self.requires("svgtiny/0.1.7@user/stable") diff --git a/examples/3d/3DPrimitivesExample/CMakeLists.txt b/examples/3d/3DPrimitivesExample/CMakeLists.txt new file mode 100644 index 00000000000..fed613fc9f4 --- /dev/null +++ b/examples/3d/3DPrimitivesExample/CMakeLists.txt @@ -0,0 +1 @@ +define_example(3DPrimitivesExample) \ No newline at end of file diff --git a/examples/3d/CMakeLists.txt b/examples/3d/CMakeLists.txt new file mode 100644 index 00000000000..ecf48791b0d --- /dev/null +++ b/examples/3d/CMakeLists.txt @@ -0,0 +1,18 @@ +add_subdirectory(3DPrimitivesExample) +add_subdirectory(advanced3dExample) +add_subdirectory(assimp3DModelLoaderExample) +add_subdirectory(cameraLensOffsetExample) +add_subdirectory(cameraParentingExample) +add_subdirectory(cameraRibbonExample) +add_subdirectory(easyCamExample) +add_subdirectory(meshFromCameraExample) +add_subdirectory(modelNoiseExample) +add_subdirectory(normalsExample) +add_subdirectory(ofBoxExample) +add_subdirectory(ofNodeExample) +add_subdirectory(orientationExample) +add_subdirectory(pathsToMeshesExample) +add_subdirectory(pointCloudExample) +add_subdirectory(pointPickerExample) +add_subdirectory(quaternionArcballExample) +add_subdirectory(quaternionLatLongExample) \ No newline at end of file diff --git a/examples/3d/advanced3dExample/CMakeLists.txt b/examples/3d/advanced3dExample/CMakeLists.txt new file mode 100644 index 00000000000..764808510c8 --- /dev/null +++ b/examples/3d/advanced3dExample/CMakeLists.txt @@ -0,0 +1 @@ +define_example(advanced3dExample) \ No newline at end of file diff --git a/examples/3d/assimp3DModelLoaderExample/CMakeLists.txt b/examples/3d/assimp3DModelLoaderExample/CMakeLists.txt new file mode 100644 index 00000000000..cecd66f7602 --- /dev/null +++ b/examples/3d/assimp3DModelLoaderExample/CMakeLists.txt @@ -0,0 +1,2 @@ +define_example(assimp3DModelLoaderExample) +target_link_libraries(assimp3DModelLoaderExample of::ofxAssimpModelLoader) \ No newline at end of file diff --git a/examples/3d/cameraLensOffsetExample/CMakeLists.txt b/examples/3d/cameraLensOffsetExample/CMakeLists.txt new file mode 100644 index 00000000000..858aa02bda7 --- /dev/null +++ b/examples/3d/cameraLensOffsetExample/CMakeLists.txt @@ -0,0 +1,2 @@ +define_example(cameraLensOffsetExample) +target_link_libraries(cameraLensOffsetExample of::ofxOpenCv) \ No newline at end of file diff --git a/examples/3d/cameraParentingExample/CMakeLists.txt b/examples/3d/cameraParentingExample/CMakeLists.txt new file mode 100644 index 00000000000..713ebab1d6c --- /dev/null +++ b/examples/3d/cameraParentingExample/CMakeLists.txt @@ -0,0 +1 @@ +define_example(cameraParentingExample) \ No newline at end of file diff --git a/examples/3d/cameraRibbonExample/CMakeLists.txt b/examples/3d/cameraRibbonExample/CMakeLists.txt new file mode 100644 index 00000000000..918e9f466d5 --- /dev/null +++ b/examples/3d/cameraRibbonExample/CMakeLists.txt @@ -0,0 +1 @@ +define_example(cameraRibbonExample) \ No newline at end of file diff --git a/examples/3d/easyCamExample/CMakeLists.txt b/examples/3d/easyCamExample/CMakeLists.txt new file mode 100644 index 00000000000..adc444c9a9b --- /dev/null +++ b/examples/3d/easyCamExample/CMakeLists.txt @@ -0,0 +1 @@ +define_example(easyCamExample) \ No newline at end of file diff --git a/examples/3d/meshFromCameraExample/CMakeLists.txt b/examples/3d/meshFromCameraExample/CMakeLists.txt new file mode 100644 index 00000000000..6311a659fb2 --- /dev/null +++ b/examples/3d/meshFromCameraExample/CMakeLists.txt @@ -0,0 +1 @@ +define_example(meshFromCameraExample) \ No newline at end of file diff --git a/examples/3d/modelNoiseExample/CMakeLists.txt b/examples/3d/modelNoiseExample/CMakeLists.txt new file mode 100644 index 00000000000..3da671d97e4 --- /dev/null +++ b/examples/3d/modelNoiseExample/CMakeLists.txt @@ -0,0 +1,2 @@ +define_example(modelNoiseExample) +target_link_libraries(modelNoiseExample of::ofxAssimpModelLoader) \ No newline at end of file diff --git a/examples/3d/normalsExample/CMakeLists.txt b/examples/3d/normalsExample/CMakeLists.txt new file mode 100644 index 00000000000..cd7af3c92dc --- /dev/null +++ b/examples/3d/normalsExample/CMakeLists.txt @@ -0,0 +1 @@ +define_example(normalsExample) \ No newline at end of file diff --git a/examples/3d/ofBoxExample/CMakeLists.txt b/examples/3d/ofBoxExample/CMakeLists.txt new file mode 100644 index 00000000000..38e9c0a7541 --- /dev/null +++ b/examples/3d/ofBoxExample/CMakeLists.txt @@ -0,0 +1 @@ +define_example(ofBoxExample) \ No newline at end of file diff --git a/examples/3d/ofNodeExample/CMakeLists.txt b/examples/3d/ofNodeExample/CMakeLists.txt new file mode 100644 index 00000000000..a9a16d7ba50 --- /dev/null +++ b/examples/3d/ofNodeExample/CMakeLists.txt @@ -0,0 +1,2 @@ +define_example(ofNodeExample) +target_link_libraries(ofNodeExample of::ofxGui) \ No newline at end of file diff --git a/examples/3d/orientationExample/CMakeLists.txt b/examples/3d/orientationExample/CMakeLists.txt new file mode 100644 index 00000000000..d6aaa10c552 --- /dev/null +++ b/examples/3d/orientationExample/CMakeLists.txt @@ -0,0 +1 @@ +define_example(orientationExample) \ No newline at end of file diff --git a/examples/3d/pathsToMeshesExample/CMakeLists.txt b/examples/3d/pathsToMeshesExample/CMakeLists.txt new file mode 100644 index 00000000000..20280ec0f78 --- /dev/null +++ b/examples/3d/pathsToMeshesExample/CMakeLists.txt @@ -0,0 +1 @@ +define_example(pathsToMeshesExample) \ No newline at end of file diff --git a/examples/3d/pointCloudExample/CMakeLists.txt b/examples/3d/pointCloudExample/CMakeLists.txt new file mode 100644 index 00000000000..dbb003a78be --- /dev/null +++ b/examples/3d/pointCloudExample/CMakeLists.txt @@ -0,0 +1 @@ +define_example(pointCloudExample) \ No newline at end of file diff --git a/examples/3d/pointPickerExample/CMakeLists.txt b/examples/3d/pointPickerExample/CMakeLists.txt new file mode 100644 index 00000000000..069e834fa62 --- /dev/null +++ b/examples/3d/pointPickerExample/CMakeLists.txt @@ -0,0 +1 @@ +define_example(pointPickerExample) \ No newline at end of file diff --git a/examples/3d/quaternionArcballExample/CMakeLists.txt b/examples/3d/quaternionArcballExample/CMakeLists.txt new file mode 100644 index 00000000000..d35ca262d2a --- /dev/null +++ b/examples/3d/quaternionArcballExample/CMakeLists.txt @@ -0,0 +1 @@ +define_example(quaternionArcballExample) \ No newline at end of file diff --git a/examples/3d/quaternionLatLongExample/CMakeLists.txt b/examples/3d/quaternionLatLongExample/CMakeLists.txt new file mode 100644 index 00000000000..a50642a4b8c --- /dev/null +++ b/examples/3d/quaternionLatLongExample/CMakeLists.txt @@ -0,0 +1 @@ +define_example(quaternionLatLongExample) \ No newline at end of file diff --git a/examples/CMakeLists.txt b/examples/CMakeLists.txt new file mode 100644 index 00000000000..79bfd2d4faf --- /dev/null +++ b/examples/CMakeLists.txt @@ -0,0 +1,83 @@ +message(STATUS "[openframeworks] Configuring examples") + +add_custom_target(build_all_examples) +set_target_properties(build_all_examples PROPERTIES FOLDER "openframeworks/examples") + +# Macro for defining an example with all of its properties +macro(define_example TARGET_NAME) # A macro is executed in the caller's scope (current list is the caller) + set(BIN_DIR "${CMAKE_CURRENT_BINARY_DIR}/bin/$,debug,release>") + + if (MSVC) # In MSVC we add all files so the resource files are shown in the IDE + file(GLOB_RECURSE SOURCES ${CMAKE_CURRENT_LIST_DIR}/**) + else() # But GCC doesn't like compiling resource files + file(GLOB_RECURSE SOURCES ${CMAKE_CURRENT_LIST_DIR}/src/**) + endif() + + add_executable(${TARGET_NAME} EXCLUDE_FROM_ALL) + target_sources(${TARGET_NAME} PRIVATE ${SOURCES}) + target_include_directories(${TARGET_NAME} PUBLIC ${CMAKE_CURRENT_LIST_DIR}/src) + target_link_libraries(${TARGET_NAME} of::openframeworks) + + source_group(TREE "${CMAKE_CURRENT_LIST_DIR}/" PREFIX "" FILES ${SOURCES}) + + target_compile_features(${TARGET_NAME} PRIVATE cxx_std_17) + set_target_properties(${TARGET_NAME} PROPERTIES CXX_EXTENSIONS OFF) + set_target_properties(${TARGET_NAME} PROPERTIES RUNTIME_OUTPUT_DIRECTORY "${BIN_DIR}") + set_property(TARGET ${TARGET_NAME} PROPERTY VS_DEBUGGER_WORKING_DIRECTORY "${BIN_DIR}") + # of_copy_runtime_to_bin_dir_after_build(${TARGET_NAME} "${BIN_DIR}") + + get_filename_component(parent_path ${CMAKE_CURRENT_LIST_DIR} DIRECTORY) + get_filename_component(example_name ${parent_path} NAME) + set_target_properties(${TARGET_NAME} PROPERTIES FOLDER "openframeworks/examples/${example_name}") + + # And copy the resource files to destination after building + if (EXISTS "${CMAKE_CURRENT_LIST_DIR}/bin/data") + add_custom_command(TARGET ${TARGET_NAME} POST_BUILD + COMMAND ${CMAKE_COMMAND} -E + copy_directory "${CMAKE_CURRENT_LIST_DIR}/bin/data" "${BIN_DIR}/data") + endif() + + add_dependencies(build_all_examples ${TARGET_NAME}) +endmacro() + + +# Folders with examples to build +add_subdirectory(3d) + +if (OF_TARGET_ARCHITECTURE MATCHES "android") + # add_subdirectory(android) + message(WARNING "[openframeworks] Android Examples are not yet implemented. Feel free to implement them yourself, test and submit a PR!") +endif() + +add_subdirectory(communication) +add_subdirectory(computer_vision) +add_subdirectory(events) +add_subdirectory(gl) + +if (NOT OF_TARGET_ARCHITECTURE MATCHES "msvc" AND NOT OF_TARGET_ARCHITECTURE MATCHES "macos" AND NOT OF_TARGET_ARCHITECTURE MATCHES "linux") + add_subdirectory(gles) +endif() + +add_subdirectory(graphics) +add_subdirectory(gui) +add_subdirectory(input_output) + +if (OF_TARGET_ARCHITECTURE MATCHES "ios") + #add_subdirectory(ios) + message(WARNING "[openframeworks] iOS Examples are not yet implemented. Feel free to implement them yourself, test and submit a PR!") +endif() + +add_subdirectory(math) +add_subdirectory(shader) +add_subdirectory(sound) +add_subdirectory(strings) +add_subdirectory(templates) +add_subdirectory(threads) + +if (OF_TARGET_ARCHITECTURE MATCHES "tvos") + #add_subdirectory(tvOS) + message(WARNING "[openframeworks] tvOS Examples are not yet implemented. Feel free to implement them yourself, test and submit a PR!") +endif() + +add_subdirectory(video) +add_subdirectory(windowing) diff --git a/examples/android/CMakeLists.txt b/examples/android/CMakeLists.txt new file mode 100644 index 00000000000..cead07e5fcd --- /dev/null +++ b/examples/android/CMakeLists.txt @@ -0,0 +1,21 @@ +add_subdirectory(androidAccelerometerExample) +add_subdirectory(androidAdvanced3DExample) +add_subdirectory(androidAssimpExample) +add_subdirectory(androidAudioExample) +add_subdirectory(androidCameraExample) +add_subdirectory(androidEmptyExample) +add_subdirectory(androidFontExample) +add_subdirectory(androidGuiExample) +add_subdirectory(androidImageExample) +add_subdirectory(androidJavaOnlyActivityExample) +add_subdirectory(androidMultiOFActivitiesExample) +add_subdirectory(androidOpenCVExample) +add_subdirectory(androidOpenCVFaceExample) +add_subdirectory(androidPolygonExample) +add_subdirectory(androidShaderExample) +add_subdirectory(androidSoundPlayerExample) +add_subdirectory(androidSwipeExample) +add_subdirectory(androidTouchExample) +add_subdirectory(androidVBOExample) +add_subdirectory(androidVibratorExample) +add_subdirectory(androidVideoExample) \ No newline at end of file diff --git a/examples/android/androidAccelerometerExample/CMakeLists.txt b/examples/android/androidAccelerometerExample/CMakeLists.txt new file mode 100644 index 00000000000..1dc047e0890 --- /dev/null +++ b/examples/android/androidAccelerometerExample/CMakeLists.txt @@ -0,0 +1,2 @@ +define_example(androidAccelerometerExample) +target_link_libraries(androidAccelerometerExample of::ofxAndroid of::ofxAccelerometer) \ No newline at end of file diff --git a/examples/android/androidAdvanced3DExample/CMakeLists.txt b/examples/android/androidAdvanced3DExample/CMakeLists.txt new file mode 100644 index 00000000000..e10c72227b3 --- /dev/null +++ b/examples/android/androidAdvanced3DExample/CMakeLists.txt @@ -0,0 +1 @@ +define_example(androidAdvanced3DExample) \ No newline at end of file diff --git a/examples/android/androidAssimpExample/CMakeLists.txt b/examples/android/androidAssimpExample/CMakeLists.txt new file mode 100644 index 00000000000..a95150faf16 --- /dev/null +++ b/examples/android/androidAssimpExample/CMakeLists.txt @@ -0,0 +1 @@ +define_example(androidAssimpExample) \ No newline at end of file diff --git a/examples/android/androidAudioExample/CMakeLists.txt b/examples/android/androidAudioExample/CMakeLists.txt new file mode 100644 index 00000000000..7a756d4ee4e --- /dev/null +++ b/examples/android/androidAudioExample/CMakeLists.txt @@ -0,0 +1 @@ +define_example(androidAudioExample) \ No newline at end of file diff --git a/examples/android/androidCameraExample/CMakeLists.txt b/examples/android/androidCameraExample/CMakeLists.txt new file mode 100644 index 00000000000..aee27cfa969 --- /dev/null +++ b/examples/android/androidCameraExample/CMakeLists.txt @@ -0,0 +1 @@ +define_example(androidCameraExample) \ No newline at end of file diff --git a/examples/android/androidEmptyExample/CMakeLists.txt b/examples/android/androidEmptyExample/CMakeLists.txt new file mode 100644 index 00000000000..39c607c9e81 --- /dev/null +++ b/examples/android/androidEmptyExample/CMakeLists.txt @@ -0,0 +1 @@ +define_example(androidEmptyExample) \ No newline at end of file diff --git a/examples/android/androidFontExample/CMakeLists.txt b/examples/android/androidFontExample/CMakeLists.txt new file mode 100644 index 00000000000..c1507e77df3 --- /dev/null +++ b/examples/android/androidFontExample/CMakeLists.txt @@ -0,0 +1 @@ +define_example(androidFontExample) \ No newline at end of file diff --git a/examples/android/androidGuiExample/CMakeLists.txt b/examples/android/androidGuiExample/CMakeLists.txt new file mode 100644 index 00000000000..737c8ba2f40 --- /dev/null +++ b/examples/android/androidGuiExample/CMakeLists.txt @@ -0,0 +1 @@ +define_example(androidGuiExample) \ No newline at end of file diff --git a/examples/android/androidImageExample/CMakeLists.txt b/examples/android/androidImageExample/CMakeLists.txt new file mode 100644 index 00000000000..2dc40857410 --- /dev/null +++ b/examples/android/androidImageExample/CMakeLists.txt @@ -0,0 +1 @@ +define_example(androidImageExample) \ No newline at end of file diff --git a/examples/android/androidJavaOnlyActivityExample/CMakeLists.txt b/examples/android/androidJavaOnlyActivityExample/CMakeLists.txt new file mode 100644 index 00000000000..8e52ad420d6 --- /dev/null +++ b/examples/android/androidJavaOnlyActivityExample/CMakeLists.txt @@ -0,0 +1 @@ +define_example(androidJavaOnlyActivityExample) \ No newline at end of file diff --git a/examples/android/androidMultiOFActivitiesExample/CMakeLists.txt b/examples/android/androidMultiOFActivitiesExample/CMakeLists.txt new file mode 100644 index 00000000000..10fe68880b2 --- /dev/null +++ b/examples/android/androidMultiOFActivitiesExample/CMakeLists.txt @@ -0,0 +1 @@ +define_example(androidMultiOFActivitiesExample) \ No newline at end of file diff --git a/examples/android/androidOpenCVExample/CMakeLists.txt b/examples/android/androidOpenCVExample/CMakeLists.txt new file mode 100644 index 00000000000..267acb609e3 --- /dev/null +++ b/examples/android/androidOpenCVExample/CMakeLists.txt @@ -0,0 +1 @@ +define_example(androidOpenCVExample) \ No newline at end of file diff --git a/examples/android/androidOpenCVFaceExample/CMakeLists.txt b/examples/android/androidOpenCVFaceExample/CMakeLists.txt new file mode 100644 index 00000000000..46db5b3ad7e --- /dev/null +++ b/examples/android/androidOpenCVFaceExample/CMakeLists.txt @@ -0,0 +1 @@ +define_example(androidOpenCVFaceExample) \ No newline at end of file diff --git a/examples/android/androidPolygonExample/CMakeLists.txt b/examples/android/androidPolygonExample/CMakeLists.txt new file mode 100644 index 00000000000..9e701485fcd --- /dev/null +++ b/examples/android/androidPolygonExample/CMakeLists.txt @@ -0,0 +1 @@ +define_example(androidPolygonExample) \ No newline at end of file diff --git a/examples/android/androidShaderExample/CMakeLists.txt b/examples/android/androidShaderExample/CMakeLists.txt new file mode 100644 index 00000000000..5bb61b44875 --- /dev/null +++ b/examples/android/androidShaderExample/CMakeLists.txt @@ -0,0 +1 @@ +define_example(androidShaderExample) \ No newline at end of file diff --git a/examples/android/androidSoundPlayerExample/CMakeLists.txt b/examples/android/androidSoundPlayerExample/CMakeLists.txt new file mode 100644 index 00000000000..f326e06c645 --- /dev/null +++ b/examples/android/androidSoundPlayerExample/CMakeLists.txt @@ -0,0 +1 @@ +define_example(androidSoundPlayerExample) \ No newline at end of file diff --git a/examples/android/androidSwipeExample/CMakeLists.txt b/examples/android/androidSwipeExample/CMakeLists.txt new file mode 100644 index 00000000000..15e89b38a22 --- /dev/null +++ b/examples/android/androidSwipeExample/CMakeLists.txt @@ -0,0 +1 @@ +define_example(androidSwipeExample) \ No newline at end of file diff --git a/examples/android/androidTouchExample/CMakeLists.txt b/examples/android/androidTouchExample/CMakeLists.txt new file mode 100644 index 00000000000..05a9d703856 --- /dev/null +++ b/examples/android/androidTouchExample/CMakeLists.txt @@ -0,0 +1 @@ +define_example(androidTouchExample) \ No newline at end of file diff --git a/examples/android/androidVBOExample/CMakeLists.txt b/examples/android/androidVBOExample/CMakeLists.txt new file mode 100644 index 00000000000..2f0009557fe --- /dev/null +++ b/examples/android/androidVBOExample/CMakeLists.txt @@ -0,0 +1 @@ +define_example(androidVBOExample) \ No newline at end of file diff --git a/examples/android/androidVibratorExample/CMakeLists.txt b/examples/android/androidVibratorExample/CMakeLists.txt new file mode 100644 index 00000000000..e860eaffda8 --- /dev/null +++ b/examples/android/androidVibratorExample/CMakeLists.txt @@ -0,0 +1 @@ +define_example(androidVibratorExample) \ No newline at end of file diff --git a/examples/android/androidVideoExample/CMakeLists.txt b/examples/android/androidVideoExample/CMakeLists.txt new file mode 100644 index 00000000000..14c6c2fe1d1 --- /dev/null +++ b/examples/android/androidVideoExample/CMakeLists.txt @@ -0,0 +1 @@ +define_example(androidVideoExample) \ No newline at end of file diff --git a/examples/communication/CMakeLists.txt b/examples/communication/CMakeLists.txt new file mode 100644 index 00000000000..5527ad1f26f --- /dev/null +++ b/examples/communication/CMakeLists.txt @@ -0,0 +1,10 @@ + +add_subdirectory(firmataExample) +add_subdirectory(networkTcpClientExample) +add_subdirectory(networkTcpServerExample) +add_subdirectory(networkUdpReceiverExample) +add_subdirectory(networkUdpSenderExample) +add_subdirectory(oscChatSystemExample) +add_subdirectory(oscReceiveExample) +add_subdirectory(oscSenderExample) +add_subdirectory(serialExample) diff --git a/examples/communication/firmataExample/CMakeLists.txt b/examples/communication/firmataExample/CMakeLists.txt new file mode 100644 index 00000000000..8bf702b0ec0 --- /dev/null +++ b/examples/communication/firmataExample/CMakeLists.txt @@ -0,0 +1 @@ +define_example(firmataExample) \ No newline at end of file diff --git a/examples/communication/networkTcpClientExample/CMakeLists.txt b/examples/communication/networkTcpClientExample/CMakeLists.txt new file mode 100644 index 00000000000..8ccb704b053 --- /dev/null +++ b/examples/communication/networkTcpClientExample/CMakeLists.txt @@ -0,0 +1,2 @@ +define_example(networkTcpClientExample) +target_link_libraries(networkTcpClientExample of::ofxNetwork) \ No newline at end of file diff --git a/examples/communication/networkTcpServerExample/CMakeLists.txt b/examples/communication/networkTcpServerExample/CMakeLists.txt new file mode 100644 index 00000000000..abce2628ffe --- /dev/null +++ b/examples/communication/networkTcpServerExample/CMakeLists.txt @@ -0,0 +1,2 @@ +define_example(networkTcpServerExample) +target_link_libraries(networkTcpServerExample of::ofxNetwork) \ No newline at end of file diff --git a/examples/communication/networkUdpReceiverExample/CMakeLists.txt b/examples/communication/networkUdpReceiverExample/CMakeLists.txt new file mode 100644 index 00000000000..c3aa29f5ca1 --- /dev/null +++ b/examples/communication/networkUdpReceiverExample/CMakeLists.txt @@ -0,0 +1,2 @@ +define_example(networkUdpReceiverExample) +target_link_libraries(networkUdpReceiverExample of::ofxNetwork) \ No newline at end of file diff --git a/examples/communication/networkUdpSenderExample/CMakeLists.txt b/examples/communication/networkUdpSenderExample/CMakeLists.txt new file mode 100644 index 00000000000..75925354b38 --- /dev/null +++ b/examples/communication/networkUdpSenderExample/CMakeLists.txt @@ -0,0 +1,2 @@ +define_example(networkUdpSenderExample) +target_link_libraries(networkUdpSenderExample of::ofxNetwork) \ No newline at end of file diff --git a/examples/communication/oscChatSystemExample/CMakeLists.txt b/examples/communication/oscChatSystemExample/CMakeLists.txt new file mode 100644 index 00000000000..1089d506249 --- /dev/null +++ b/examples/communication/oscChatSystemExample/CMakeLists.txt @@ -0,0 +1,2 @@ +define_example(oscChatSystemExample) +target_link_libraries(oscChatSystemExample of::ofxOsc) \ No newline at end of file diff --git a/examples/communication/oscReceiveExample/CMakeLists.txt b/examples/communication/oscReceiveExample/CMakeLists.txt new file mode 100644 index 00000000000..c3fd7b00e31 --- /dev/null +++ b/examples/communication/oscReceiveExample/CMakeLists.txt @@ -0,0 +1,2 @@ +define_example(oscReceiveExample) +target_link_libraries(oscReceiveExample of::ofxOsc) \ No newline at end of file diff --git a/examples/communication/oscSenderExample/CMakeLists.txt b/examples/communication/oscSenderExample/CMakeLists.txt new file mode 100644 index 00000000000..daf9ab4f4c6 --- /dev/null +++ b/examples/communication/oscSenderExample/CMakeLists.txt @@ -0,0 +1,2 @@ +define_example(oscSenderExample) +target_link_libraries(oscSenderExample of::ofxOsc) \ No newline at end of file diff --git a/examples/communication/serialExample/CMakeLists.txt b/examples/communication/serialExample/CMakeLists.txt new file mode 100644 index 00000000000..f84a1f56e8f --- /dev/null +++ b/examples/communication/serialExample/CMakeLists.txt @@ -0,0 +1 @@ +define_example(serialExample) \ No newline at end of file diff --git a/examples/computer_vision/CMakeLists.txt b/examples/computer_vision/CMakeLists.txt new file mode 100644 index 00000000000..fc1e5d8b3e5 --- /dev/null +++ b/examples/computer_vision/CMakeLists.txt @@ -0,0 +1,7 @@ + +add_subdirectory(kinectExample) +add_subdirectory(opencvExample) +add_subdirectory(opencvHaarFinderExample) +add_subdirectory(opencvImageClassification) +add_subdirectory(opencvOpticalFlowExample) +add_subdirectory(opencvPeopleDetection) diff --git a/examples/computer_vision/kinectExample/CMakeLists.txt b/examples/computer_vision/kinectExample/CMakeLists.txt new file mode 100644 index 00000000000..96739fd5949 --- /dev/null +++ b/examples/computer_vision/kinectExample/CMakeLists.txt @@ -0,0 +1,2 @@ +define_example(kinectExample) +target_link_libraries(kinectExample of::ofxOpenCv of::ofxKinect) \ No newline at end of file diff --git a/examples/computer_vision/opencvExample/CMakeLists.txt b/examples/computer_vision/opencvExample/CMakeLists.txt new file mode 100644 index 00000000000..e760d62767d --- /dev/null +++ b/examples/computer_vision/opencvExample/CMakeLists.txt @@ -0,0 +1,2 @@ +define_example(opencvExample) +target_link_libraries(opencvExample of::ofxOpenCv) \ No newline at end of file diff --git a/examples/computer_vision/opencvHaarFinderExample/CMakeLists.txt b/examples/computer_vision/opencvHaarFinderExample/CMakeLists.txt new file mode 100644 index 00000000000..167c7bc09d9 --- /dev/null +++ b/examples/computer_vision/opencvHaarFinderExample/CMakeLists.txt @@ -0,0 +1,2 @@ +define_example(opencvHaarFinderExample) +target_link_libraries(opencvHaarFinderExample of::ofxOpenCv) \ No newline at end of file diff --git a/examples/computer_vision/opencvImageClassification/CMakeLists.txt b/examples/computer_vision/opencvImageClassification/CMakeLists.txt new file mode 100644 index 00000000000..aab5954ee0e --- /dev/null +++ b/examples/computer_vision/opencvImageClassification/CMakeLists.txt @@ -0,0 +1,2 @@ +define_example(opencvImageClassification) +target_link_libraries(opencvImageClassification of::ofxOpenCv) \ No newline at end of file diff --git a/examples/computer_vision/opencvOpticalFlowExample/CMakeLists.txt b/examples/computer_vision/opencvOpticalFlowExample/CMakeLists.txt new file mode 100644 index 00000000000..7ea86d0bc79 --- /dev/null +++ b/examples/computer_vision/opencvOpticalFlowExample/CMakeLists.txt @@ -0,0 +1,2 @@ +define_example(opencvOpticalFlowExample) +target_link_libraries(opencvOpticalFlowExample of::ofxOpenCv) \ No newline at end of file diff --git a/examples/computer_vision/opencvPeopleDetection/CMakeLists.txt b/examples/computer_vision/opencvPeopleDetection/CMakeLists.txt new file mode 100644 index 00000000000..d53562408d9 --- /dev/null +++ b/examples/computer_vision/opencvPeopleDetection/CMakeLists.txt @@ -0,0 +1,2 @@ +define_example(opencvPeopleDetection) +target_link_libraries(opencvPeopleDetection of::ofxOpenCv) \ No newline at end of file diff --git a/examples/events/CMakeLists.txt b/examples/events/CMakeLists.txt new file mode 100644 index 00000000000..82ddece5c06 --- /dev/null +++ b/examples/events/CMakeLists.txt @@ -0,0 +1,7 @@ + +add_subdirectory(advancedEventsExample) +add_subdirectory(allEventsExample) +add_subdirectory(customEventExample) +add_subdirectory(rpiTouchExample) +add_subdirectory(simpleEventsExample) +add_subdirectory(simpleTimerEventExample) diff --git a/examples/events/advancedEventsExample/CMakeLists.txt b/examples/events/advancedEventsExample/CMakeLists.txt new file mode 100644 index 00000000000..b0f26230217 --- /dev/null +++ b/examples/events/advancedEventsExample/CMakeLists.txt @@ -0,0 +1 @@ +define_example(advancedEventsExample) \ No newline at end of file diff --git a/examples/events/allEventsExample/CMakeLists.txt b/examples/events/allEventsExample/CMakeLists.txt new file mode 100644 index 00000000000..605c363f25b --- /dev/null +++ b/examples/events/allEventsExample/CMakeLists.txt @@ -0,0 +1 @@ +define_example(allEventsExample) \ No newline at end of file diff --git a/examples/events/customEventExample/CMakeLists.txt b/examples/events/customEventExample/CMakeLists.txt new file mode 100644 index 00000000000..897c3ce567b --- /dev/null +++ b/examples/events/customEventExample/CMakeLists.txt @@ -0,0 +1 @@ +define_example(customEventExample) \ No newline at end of file diff --git a/examples/events/rpiTouchExample/CMakeLists.txt b/examples/events/rpiTouchExample/CMakeLists.txt new file mode 100644 index 00000000000..366e23c15fb --- /dev/null +++ b/examples/events/rpiTouchExample/CMakeLists.txt @@ -0,0 +1 @@ +define_example(rpiTouchExample) \ No newline at end of file diff --git a/examples/events/simpleEventsExample/CMakeLists.txt b/examples/events/simpleEventsExample/CMakeLists.txt new file mode 100644 index 00000000000..4dc01b2c10d --- /dev/null +++ b/examples/events/simpleEventsExample/CMakeLists.txt @@ -0,0 +1 @@ +define_example(simpleEventsExample) \ No newline at end of file diff --git a/examples/events/simpleTimerEventExample/CMakeLists.txt b/examples/events/simpleTimerEventExample/CMakeLists.txt new file mode 100644 index 00000000000..ec4cf2775b6 --- /dev/null +++ b/examples/events/simpleTimerEventExample/CMakeLists.txt @@ -0,0 +1 @@ +define_example(simpleTimerEventExample) \ No newline at end of file diff --git a/examples/gl/CMakeLists.txt b/examples/gl/CMakeLists.txt new file mode 100644 index 00000000000..050374bda07 --- /dev/null +++ b/examples/gl/CMakeLists.txt @@ -0,0 +1,31 @@ + +add_subdirectory(areaLightExample) +add_subdirectory(billboardExample) +add_subdirectory(billboardRotationExample) +add_subdirectory(computeShaderParticlesExample) +add_subdirectory(computeShaderTextureExample) +add_subdirectory(fboHighResOutputExample) +add_subdirectory(fboTrailsExample) +add_subdirectory(geometryShaderExample) +add_subdirectory(glInfoExample) +add_subdirectory(gpuParticleSystemExample) +add_subdirectory(materialPBR) +add_subdirectory(materialPBRAdvanced) +add_subdirectory(multiLightExample) +add_subdirectory(multiTexture3dExample) +add_subdirectory(multiTextureShaderExample) +add_subdirectory(pixelBufferExample) +add_subdirectory(pointLightsExample) +add_subdirectory(pointsAsTexturesExample) +add_subdirectory(shaderExample) +add_subdirectory(shadowsExample) +add_subdirectory(slowFastRenderingExample) +add_subdirectory(textureBufferInstancedExample) +add_subdirectory(textureExample) +add_subdirectory(textureScreengrabExample) +add_subdirectory(threadedPixelBufferExample) +add_subdirectory(transformFeedbackAnimatedExample) +add_subdirectory(transformFeedbackExample) +add_subdirectory(vboExample) +add_subdirectory(vboMeshDrawInstancedExample) +add_subdirectory(viewportExample) diff --git a/examples/gl/areaLightExample/CMakeLists.txt b/examples/gl/areaLightExample/CMakeLists.txt new file mode 100644 index 00000000000..70e7774b471 --- /dev/null +++ b/examples/gl/areaLightExample/CMakeLists.txt @@ -0,0 +1 @@ +define_example(areaLightExample) \ No newline at end of file diff --git a/examples/gl/billboardExample/CMakeLists.txt b/examples/gl/billboardExample/CMakeLists.txt new file mode 100644 index 00000000000..a1a35f37321 --- /dev/null +++ b/examples/gl/billboardExample/CMakeLists.txt @@ -0,0 +1 @@ +define_example(billboardExample) \ No newline at end of file diff --git a/examples/gl/billboardRotationExample/CMakeLists.txt b/examples/gl/billboardRotationExample/CMakeLists.txt new file mode 100644 index 00000000000..4f181e17fcf --- /dev/null +++ b/examples/gl/billboardRotationExample/CMakeLists.txt @@ -0,0 +1 @@ +define_example(billboardRotationExample) \ No newline at end of file diff --git a/examples/gl/computeShaderParticlesExample/CMakeLists.txt b/examples/gl/computeShaderParticlesExample/CMakeLists.txt new file mode 100644 index 00000000000..25d56f37462 --- /dev/null +++ b/examples/gl/computeShaderParticlesExample/CMakeLists.txt @@ -0,0 +1,2 @@ +define_example(computeShaderParticlesExample) +target_link_libraries(computeShaderParticlesExample of::ofxGui) \ No newline at end of file diff --git a/examples/gl/computeShaderTextureExample/CMakeLists.txt b/examples/gl/computeShaderTextureExample/CMakeLists.txt new file mode 100644 index 00000000000..bbaf6175986 --- /dev/null +++ b/examples/gl/computeShaderTextureExample/CMakeLists.txt @@ -0,0 +1,2 @@ +define_example(computeShaderTextureExample) +target_link_libraries(computeShaderTextureExample of::ofxOpenCv) \ No newline at end of file diff --git a/examples/gl/fboHighResOutputExample/CMakeLists.txt b/examples/gl/fboHighResOutputExample/CMakeLists.txt new file mode 100644 index 00000000000..e12c8c38add --- /dev/null +++ b/examples/gl/fboHighResOutputExample/CMakeLists.txt @@ -0,0 +1 @@ +define_example(fboHighResOutputExample) \ No newline at end of file diff --git a/examples/gl/fboTrailsExample/CMakeLists.txt b/examples/gl/fboTrailsExample/CMakeLists.txt new file mode 100644 index 00000000000..07fff880300 --- /dev/null +++ b/examples/gl/fboTrailsExample/CMakeLists.txt @@ -0,0 +1 @@ +define_example(fboTrailsExample) \ No newline at end of file diff --git a/examples/gl/geometryShaderExample/CMakeLists.txt b/examples/gl/geometryShaderExample/CMakeLists.txt new file mode 100644 index 00000000000..0bca486a087 --- /dev/null +++ b/examples/gl/geometryShaderExample/CMakeLists.txt @@ -0,0 +1 @@ +define_example(geometryShaderExample) \ No newline at end of file diff --git a/examples/gl/glInfoExample/CMakeLists.txt b/examples/gl/glInfoExample/CMakeLists.txt new file mode 100644 index 00000000000..286219c088d --- /dev/null +++ b/examples/gl/glInfoExample/CMakeLists.txt @@ -0,0 +1 @@ +define_example(glInfoExample) \ No newline at end of file diff --git a/examples/gl/gpuParticleSystemExample/CMakeLists.txt b/examples/gl/gpuParticleSystemExample/CMakeLists.txt new file mode 100644 index 00000000000..fa0ebd0f3f6 --- /dev/null +++ b/examples/gl/gpuParticleSystemExample/CMakeLists.txt @@ -0,0 +1 @@ +define_example(gpuParticleSystemExample) \ No newline at end of file diff --git a/examples/gl/materialPBR/CMakeLists.txt b/examples/gl/materialPBR/CMakeLists.txt new file mode 100644 index 00000000000..9cb1ad64a3d --- /dev/null +++ b/examples/gl/materialPBR/CMakeLists.txt @@ -0,0 +1 @@ +define_example(materialPBR) \ No newline at end of file diff --git a/examples/gl/materialPBRAdvanced/CMakeLists.txt b/examples/gl/materialPBRAdvanced/CMakeLists.txt new file mode 100644 index 00000000000..d600458ec16 --- /dev/null +++ b/examples/gl/materialPBRAdvanced/CMakeLists.txt @@ -0,0 +1 @@ +define_example(materialPBRAdvanced) \ No newline at end of file diff --git a/examples/gl/multiLightExample/CMakeLists.txt b/examples/gl/multiLightExample/CMakeLists.txt new file mode 100644 index 00000000000..b69710115ef --- /dev/null +++ b/examples/gl/multiLightExample/CMakeLists.txt @@ -0,0 +1 @@ +define_example(multiLightExample) \ No newline at end of file diff --git a/examples/gl/multiTexture3dExample/CMakeLists.txt b/examples/gl/multiTexture3dExample/CMakeLists.txt new file mode 100644 index 00000000000..b829bb4f053 --- /dev/null +++ b/examples/gl/multiTexture3dExample/CMakeLists.txt @@ -0,0 +1 @@ +define_example(multiTexture3dExample) \ No newline at end of file diff --git a/examples/gl/multiTextureShaderExample/CMakeLists.txt b/examples/gl/multiTextureShaderExample/CMakeLists.txt new file mode 100644 index 00000000000..ab05ed14b82 --- /dev/null +++ b/examples/gl/multiTextureShaderExample/CMakeLists.txt @@ -0,0 +1 @@ +define_example(multiTextureShaderExample) \ No newline at end of file diff --git a/examples/gl/pixelBufferExample/CMakeLists.txt b/examples/gl/pixelBufferExample/CMakeLists.txt new file mode 100644 index 00000000000..37cd92715ed --- /dev/null +++ b/examples/gl/pixelBufferExample/CMakeLists.txt @@ -0,0 +1 @@ +define_example(pixelBufferExample) \ No newline at end of file diff --git a/examples/gl/pointLightsExample/CMakeLists.txt b/examples/gl/pointLightsExample/CMakeLists.txt new file mode 100644 index 00000000000..965b35b768c --- /dev/null +++ b/examples/gl/pointLightsExample/CMakeLists.txt @@ -0,0 +1 @@ +define_example(pointLightsExample) \ No newline at end of file diff --git a/examples/gl/pointsAsTexturesExample/CMakeLists.txt b/examples/gl/pointsAsTexturesExample/CMakeLists.txt new file mode 100644 index 00000000000..4a5fd7059c8 --- /dev/null +++ b/examples/gl/pointsAsTexturesExample/CMakeLists.txt @@ -0,0 +1 @@ +define_example(pointsAsTexturesExample) \ No newline at end of file diff --git a/examples/gl/shaderExample/CMakeLists.txt b/examples/gl/shaderExample/CMakeLists.txt new file mode 100644 index 00000000000..178d5241b70 --- /dev/null +++ b/examples/gl/shaderExample/CMakeLists.txt @@ -0,0 +1 @@ +define_example(shaderExample) \ No newline at end of file diff --git a/examples/gl/shadowsExample/CMakeLists.txt b/examples/gl/shadowsExample/CMakeLists.txt new file mode 100644 index 00000000000..c3240f00cb6 --- /dev/null +++ b/examples/gl/shadowsExample/CMakeLists.txt @@ -0,0 +1 @@ +define_example(shadowsExample) \ No newline at end of file diff --git a/examples/gl/slowFastRenderingExample/CMakeLists.txt b/examples/gl/slowFastRenderingExample/CMakeLists.txt new file mode 100644 index 00000000000..90e79118e66 --- /dev/null +++ b/examples/gl/slowFastRenderingExample/CMakeLists.txt @@ -0,0 +1 @@ +define_example(slowFastRenderingExample) \ No newline at end of file diff --git a/examples/gl/textureBufferInstancedExample/CMakeLists.txt b/examples/gl/textureBufferInstancedExample/CMakeLists.txt new file mode 100644 index 00000000000..4008502026a --- /dev/null +++ b/examples/gl/textureBufferInstancedExample/CMakeLists.txt @@ -0,0 +1 @@ +define_example(textureBufferInstancedExample) \ No newline at end of file diff --git a/examples/gl/textureExample/CMakeLists.txt b/examples/gl/textureExample/CMakeLists.txt new file mode 100644 index 00000000000..72121e35696 --- /dev/null +++ b/examples/gl/textureExample/CMakeLists.txt @@ -0,0 +1 @@ +define_example(textureExample) \ No newline at end of file diff --git a/examples/gl/textureScreengrabExample/CMakeLists.txt b/examples/gl/textureScreengrabExample/CMakeLists.txt new file mode 100644 index 00000000000..0ef18c30103 --- /dev/null +++ b/examples/gl/textureScreengrabExample/CMakeLists.txt @@ -0,0 +1 @@ +define_example(textureScreengrabExample) \ No newline at end of file diff --git a/examples/gl/threadedPixelBufferExample/CMakeLists.txt b/examples/gl/threadedPixelBufferExample/CMakeLists.txt new file mode 100644 index 00000000000..3031a282b54 --- /dev/null +++ b/examples/gl/threadedPixelBufferExample/CMakeLists.txt @@ -0,0 +1 @@ +define_example(threadedPixelBufferExample) \ No newline at end of file diff --git a/examples/gl/transformFeedbackAnimatedExample/CMakeLists.txt b/examples/gl/transformFeedbackAnimatedExample/CMakeLists.txt new file mode 100644 index 00000000000..6dba09eb155 --- /dev/null +++ b/examples/gl/transformFeedbackAnimatedExample/CMakeLists.txt @@ -0,0 +1,2 @@ +define_example(transformFeedbackAnimatedExample) +target_link_libraries(transformFeedbackAnimatedExample of::ofxGui) \ No newline at end of file diff --git a/examples/gl/transformFeedbackExample/CMakeLists.txt b/examples/gl/transformFeedbackExample/CMakeLists.txt new file mode 100644 index 00000000000..2e9009df2c4 --- /dev/null +++ b/examples/gl/transformFeedbackExample/CMakeLists.txt @@ -0,0 +1 @@ +define_example(transformFeedbackExample) \ No newline at end of file diff --git a/examples/gl/vboExample/CMakeLists.txt b/examples/gl/vboExample/CMakeLists.txt new file mode 100644 index 00000000000..193d154bf17 --- /dev/null +++ b/examples/gl/vboExample/CMakeLists.txt @@ -0,0 +1 @@ +define_example(vboExample) \ No newline at end of file diff --git a/examples/gl/vboMeshDrawInstancedExample/CMakeLists.txt b/examples/gl/vboMeshDrawInstancedExample/CMakeLists.txt new file mode 100644 index 00000000000..c9bc130d714 --- /dev/null +++ b/examples/gl/vboMeshDrawInstancedExample/CMakeLists.txt @@ -0,0 +1 @@ +define_example(vboMeshDrawInstancedExample) \ No newline at end of file diff --git a/examples/gl/viewportExample/CMakeLists.txt b/examples/gl/viewportExample/CMakeLists.txt new file mode 100644 index 00000000000..da158381c6d --- /dev/null +++ b/examples/gl/viewportExample/CMakeLists.txt @@ -0,0 +1 @@ +define_example(viewportExample) \ No newline at end of file diff --git a/examples/gles/CMakeLists.txt b/examples/gles/CMakeLists.txt new file mode 100644 index 00000000000..9a64bf643b5 --- /dev/null +++ b/examples/gles/CMakeLists.txt @@ -0,0 +1,2 @@ + +add_subdirectory(customEGLWindowSettingsExample) diff --git a/examples/gles/customEGLWindowSettingsExample/CMakeLists.txt b/examples/gles/customEGLWindowSettingsExample/CMakeLists.txt new file mode 100644 index 00000000000..3ebdbd479d0 --- /dev/null +++ b/examples/gles/customEGLWindowSettingsExample/CMakeLists.txt @@ -0,0 +1 @@ +define_example(customEGLWindowSettingsExample) \ No newline at end of file diff --git a/examples/graphics/CMakeLists.txt b/examples/graphics/CMakeLists.txt new file mode 100644 index 00000000000..65aad9bd4f7 --- /dev/null +++ b/examples/graphics/CMakeLists.txt @@ -0,0 +1,15 @@ + +add_subdirectory(blendingExample) +add_subdirectory(colorExample) +add_subdirectory(colorsExtendedExample) +add_subdirectory(floatingPointImageExample) +add_subdirectory(fontsExample) +add_subdirectory(fontShapesExample) +add_subdirectory(graphicsExample) +add_subdirectory(imageSubsectionExample) +add_subdirectory(lutFilterExample) +add_subdirectory(polygonExample) +add_subdirectory(polylineBlobsExample) +add_subdirectory(rectangleAlignmentAndScalingExample) +add_subdirectory(simpleColorKeyExample) +add_subdirectory(vectorGraphicsExample) diff --git a/examples/graphics/blendingExample/CMakeLists.txt b/examples/graphics/blendingExample/CMakeLists.txt new file mode 100644 index 00000000000..2a40703b8f7 --- /dev/null +++ b/examples/graphics/blendingExample/CMakeLists.txt @@ -0,0 +1 @@ +define_example(blendingExample) \ No newline at end of file diff --git a/examples/graphics/colorExample/CMakeLists.txt b/examples/graphics/colorExample/CMakeLists.txt new file mode 100644 index 00000000000..4a0337749a3 --- /dev/null +++ b/examples/graphics/colorExample/CMakeLists.txt @@ -0,0 +1 @@ +define_example(colorExample) \ No newline at end of file diff --git a/examples/graphics/colorsExtendedExample/CMakeLists.txt b/examples/graphics/colorsExtendedExample/CMakeLists.txt new file mode 100644 index 00000000000..aaf36d1e37d --- /dev/null +++ b/examples/graphics/colorsExtendedExample/CMakeLists.txt @@ -0,0 +1 @@ +define_example(colorsExtendedExample) \ No newline at end of file diff --git a/examples/graphics/floatingPointImageExample/CMakeLists.txt b/examples/graphics/floatingPointImageExample/CMakeLists.txt new file mode 100644 index 00000000000..2a5884eed23 --- /dev/null +++ b/examples/graphics/floatingPointImageExample/CMakeLists.txt @@ -0,0 +1 @@ +define_example(floatingPointImageExample) \ No newline at end of file diff --git a/examples/graphics/fontShapesExample/CMakeLists.txt b/examples/graphics/fontShapesExample/CMakeLists.txt new file mode 100644 index 00000000000..07362ed61eb --- /dev/null +++ b/examples/graphics/fontShapesExample/CMakeLists.txt @@ -0,0 +1 @@ +define_example(fontShapesExample) \ No newline at end of file diff --git a/examples/graphics/fontsExample/CMakeLists.txt b/examples/graphics/fontsExample/CMakeLists.txt new file mode 100644 index 00000000000..e5c953966ad --- /dev/null +++ b/examples/graphics/fontsExample/CMakeLists.txt @@ -0,0 +1 @@ +define_example(fontsExample) \ No newline at end of file diff --git a/examples/graphics/graphicsExample/CMakeLists.txt b/examples/graphics/graphicsExample/CMakeLists.txt new file mode 100644 index 00000000000..b05e5672782 --- /dev/null +++ b/examples/graphics/graphicsExample/CMakeLists.txt @@ -0,0 +1 @@ +define_example(graphicsExample) \ No newline at end of file diff --git a/examples/graphics/imageSubsectionExample/CMakeLists.txt b/examples/graphics/imageSubsectionExample/CMakeLists.txt new file mode 100644 index 00000000000..73f8865e4b4 --- /dev/null +++ b/examples/graphics/imageSubsectionExample/CMakeLists.txt @@ -0,0 +1 @@ +define_example(imageSubsectionExample) \ No newline at end of file diff --git a/examples/graphics/lutFilterExample/CMakeLists.txt b/examples/graphics/lutFilterExample/CMakeLists.txt new file mode 100644 index 00000000000..a610eeb37bd --- /dev/null +++ b/examples/graphics/lutFilterExample/CMakeLists.txt @@ -0,0 +1 @@ +define_example(lutFilterExample) \ No newline at end of file diff --git a/examples/graphics/polygonExample/CMakeLists.txt b/examples/graphics/polygonExample/CMakeLists.txt new file mode 100644 index 00000000000..ff5526c8f25 --- /dev/null +++ b/examples/graphics/polygonExample/CMakeLists.txt @@ -0,0 +1 @@ +define_example(polygonExample) \ No newline at end of file diff --git a/examples/graphics/polylineBlobsExample/CMakeLists.txt b/examples/graphics/polylineBlobsExample/CMakeLists.txt new file mode 100644 index 00000000000..0dd3c64c897 --- /dev/null +++ b/examples/graphics/polylineBlobsExample/CMakeLists.txt @@ -0,0 +1,2 @@ +define_example(polylineBlobsExample) +target_link_libraries(polylineBlobsExample of::ofxOpenCv) \ No newline at end of file diff --git a/examples/graphics/rectangleAlignmentAndScalingExample/CMakeLists.txt b/examples/graphics/rectangleAlignmentAndScalingExample/CMakeLists.txt new file mode 100644 index 00000000000..74c596bbc07 --- /dev/null +++ b/examples/graphics/rectangleAlignmentAndScalingExample/CMakeLists.txt @@ -0,0 +1 @@ +define_example(rectangleAlignmentAndScalingExample) \ No newline at end of file diff --git a/examples/graphics/simpleColorKeyExample/CMakeLists.txt b/examples/graphics/simpleColorKeyExample/CMakeLists.txt new file mode 100644 index 00000000000..06d71e851c4 --- /dev/null +++ b/examples/graphics/simpleColorKeyExample/CMakeLists.txt @@ -0,0 +1 @@ +define_example(simpleColorKeyExample) \ No newline at end of file diff --git a/examples/graphics/vectorGraphicsExample/CMakeLists.txt b/examples/graphics/vectorGraphicsExample/CMakeLists.txt new file mode 100644 index 00000000000..9890be3119b --- /dev/null +++ b/examples/graphics/vectorGraphicsExample/CMakeLists.txt @@ -0,0 +1,2 @@ +define_example(vectorGraphicsExample) +target_link_libraries(vectorGraphicsExample of::ofxVectorGraphics) \ No newline at end of file diff --git a/examples/gui/CMakeLists.txt b/examples/gui/CMakeLists.txt new file mode 100644 index 00000000000..9fbde92a7c1 --- /dev/null +++ b/examples/gui/CMakeLists.txt @@ -0,0 +1,7 @@ + +add_subdirectory(guiExample) +add_subdirectory(guiFromParametersExample) +add_subdirectory(oscParametersReceiverExample) +add_subdirectory(oscParametersSenderExample) +add_subdirectory(parameterEdgeCasesExample) +add_subdirectory(parameterGroupExample) diff --git a/examples/gui/guiExample/CMakeLists.txt b/examples/gui/guiExample/CMakeLists.txt new file mode 100644 index 00000000000..a7f6c81b26b --- /dev/null +++ b/examples/gui/guiExample/CMakeLists.txt @@ -0,0 +1,2 @@ +define_example(guiExample) +target_link_libraries(guiExample of::ofxGui) \ No newline at end of file diff --git a/examples/gui/guiFromParametersExample/CMakeLists.txt b/examples/gui/guiFromParametersExample/CMakeLists.txt new file mode 100644 index 00000000000..2aefd371c66 --- /dev/null +++ b/examples/gui/guiFromParametersExample/CMakeLists.txt @@ -0,0 +1,2 @@ +define_example(guiFromParametersExample) +target_link_libraries(guiFromParametersExample of::ofxGui) \ No newline at end of file diff --git a/examples/gui/oscParametersReceiverExample/CMakeLists.txt b/examples/gui/oscParametersReceiverExample/CMakeLists.txt new file mode 100644 index 00000000000..e524555ba61 --- /dev/null +++ b/examples/gui/oscParametersReceiverExample/CMakeLists.txt @@ -0,0 +1,2 @@ +define_example(oscParametersReceiverExample) +target_link_libraries(oscParametersReceiverExample of::ofxGui of::ofxOsc) \ No newline at end of file diff --git a/examples/gui/oscParametersSenderExample/CMakeLists.txt b/examples/gui/oscParametersSenderExample/CMakeLists.txt new file mode 100644 index 00000000000..83be51fd440 --- /dev/null +++ b/examples/gui/oscParametersSenderExample/CMakeLists.txt @@ -0,0 +1,2 @@ +define_example(oscParametersSenderExample) +target_link_libraries(oscParametersSenderExample of::ofxGui of::ofxOsc) \ No newline at end of file diff --git a/examples/gui/parameterEdgeCasesExample/CMakeLists.txt b/examples/gui/parameterEdgeCasesExample/CMakeLists.txt new file mode 100644 index 00000000000..513b709cf3d --- /dev/null +++ b/examples/gui/parameterEdgeCasesExample/CMakeLists.txt @@ -0,0 +1 @@ +define_example(parameterEdgeCasesExample) \ No newline at end of file diff --git a/examples/gui/parameterGroupExample/CMakeLists.txt b/examples/gui/parameterGroupExample/CMakeLists.txt new file mode 100644 index 00000000000..69d6570e011 --- /dev/null +++ b/examples/gui/parameterGroupExample/CMakeLists.txt @@ -0,0 +1,2 @@ +define_example(parameterGroupExample) +target_link_libraries(parameterGroupExample of::ofxGui) \ No newline at end of file diff --git a/examples/input_output/CMakeLists.txt b/examples/input_output/CMakeLists.txt new file mode 100644 index 00000000000..925ac85fb84 --- /dev/null +++ b/examples/input_output/CMakeLists.txt @@ -0,0 +1,19 @@ + +add_subdirectory(clipboardExample) +add_subdirectory(dirListExample) +add_subdirectory(dragDropExample) +add_subdirectory(fileBufferLoadingCSVExample) +add_subdirectory(fileOpenSaveDialogExample) +add_subdirectory(imageCompressionExample) +add_subdirectory(imageLoaderExample) +add_subdirectory(imageLoaderWebExample) +add_subdirectory(imageSaverExample) +add_subdirectory(imageSequenceExample) +add_subdirectory(jsonExample) +add_subdirectory(loadTextFileExample) +add_subdirectory(pdfExample) +add_subdirectory(pugiXmlExample) +# add_subdirectory(svgExample) +add_subdirectory(systemSpeakExample) +add_subdirectory(xmlExample) +# add_subdirectory(xmlSettingsExample) diff --git a/examples/input_output/clipboardExample/CMakeLists.txt b/examples/input_output/clipboardExample/CMakeLists.txt new file mode 100644 index 00000000000..1648fabcdc2 --- /dev/null +++ b/examples/input_output/clipboardExample/CMakeLists.txt @@ -0,0 +1 @@ +define_example(clipboardExample) \ No newline at end of file diff --git a/examples/input_output/clipboardExample/bin/data/.gitkeep b/examples/input_output/clipboardExample/bin/data/.gitkeep new file mode 100644 index 00000000000..e69de29bb2d diff --git a/examples/input_output/dirListExample/CMakeLists.txt b/examples/input_output/dirListExample/CMakeLists.txt new file mode 100644 index 00000000000..70ed06fba2e --- /dev/null +++ b/examples/input_output/dirListExample/CMakeLists.txt @@ -0,0 +1 @@ +define_example(dirListExample) \ No newline at end of file diff --git a/examples/input_output/dragDropExample/CMakeLists.txt b/examples/input_output/dragDropExample/CMakeLists.txt new file mode 100644 index 00000000000..e68a279cd61 --- /dev/null +++ b/examples/input_output/dragDropExample/CMakeLists.txt @@ -0,0 +1 @@ +define_example(dragDropExample) \ No newline at end of file diff --git a/examples/input_output/fileBufferLoadingCSVExample/CMakeLists.txt b/examples/input_output/fileBufferLoadingCSVExample/CMakeLists.txt new file mode 100644 index 00000000000..813e8c89338 --- /dev/null +++ b/examples/input_output/fileBufferLoadingCSVExample/CMakeLists.txt @@ -0,0 +1 @@ +define_example(fileBufferLoadingCSVExample) \ No newline at end of file diff --git a/examples/input_output/fileOpenSaveDialogExample/CMakeLists.txt b/examples/input_output/fileOpenSaveDialogExample/CMakeLists.txt new file mode 100644 index 00000000000..a5025f4b2a4 --- /dev/null +++ b/examples/input_output/fileOpenSaveDialogExample/CMakeLists.txt @@ -0,0 +1 @@ +define_example(fileOpenSaveDialogExample) \ No newline at end of file diff --git a/examples/input_output/imageCompressionExample/CMakeLists.txt b/examples/input_output/imageCompressionExample/CMakeLists.txt new file mode 100644 index 00000000000..ebf3a5d11ef --- /dev/null +++ b/examples/input_output/imageCompressionExample/CMakeLists.txt @@ -0,0 +1 @@ +define_example(imageCompressionExample) \ No newline at end of file diff --git a/examples/input_output/imageLoaderExample/CMakeLists.txt b/examples/input_output/imageLoaderExample/CMakeLists.txt new file mode 100644 index 00000000000..a6922463a55 --- /dev/null +++ b/examples/input_output/imageLoaderExample/CMakeLists.txt @@ -0,0 +1 @@ +define_example(imageLoaderExample) \ No newline at end of file diff --git a/examples/input_output/imageLoaderWebExample/CMakeLists.txt b/examples/input_output/imageLoaderWebExample/CMakeLists.txt new file mode 100644 index 00000000000..49f723a8979 --- /dev/null +++ b/examples/input_output/imageLoaderWebExample/CMakeLists.txt @@ -0,0 +1 @@ +define_example(imageLoaderWebExample) \ No newline at end of file diff --git a/examples/input_output/imageSaverExample/CMakeLists.txt b/examples/input_output/imageSaverExample/CMakeLists.txt new file mode 100644 index 00000000000..7fa49eef1cd --- /dev/null +++ b/examples/input_output/imageSaverExample/CMakeLists.txt @@ -0,0 +1 @@ +define_example(imageSaverExample) \ No newline at end of file diff --git a/examples/input_output/imageSequenceExample/CMakeLists.txt b/examples/input_output/imageSequenceExample/CMakeLists.txt new file mode 100644 index 00000000000..b4ab4ba2809 --- /dev/null +++ b/examples/input_output/imageSequenceExample/CMakeLists.txt @@ -0,0 +1 @@ +define_example(imageSequenceExample) \ No newline at end of file diff --git a/examples/input_output/jsonExample/CMakeLists.txt b/examples/input_output/jsonExample/CMakeLists.txt new file mode 100644 index 00000000000..bf878dff384 --- /dev/null +++ b/examples/input_output/jsonExample/CMakeLists.txt @@ -0,0 +1 @@ +define_example(jsonExample) \ No newline at end of file diff --git a/examples/input_output/loadTextFileExample/CMakeLists.txt b/examples/input_output/loadTextFileExample/CMakeLists.txt new file mode 100644 index 00000000000..69519d64624 --- /dev/null +++ b/examples/input_output/loadTextFileExample/CMakeLists.txt @@ -0,0 +1 @@ +define_example(loadTextFileExample) \ No newline at end of file diff --git a/examples/input_output/pdfExample/CMakeLists.txt b/examples/input_output/pdfExample/CMakeLists.txt new file mode 100644 index 00000000000..2051966a8bd --- /dev/null +++ b/examples/input_output/pdfExample/CMakeLists.txt @@ -0,0 +1,2 @@ +define_example(pdfExample) +target_link_libraries(pdfExample) diff --git a/examples/input_output/pugiXmlExample/CMakeLists.txt b/examples/input_output/pugiXmlExample/CMakeLists.txt new file mode 100644 index 00000000000..6e908442a06 --- /dev/null +++ b/examples/input_output/pugiXmlExample/CMakeLists.txt @@ -0,0 +1 @@ +define_example(pugiXmlExample) \ No newline at end of file diff --git a/examples/input_output/svgExample/CMakeLists.txt b/examples/input_output/svgExample/CMakeLists.txt new file mode 100644 index 00000000000..033c196b866 --- /dev/null +++ b/examples/input_output/svgExample/CMakeLists.txt @@ -0,0 +1,2 @@ +define_example(svgExample) +target_link_libraries(svgExample of::ofxSvg) \ No newline at end of file diff --git a/examples/input_output/systemSpeakExample/CMakeLists.txt b/examples/input_output/systemSpeakExample/CMakeLists.txt new file mode 100644 index 00000000000..2c0a3584025 --- /dev/null +++ b/examples/input_output/systemSpeakExample/CMakeLists.txt @@ -0,0 +1 @@ +define_example(systemSpeakExample) \ No newline at end of file diff --git a/examples/input_output/xmlExample/CMakeLists.txt b/examples/input_output/xmlExample/CMakeLists.txt new file mode 100644 index 00000000000..8dab4890953 --- /dev/null +++ b/examples/input_output/xmlExample/CMakeLists.txt @@ -0,0 +1 @@ +define_example(xmlExample) \ No newline at end of file diff --git a/examples/input_output/xmlSettingsExample/CMakeLists.txt b/examples/input_output/xmlSettingsExample/CMakeLists.txt new file mode 100644 index 00000000000..f979a2240f9 --- /dev/null +++ b/examples/input_output/xmlSettingsExample/CMakeLists.txt @@ -0,0 +1,2 @@ +define_example(xmlSettingsExample) +target_link_libraries(xmlSettingsExample of::ofxXmlSettings) \ No newline at end of file diff --git a/examples/ios/CMakeLists.txt b/examples/ios/CMakeLists.txt new file mode 100644 index 00000000000..433e8c45274 --- /dev/null +++ b/examples/ios/CMakeLists.txt @@ -0,0 +1,44 @@ + +add_subdirectory(advancedEventsExample) +add_subdirectory(advancedGraphicsExample) +add_subdirectory(assimpExample) +add_subdirectory(audioInputExample) +add_subdirectory(audioOutputExample) +add_subdirectory(CoreHapticsExample) +add_subdirectory(CoreLocationExample) +add_subdirectory(dirListExample) +add_subdirectory(emptyExample) +add_subdirectory(eventsExample) +add_subdirectory(fontsExample) +add_subdirectory(fontShapesExample) +add_subdirectory(GLKit) +add_subdirectory(GLKitNativeARCExample) +add_subdirectory(graphicsExample) +add_subdirectory(imageLoaderExample) +add_subdirectory(ImagePickerExample) +add_subdirectory(iosCoreMotionCameraExample) +add_subdirectory(iosCoreMotionExample) +add_subdirectory(iosCoreMotionLegacyExample) +add_subdirectory(iosCustomSizeExample) +add_subdirectory(iosES2ShaderExample) +add_subdirectory(iosExternalDisplayExample) +add_subdirectory(iosNativeARCExample) +add_subdirectory(iosNativeExample) +add_subdirectory(iosOrientationExample) +add_subdirectory(iosStoryboardExample) +add_subdirectory(iPhoneGuiExample) +add_subdirectory(KeyboardExample) +add_subdirectory(MapKitExample) +add_subdirectory(moviePlayerExample) +add_subdirectory(ofxGuiExample) +add_subdirectory(opencvExample) +add_subdirectory(opencvFaceExample) +add_subdirectory(oscReceiverExample) +add_subdirectory(oscSenderExample) +add_subdirectory(polygonExample) +add_subdirectory(PrimitivesExample) +add_subdirectory(soundPlayerExample) +add_subdirectory(textureExample) +add_subdirectory(vboExample) +add_subdirectory(videoGrabberExample) +add_subdirectory(xmlSettingsExample) diff --git a/examples/ios/CoreHapticsExample/CMakeLists.txt b/examples/ios/CoreHapticsExample/CMakeLists.txt new file mode 100644 index 00000000000..37c83cea47f --- /dev/null +++ b/examples/ios/CoreHapticsExample/CMakeLists.txt @@ -0,0 +1 @@ +define_example(iosCoreHapticsExample) \ No newline at end of file diff --git a/examples/ios/CoreLocationExample/CMakeLists.txt b/examples/ios/CoreLocationExample/CMakeLists.txt new file mode 100644 index 00000000000..e2cf2627086 --- /dev/null +++ b/examples/ios/CoreLocationExample/CMakeLists.txt @@ -0,0 +1 @@ +define_example(iosCoreLocationExample) \ No newline at end of file diff --git a/examples/ios/GLKit/CMakeLists.txt b/examples/ios/GLKit/CMakeLists.txt new file mode 100644 index 00000000000..7e96e2e18f3 --- /dev/null +++ b/examples/ios/GLKit/CMakeLists.txt @@ -0,0 +1 @@ +define_example(iosGLKit) \ No newline at end of file diff --git a/examples/ios/GLKitNativeARCExample/CMakeLists.txt b/examples/ios/GLKitNativeARCExample/CMakeLists.txt new file mode 100644 index 00000000000..2d22a2c94fc --- /dev/null +++ b/examples/ios/GLKitNativeARCExample/CMakeLists.txt @@ -0,0 +1 @@ +define_example(iosGLKitNativeARCExample) \ No newline at end of file diff --git a/examples/ios/ImagePickerExample/CMakeLists.txt b/examples/ios/ImagePickerExample/CMakeLists.txt new file mode 100644 index 00000000000..50f2c465085 --- /dev/null +++ b/examples/ios/ImagePickerExample/CMakeLists.txt @@ -0,0 +1 @@ +define_example(iosImagePickerExample) \ No newline at end of file diff --git a/examples/ios/KeyboardExample/CMakeLists.txt b/examples/ios/KeyboardExample/CMakeLists.txt new file mode 100644 index 00000000000..bce41724894 --- /dev/null +++ b/examples/ios/KeyboardExample/CMakeLists.txt @@ -0,0 +1 @@ +define_example(iosKeyboardExample) \ No newline at end of file diff --git a/examples/ios/MapKitExample/CMakeLists.txt b/examples/ios/MapKitExample/CMakeLists.txt new file mode 100644 index 00000000000..80a3314bbc4 --- /dev/null +++ b/examples/ios/MapKitExample/CMakeLists.txt @@ -0,0 +1 @@ +define_example(iosMapKitExample) \ No newline at end of file diff --git a/examples/ios/PrimitivesExample/CMakeLists.txt b/examples/ios/PrimitivesExample/CMakeLists.txt new file mode 100644 index 00000000000..938edcb3d6e --- /dev/null +++ b/examples/ios/PrimitivesExample/CMakeLists.txt @@ -0,0 +1 @@ +define_example(iosPrimitivesExample) \ No newline at end of file diff --git a/examples/ios/advancedEventsExample/CMakeLists.txt b/examples/ios/advancedEventsExample/CMakeLists.txt new file mode 100644 index 00000000000..add422f266a --- /dev/null +++ b/examples/ios/advancedEventsExample/CMakeLists.txt @@ -0,0 +1 @@ +define_example(iosAdvancedEventsExample) \ No newline at end of file diff --git a/examples/ios/advancedGraphicsExample/CMakeLists.txt b/examples/ios/advancedGraphicsExample/CMakeLists.txt new file mode 100644 index 00000000000..7c45109de6d --- /dev/null +++ b/examples/ios/advancedGraphicsExample/CMakeLists.txt @@ -0,0 +1 @@ +define_example(iosAdvancedGraphicsExample) \ No newline at end of file diff --git a/examples/ios/assimpExample/CMakeLists.txt b/examples/ios/assimpExample/CMakeLists.txt new file mode 100644 index 00000000000..7701b5bdcb7 --- /dev/null +++ b/examples/ios/assimpExample/CMakeLists.txt @@ -0,0 +1 @@ +define_example(iosAssimpExample) \ No newline at end of file diff --git a/examples/ios/audioInputExample/CMakeLists.txt b/examples/ios/audioInputExample/CMakeLists.txt new file mode 100644 index 00000000000..4fb23453426 --- /dev/null +++ b/examples/ios/audioInputExample/CMakeLists.txt @@ -0,0 +1 @@ +define_example(iosAudioInputExample) \ No newline at end of file diff --git a/examples/ios/audioOutputExample/CMakeLists.txt b/examples/ios/audioOutputExample/CMakeLists.txt new file mode 100644 index 00000000000..a5ce9567d07 --- /dev/null +++ b/examples/ios/audioOutputExample/CMakeLists.txt @@ -0,0 +1 @@ +define_example(iosAudioOutputExample) \ No newline at end of file diff --git a/examples/ios/dirListExample/CMakeLists.txt b/examples/ios/dirListExample/CMakeLists.txt new file mode 100644 index 00000000000..a986f29673c --- /dev/null +++ b/examples/ios/dirListExample/CMakeLists.txt @@ -0,0 +1 @@ +define_example(iosDirListExample) \ No newline at end of file diff --git a/examples/ios/emptyExample/CMakeLists.txt b/examples/ios/emptyExample/CMakeLists.txt new file mode 100644 index 00000000000..c612f4f929f --- /dev/null +++ b/examples/ios/emptyExample/CMakeLists.txt @@ -0,0 +1 @@ +define_example(iosEmptyExample) \ No newline at end of file diff --git a/examples/ios/eventsExample/CMakeLists.txt b/examples/ios/eventsExample/CMakeLists.txt new file mode 100644 index 00000000000..7a331cf136b --- /dev/null +++ b/examples/ios/eventsExample/CMakeLists.txt @@ -0,0 +1 @@ +define_example(iosEventsExample) \ No newline at end of file diff --git a/examples/ios/fontShapesExample/CMakeLists.txt b/examples/ios/fontShapesExample/CMakeLists.txt new file mode 100644 index 00000000000..aa7fa90d3a8 --- /dev/null +++ b/examples/ios/fontShapesExample/CMakeLists.txt @@ -0,0 +1 @@ +define_example(iosFontShapesExample) \ No newline at end of file diff --git a/examples/ios/fontsExample/CMakeLists.txt b/examples/ios/fontsExample/CMakeLists.txt new file mode 100644 index 00000000000..6d5045ce6fd --- /dev/null +++ b/examples/ios/fontsExample/CMakeLists.txt @@ -0,0 +1 @@ +define_example(iosFontsExample) \ No newline at end of file diff --git a/examples/ios/graphicsExample/CMakeLists.txt b/examples/ios/graphicsExample/CMakeLists.txt new file mode 100644 index 00000000000..ca28f2394e6 --- /dev/null +++ b/examples/ios/graphicsExample/CMakeLists.txt @@ -0,0 +1 @@ +define_example(iosGraphicsExample) \ No newline at end of file diff --git a/examples/ios/iPhoneGuiExample/CMakeLists.txt b/examples/ios/iPhoneGuiExample/CMakeLists.txt new file mode 100644 index 00000000000..980579e1d9b --- /dev/null +++ b/examples/ios/iPhoneGuiExample/CMakeLists.txt @@ -0,0 +1 @@ +define_example(iosIPhoneGuiExample) \ No newline at end of file diff --git a/examples/ios/imageLoaderExample/CMakeLists.txt b/examples/ios/imageLoaderExample/CMakeLists.txt new file mode 100644 index 00000000000..32d8d20a4f4 --- /dev/null +++ b/examples/ios/imageLoaderExample/CMakeLists.txt @@ -0,0 +1 @@ +define_example(iosImageLoaderExample) \ No newline at end of file diff --git a/examples/ios/iosCoreMotionCameraExample/CMakeLists.txt b/examples/ios/iosCoreMotionCameraExample/CMakeLists.txt new file mode 100644 index 00000000000..33140ac29ce --- /dev/null +++ b/examples/ios/iosCoreMotionCameraExample/CMakeLists.txt @@ -0,0 +1 @@ +define_example(iosCoreMotionCameraExample) \ No newline at end of file diff --git a/examples/ios/iosCoreMotionExample/CMakeLists.txt b/examples/ios/iosCoreMotionExample/CMakeLists.txt new file mode 100644 index 00000000000..820b73323f3 --- /dev/null +++ b/examples/ios/iosCoreMotionExample/CMakeLists.txt @@ -0,0 +1 @@ +define_example(iosCoreMotionExample) \ No newline at end of file diff --git a/examples/ios/iosCoreMotionLegacyExample/CMakeLists.txt b/examples/ios/iosCoreMotionLegacyExample/CMakeLists.txt new file mode 100644 index 00000000000..1d5baaccb95 --- /dev/null +++ b/examples/ios/iosCoreMotionLegacyExample/CMakeLists.txt @@ -0,0 +1 @@ +define_example(iosCoreMotionLegacyExample) \ No newline at end of file diff --git a/examples/ios/iosCustomSizeExample/CMakeLists.txt b/examples/ios/iosCustomSizeExample/CMakeLists.txt new file mode 100644 index 00000000000..d871c05c0e3 --- /dev/null +++ b/examples/ios/iosCustomSizeExample/CMakeLists.txt @@ -0,0 +1 @@ +define_example(iosCustomSizeExample) \ No newline at end of file diff --git a/examples/ios/iosES2ShaderExample/CMakeLists.txt b/examples/ios/iosES2ShaderExample/CMakeLists.txt new file mode 100644 index 00000000000..e5064752ad3 --- /dev/null +++ b/examples/ios/iosES2ShaderExample/CMakeLists.txt @@ -0,0 +1 @@ +define_example(iosES2ShaderExample) \ No newline at end of file diff --git a/examples/ios/iosExternalDisplayExample/CMakeLists.txt b/examples/ios/iosExternalDisplayExample/CMakeLists.txt new file mode 100644 index 00000000000..1fded3a38d4 --- /dev/null +++ b/examples/ios/iosExternalDisplayExample/CMakeLists.txt @@ -0,0 +1 @@ +define_example(iosExternalDisplayExample) \ No newline at end of file diff --git a/examples/ios/iosNativeARCExample/CMakeLists.txt b/examples/ios/iosNativeARCExample/CMakeLists.txt new file mode 100644 index 00000000000..948167c7c61 --- /dev/null +++ b/examples/ios/iosNativeARCExample/CMakeLists.txt @@ -0,0 +1 @@ +define_example(iosNativeARCExample) \ No newline at end of file diff --git a/examples/ios/iosNativeExample/CMakeLists.txt b/examples/ios/iosNativeExample/CMakeLists.txt new file mode 100644 index 00000000000..49f1db47561 --- /dev/null +++ b/examples/ios/iosNativeExample/CMakeLists.txt @@ -0,0 +1 @@ +define_example(iosNativeExample) \ No newline at end of file diff --git a/examples/ios/iosOrientationExample/CMakeLists.txt b/examples/ios/iosOrientationExample/CMakeLists.txt new file mode 100644 index 00000000000..2658d8267e6 --- /dev/null +++ b/examples/ios/iosOrientationExample/CMakeLists.txt @@ -0,0 +1 @@ +define_example(iosOrientationExample) \ No newline at end of file diff --git a/examples/ios/iosStoryboardExample/CMakeLists.txt b/examples/ios/iosStoryboardExample/CMakeLists.txt new file mode 100644 index 00000000000..e4b495b5eca --- /dev/null +++ b/examples/ios/iosStoryboardExample/CMakeLists.txt @@ -0,0 +1 @@ +define_example(iosStoryboardExample) \ No newline at end of file diff --git a/examples/ios/moviePlayerExample/CMakeLists.txt b/examples/ios/moviePlayerExample/CMakeLists.txt new file mode 100644 index 00000000000..22b9de443ca --- /dev/null +++ b/examples/ios/moviePlayerExample/CMakeLists.txt @@ -0,0 +1 @@ +define_example(iosMoviePlayerExample) \ No newline at end of file diff --git a/examples/ios/ofxGuiExample/CMakeLists.txt b/examples/ios/ofxGuiExample/CMakeLists.txt new file mode 100644 index 00000000000..bdb061eb0c1 --- /dev/null +++ b/examples/ios/ofxGuiExample/CMakeLists.txt @@ -0,0 +1 @@ +define_example(iosOfxGuiExample) \ No newline at end of file diff --git a/examples/ios/opencvExample/CMakeLists.txt b/examples/ios/opencvExample/CMakeLists.txt new file mode 100644 index 00000000000..6b430b7019c --- /dev/null +++ b/examples/ios/opencvExample/CMakeLists.txt @@ -0,0 +1 @@ +define_example(iosOpenCvExample) \ No newline at end of file diff --git a/examples/ios/opencvFaceExample/CMakeLists.txt b/examples/ios/opencvFaceExample/CMakeLists.txt new file mode 100644 index 00000000000..636e3a7efd5 --- /dev/null +++ b/examples/ios/opencvFaceExample/CMakeLists.txt @@ -0,0 +1 @@ +define_example(iosOpenCvFaceExample) \ No newline at end of file diff --git a/examples/ios/oscReceiverExample/CMakeLists.txt b/examples/ios/oscReceiverExample/CMakeLists.txt new file mode 100644 index 00000000000..dece360a41a --- /dev/null +++ b/examples/ios/oscReceiverExample/CMakeLists.txt @@ -0,0 +1 @@ +define_example(iosOscReceiverExample) \ No newline at end of file diff --git a/examples/ios/oscSenderExample/CMakeLists.txt b/examples/ios/oscSenderExample/CMakeLists.txt new file mode 100644 index 00000000000..f11b729af5c --- /dev/null +++ b/examples/ios/oscSenderExample/CMakeLists.txt @@ -0,0 +1 @@ +define_example(iosOscSenderExample) \ No newline at end of file diff --git a/examples/ios/polygonExample/CMakeLists.txt b/examples/ios/polygonExample/CMakeLists.txt new file mode 100644 index 00000000000..aa9eb925bd4 --- /dev/null +++ b/examples/ios/polygonExample/CMakeLists.txt @@ -0,0 +1 @@ +define_example(iosPolygonExample) \ No newline at end of file diff --git a/examples/ios/soundPlayerExample/CMakeLists.txt b/examples/ios/soundPlayerExample/CMakeLists.txt new file mode 100644 index 00000000000..f856a18d559 --- /dev/null +++ b/examples/ios/soundPlayerExample/CMakeLists.txt @@ -0,0 +1 @@ +define_example(iosSoundPlayerExample) \ No newline at end of file diff --git a/examples/ios/textureExample/CMakeLists.txt b/examples/ios/textureExample/CMakeLists.txt new file mode 100644 index 00000000000..7fc95385020 --- /dev/null +++ b/examples/ios/textureExample/CMakeLists.txt @@ -0,0 +1 @@ +define_example(iosTextureExample) \ No newline at end of file diff --git a/examples/ios/vboExample/CMakeLists.txt b/examples/ios/vboExample/CMakeLists.txt new file mode 100644 index 00000000000..20a67d5e9f8 --- /dev/null +++ b/examples/ios/vboExample/CMakeLists.txt @@ -0,0 +1 @@ +define_example(iosVboExample) \ No newline at end of file diff --git a/examples/ios/videoGrabberExample/CMakeLists.txt b/examples/ios/videoGrabberExample/CMakeLists.txt new file mode 100644 index 00000000000..d1002ff69f5 --- /dev/null +++ b/examples/ios/videoGrabberExample/CMakeLists.txt @@ -0,0 +1 @@ +define_example(iosVideoGrabberExample) \ No newline at end of file diff --git a/examples/ios/xmlSettingsExample/CMakeLists.txt b/examples/ios/xmlSettingsExample/CMakeLists.txt new file mode 100644 index 00000000000..89e70bae4e5 --- /dev/null +++ b/examples/ios/xmlSettingsExample/CMakeLists.txt @@ -0,0 +1 @@ +define_example(iosXmlSettingsExample) \ No newline at end of file diff --git a/examples/math/CMakeLists.txt b/examples/math/CMakeLists.txt new file mode 100644 index 00000000000..d10e14997ae --- /dev/null +++ b/examples/math/CMakeLists.txt @@ -0,0 +1,9 @@ + +add_subdirectory(noise1dExample) +add_subdirectory(noise1dOctaveExample) +add_subdirectory(noiseField2dExample) +add_subdirectory(particlesExample) +add_subdirectory(periodicSignalsExample) +add_subdirectory(trigonometricMotionExample) +add_subdirectory(trigonometryExample) +add_subdirectory(vectorMathExample) diff --git a/examples/math/noise1dExample/CMakeLists.txt b/examples/math/noise1dExample/CMakeLists.txt new file mode 100644 index 00000000000..4825dc52995 --- /dev/null +++ b/examples/math/noise1dExample/CMakeLists.txt @@ -0,0 +1 @@ +define_example(noise1dExample) \ No newline at end of file diff --git a/examples/math/noise1dOctaveExample/CMakeLists.txt b/examples/math/noise1dOctaveExample/CMakeLists.txt new file mode 100644 index 00000000000..4ce019bc23c --- /dev/null +++ b/examples/math/noise1dOctaveExample/CMakeLists.txt @@ -0,0 +1 @@ +define_example(noise1dOctaveExample) \ No newline at end of file diff --git a/examples/math/noiseField2dExample/CMakeLists.txt b/examples/math/noiseField2dExample/CMakeLists.txt new file mode 100644 index 00000000000..5ae8b298d1a --- /dev/null +++ b/examples/math/noiseField2dExample/CMakeLists.txt @@ -0,0 +1 @@ +define_example(noiseField2dExample) \ No newline at end of file diff --git a/examples/math/particlesExample/CMakeLists.txt b/examples/math/particlesExample/CMakeLists.txt new file mode 100644 index 00000000000..edee2fe9001 --- /dev/null +++ b/examples/math/particlesExample/CMakeLists.txt @@ -0,0 +1 @@ +define_example(particlesExample) \ No newline at end of file diff --git a/examples/math/periodicSignalsExample/CMakeLists.txt b/examples/math/periodicSignalsExample/CMakeLists.txt new file mode 100644 index 00000000000..96920d01503 --- /dev/null +++ b/examples/math/periodicSignalsExample/CMakeLists.txt @@ -0,0 +1 @@ +define_example(periodicSignalsExample) \ No newline at end of file diff --git a/examples/math/trigonometricMotionExample/CMakeLists.txt b/examples/math/trigonometricMotionExample/CMakeLists.txt new file mode 100644 index 00000000000..cb4f46a7207 --- /dev/null +++ b/examples/math/trigonometricMotionExample/CMakeLists.txt @@ -0,0 +1 @@ +define_example(trigonometricMotionExample) \ No newline at end of file diff --git a/examples/math/trigonometryExample/CMakeLists.txt b/examples/math/trigonometryExample/CMakeLists.txt new file mode 100644 index 00000000000..93ffbe985e7 --- /dev/null +++ b/examples/math/trigonometryExample/CMakeLists.txt @@ -0,0 +1 @@ +define_example(trigonometryExample) \ No newline at end of file diff --git a/examples/math/vectorMathExample/CMakeLists.txt b/examples/math/vectorMathExample/CMakeLists.txt new file mode 100644 index 00000000000..2292684501d --- /dev/null +++ b/examples/math/vectorMathExample/CMakeLists.txt @@ -0,0 +1 @@ +define_example(vectorMathExample) \ No newline at end of file diff --git a/examples/shader/01_simpleColorQuad/CMakeLists.txt b/examples/shader/01_simpleColorQuad/CMakeLists.txt new file mode 100644 index 00000000000..c4785537eb7 --- /dev/null +++ b/examples/shader/01_simpleColorQuad/CMakeLists.txt @@ -0,0 +1 @@ +define_example(01_simpleColorQuad) \ No newline at end of file diff --git a/examples/shader/02_simpleVertexDisplacement/CMakeLists.txt b/examples/shader/02_simpleVertexDisplacement/CMakeLists.txt new file mode 100644 index 00000000000..84dbc72807f --- /dev/null +++ b/examples/shader/02_simpleVertexDisplacement/CMakeLists.txt @@ -0,0 +1 @@ +define_example(02_simpleVertexDisplacement) \ No newline at end of file diff --git a/examples/shader/03_simpleShaderInteraction/CMakeLists.txt b/examples/shader/03_simpleShaderInteraction/CMakeLists.txt new file mode 100644 index 00000000000..8698d88cc94 --- /dev/null +++ b/examples/shader/03_simpleShaderInteraction/CMakeLists.txt @@ -0,0 +1 @@ +define_example(03_simpleShaderInteraction) \ No newline at end of file diff --git a/examples/shader/04_simpleTexturing/CMakeLists.txt b/examples/shader/04_simpleTexturing/CMakeLists.txt new file mode 100644 index 00000000000..27e7b6b28b4 --- /dev/null +++ b/examples/shader/04_simpleTexturing/CMakeLists.txt @@ -0,0 +1 @@ +define_example(04_simpleTexturing) \ No newline at end of file diff --git a/examples/shader/05_alphaMasking/CMakeLists.txt b/examples/shader/05_alphaMasking/CMakeLists.txt new file mode 100644 index 00000000000..67a1ff27b0d --- /dev/null +++ b/examples/shader/05_alphaMasking/CMakeLists.txt @@ -0,0 +1 @@ +define_example(05_alphaMasking) \ No newline at end of file diff --git a/examples/shader/06_multiTexture/CMakeLists.txt b/examples/shader/06_multiTexture/CMakeLists.txt new file mode 100644 index 00000000000..de465584ee0 --- /dev/null +++ b/examples/shader/06_multiTexture/CMakeLists.txt @@ -0,0 +1 @@ +define_example(06_multiTexture) \ No newline at end of file diff --git a/examples/shader/07_fboAlphaMask/CMakeLists.txt b/examples/shader/07_fboAlphaMask/CMakeLists.txt new file mode 100644 index 00000000000..0aed4044a8e --- /dev/null +++ b/examples/shader/07_fboAlphaMask/CMakeLists.txt @@ -0,0 +1 @@ +define_example(07_fboAlphaMask) \ No newline at end of file diff --git a/examples/shader/08_displacementMap/CMakeLists.txt b/examples/shader/08_displacementMap/CMakeLists.txt new file mode 100644 index 00000000000..a3dcbbedb6d --- /dev/null +++ b/examples/shader/08_displacementMap/CMakeLists.txt @@ -0,0 +1 @@ +define_example(08_displacementMap) \ No newline at end of file diff --git a/examples/shader/09_gaussianBlurFilter/CMakeLists.txt b/examples/shader/09_gaussianBlurFilter/CMakeLists.txt new file mode 100644 index 00000000000..31c4ee2d2fd --- /dev/null +++ b/examples/shader/09_gaussianBlurFilter/CMakeLists.txt @@ -0,0 +1 @@ +define_example(09_gaussianBlurFilter) \ No newline at end of file diff --git a/examples/shader/CMakeLists.txt b/examples/shader/CMakeLists.txt new file mode 100644 index 00000000000..8befc669b4c --- /dev/null +++ b/examples/shader/CMakeLists.txt @@ -0,0 +1,10 @@ + +add_subdirectory(01_simpleColorQuad) +add_subdirectory(02_simpleVertexDisplacement) +add_subdirectory(03_simpleShaderInteraction) +add_subdirectory(04_simpleTexturing) +add_subdirectory(05_alphaMasking) +add_subdirectory(06_multiTexture) +add_subdirectory(07_fboAlphaMask) +add_subdirectory(08_displacementMap) +add_subdirectory(09_gaussianBlurFilter) diff --git a/examples/sound/CMakeLists.txt b/examples/sound/CMakeLists.txt new file mode 100644 index 00000000000..a3c50485f27 --- /dev/null +++ b/examples/sound/CMakeLists.txt @@ -0,0 +1,6 @@ + +add_subdirectory(audioInputExample) +add_subdirectory(audioOutputExample) +add_subdirectory(soundBufferExample) +add_subdirectory(soundPlayerExample) +add_subdirectory(soundPlayerFFTExample) diff --git a/examples/sound/audioInputExample/CMakeLists.txt b/examples/sound/audioInputExample/CMakeLists.txt new file mode 100644 index 00000000000..fd5ef2470f5 --- /dev/null +++ b/examples/sound/audioInputExample/CMakeLists.txt @@ -0,0 +1 @@ +define_example(audioInputExample) \ No newline at end of file diff --git a/examples/sound/audioOutputExample/CMakeLists.txt b/examples/sound/audioOutputExample/CMakeLists.txt new file mode 100644 index 00000000000..c27305a2c5a --- /dev/null +++ b/examples/sound/audioOutputExample/CMakeLists.txt @@ -0,0 +1 @@ +define_example(audioOutputExample) \ No newline at end of file diff --git a/examples/sound/soundBufferExample/CMakeLists.txt b/examples/sound/soundBufferExample/CMakeLists.txt new file mode 100644 index 00000000000..60e60159039 --- /dev/null +++ b/examples/sound/soundBufferExample/CMakeLists.txt @@ -0,0 +1 @@ +define_example(soundBufferExample) \ No newline at end of file diff --git a/examples/sound/soundPlayerExample/CMakeLists.txt b/examples/sound/soundPlayerExample/CMakeLists.txt new file mode 100644 index 00000000000..b93f5178c49 --- /dev/null +++ b/examples/sound/soundPlayerExample/CMakeLists.txt @@ -0,0 +1 @@ +define_example(soundPlayerExample) \ No newline at end of file diff --git a/examples/sound/soundPlayerFFTExample/CMakeLists.txt b/examples/sound/soundPlayerFFTExample/CMakeLists.txt new file mode 100644 index 00000000000..a8f6fbd43cf --- /dev/null +++ b/examples/sound/soundPlayerFFTExample/CMakeLists.txt @@ -0,0 +1 @@ +define_example(soundPlayerFFTExample) \ No newline at end of file diff --git a/examples/strings/CMakeLists.txt b/examples/strings/CMakeLists.txt new file mode 100644 index 00000000000..c4d54863222 --- /dev/null +++ b/examples/strings/CMakeLists.txt @@ -0,0 +1,5 @@ + +add_subdirectory(conversionExample) +add_subdirectory(ofLogExample) +add_subdirectory(regularExpressionExample) +add_subdirectory(sortingExample) diff --git a/examples/strings/conversionExample/CMakeLists.txt b/examples/strings/conversionExample/CMakeLists.txt new file mode 100644 index 00000000000..88184d1c486 --- /dev/null +++ b/examples/strings/conversionExample/CMakeLists.txt @@ -0,0 +1 @@ +define_example(conversionExample) \ No newline at end of file diff --git a/examples/strings/ofLogExample/CMakeLists.txt b/examples/strings/ofLogExample/CMakeLists.txt new file mode 100644 index 00000000000..afe55848328 --- /dev/null +++ b/examples/strings/ofLogExample/CMakeLists.txt @@ -0,0 +1 @@ +define_example(ofLogExample) \ No newline at end of file diff --git a/examples/strings/regularExpressionExample/CMakeLists.txt b/examples/strings/regularExpressionExample/CMakeLists.txt new file mode 100644 index 00000000000..b9358e033af --- /dev/null +++ b/examples/strings/regularExpressionExample/CMakeLists.txt @@ -0,0 +1 @@ +define_example(regularExpressionExample) \ No newline at end of file diff --git a/examples/strings/sortingExample/CMakeLists.txt b/examples/strings/sortingExample/CMakeLists.txt new file mode 100644 index 00000000000..d486969cd2c --- /dev/null +++ b/examples/strings/sortingExample/CMakeLists.txt @@ -0,0 +1 @@ +define_example(sortingExample) \ No newline at end of file diff --git a/examples/templates/CMakeLists.txt b/examples/templates/CMakeLists.txt new file mode 100644 index 00000000000..14c8de78dbe --- /dev/null +++ b/examples/templates/CMakeLists.txt @@ -0,0 +1,3 @@ + +# add_subdirectory(allAddonsExample) +add_subdirectory(emptyExample) diff --git a/examples/templates/allAddonsExample/CMakeLists.txt b/examples/templates/allAddonsExample/CMakeLists.txt new file mode 100644 index 00000000000..7132a3335b6 --- /dev/null +++ b/examples/templates/allAddonsExample/CMakeLists.txt @@ -0,0 +1,2 @@ +define_example(allAddonsExample) +target_link_libraries(allAddonsExample of::ofxOpenCv of::ofxNetwork of::ofxOsc of::ofxXmlSettings of::ofxAssimpModelLoader of::ofxThreadedImageLoader of::ofxKinect of::ofxGui of::ofxSvg of::ofxPoco) \ No newline at end of file diff --git a/examples/templates/emptyExample/CMakeLists.txt b/examples/templates/emptyExample/CMakeLists.txt new file mode 100644 index 00000000000..c8cf3fbd1db --- /dev/null +++ b/examples/templates/emptyExample/CMakeLists.txt @@ -0,0 +1 @@ +define_example(emptyExample) \ No newline at end of file diff --git a/examples/threads/CMakeLists.txt b/examples/threads/CMakeLists.txt new file mode 100644 index 00000000000..9dcda9e33a4 --- /dev/null +++ b/examples/threads/CMakeLists.txt @@ -0,0 +1,4 @@ + +add_subdirectory(threadChannelExample) +add_subdirectory(threadedImageLoaderExample) +add_subdirectory(threadExample) diff --git a/examples/threads/threadChannelExample/CMakeLists.txt b/examples/threads/threadChannelExample/CMakeLists.txt new file mode 100644 index 00000000000..1b4803951a2 --- /dev/null +++ b/examples/threads/threadChannelExample/CMakeLists.txt @@ -0,0 +1 @@ +define_example(threadChannelExample) \ No newline at end of file diff --git a/examples/threads/threadExample/CMakeLists.txt b/examples/threads/threadExample/CMakeLists.txt new file mode 100644 index 00000000000..25901651d2e --- /dev/null +++ b/examples/threads/threadExample/CMakeLists.txt @@ -0,0 +1 @@ +define_example(threadExample) \ No newline at end of file diff --git a/examples/threads/threadedImageLoaderExample/CMakeLists.txt b/examples/threads/threadedImageLoaderExample/CMakeLists.txt new file mode 100644 index 00000000000..dd54be7d270 --- /dev/null +++ b/examples/threads/threadedImageLoaderExample/CMakeLists.txt @@ -0,0 +1,2 @@ +define_example(threadedImageLoaderExample) +target_link_libraries(threadedImageLoaderExample of::ofxThreadedImageLoader) \ No newline at end of file diff --git a/examples/tvOS/CMakeLists.txt b/examples/tvOS/CMakeLists.txt new file mode 100644 index 00000000000..3cb86a0602e --- /dev/null +++ b/examples/tvOS/CMakeLists.txt @@ -0,0 +1,3 @@ + +add_subdirectory(emptyExample) +add_subdirectory(ofBoxExample) diff --git a/examples/tvOS/emptyExample/CMakeLists.txt b/examples/tvOS/emptyExample/CMakeLists.txt new file mode 100644 index 00000000000..c8cf3fbd1db --- /dev/null +++ b/examples/tvOS/emptyExample/CMakeLists.txt @@ -0,0 +1 @@ +define_example(emptyExample) \ No newline at end of file diff --git a/examples/tvOS/ofBoxExample/CMakeLists.txt b/examples/tvOS/ofBoxExample/CMakeLists.txt new file mode 100644 index 00000000000..38e9c0a7541 --- /dev/null +++ b/examples/tvOS/ofBoxExample/CMakeLists.txt @@ -0,0 +1 @@ +define_example(ofBoxExample) \ No newline at end of file diff --git a/examples/video/CMakeLists.txt b/examples/video/CMakeLists.txt new file mode 100644 index 00000000000..9d897fb6769 --- /dev/null +++ b/examples/video/CMakeLists.txt @@ -0,0 +1,5 @@ + +add_subdirectory(asciiVideoExample) +add_subdirectory(slitscanRadialClockExample) +add_subdirectory(videoGrabberExample) +add_subdirectory(videoPlayerExample) diff --git a/examples/video/asciiVideoExample/CMakeLists.txt b/examples/video/asciiVideoExample/CMakeLists.txt new file mode 100644 index 00000000000..704fd6df7bb --- /dev/null +++ b/examples/video/asciiVideoExample/CMakeLists.txt @@ -0,0 +1 @@ +define_example(asciiVideoExample) \ No newline at end of file diff --git a/examples/video/slitscanRadialClockExample/CMakeLists.txt b/examples/video/slitscanRadialClockExample/CMakeLists.txt new file mode 100644 index 00000000000..649e00cb66c --- /dev/null +++ b/examples/video/slitscanRadialClockExample/CMakeLists.txt @@ -0,0 +1 @@ +define_example(slitscanRadialClockExample) \ No newline at end of file diff --git a/examples/video/videoGrabberExample/CMakeLists.txt b/examples/video/videoGrabberExample/CMakeLists.txt new file mode 100644 index 00000000000..46e9944a245 --- /dev/null +++ b/examples/video/videoGrabberExample/CMakeLists.txt @@ -0,0 +1 @@ +define_example(videoGrabberExample) \ No newline at end of file diff --git a/examples/video/videoPlayerExample/CMakeLists.txt b/examples/video/videoPlayerExample/CMakeLists.txt new file mode 100644 index 00000000000..399fa132c06 --- /dev/null +++ b/examples/video/videoPlayerExample/CMakeLists.txt @@ -0,0 +1 @@ +define_example(videoPlayerExample) \ No newline at end of file diff --git a/examples/windowing/CMakeLists.txt b/examples/windowing/CMakeLists.txt new file mode 100644 index 00000000000..7ac6e015bfb --- /dev/null +++ b/examples/windowing/CMakeLists.txt @@ -0,0 +1,5 @@ + +add_subdirectory(multiWindowExample) +add_subdirectory(multiWindowOneAppExample) +add_subdirectory(noWindowExample) +add_subdirectory(windowExample) diff --git a/examples/windowing/multiWindowExample/CMakeLists.txt b/examples/windowing/multiWindowExample/CMakeLists.txt new file mode 100644 index 00000000000..1b8e3f6145e --- /dev/null +++ b/examples/windowing/multiWindowExample/CMakeLists.txt @@ -0,0 +1,2 @@ +define_example(multiWindowExample) +target_link_libraries(multiWindowExample of::ofxGui) \ No newline at end of file diff --git a/examples/windowing/multiWindowOneAppExample/CMakeLists.txt b/examples/windowing/multiWindowOneAppExample/CMakeLists.txt new file mode 100644 index 00000000000..4113abcce5c --- /dev/null +++ b/examples/windowing/multiWindowOneAppExample/CMakeLists.txt @@ -0,0 +1,2 @@ +define_example(multiWindowOneAppExample) +target_link_libraries(multiWindowOneAppExample of::ofxGui) \ No newline at end of file diff --git a/examples/windowing/noWindowExample/CMakeLists.txt b/examples/windowing/noWindowExample/CMakeLists.txt new file mode 100644 index 00000000000..568cdd7f43f --- /dev/null +++ b/examples/windowing/noWindowExample/CMakeLists.txt @@ -0,0 +1 @@ +define_example(noWindowExample) \ No newline at end of file diff --git a/examples/windowing/windowExample/CMakeLists.txt b/examples/windowing/windowExample/CMakeLists.txt new file mode 100644 index 00000000000..7d38bf962a3 --- /dev/null +++ b/examples/windowing/windowExample/CMakeLists.txt @@ -0,0 +1 @@ +define_example(windowExample) \ No newline at end of file diff --git a/libs/openFrameworks/CMakeLists.txt b/libs/openFrameworks/CMakeLists.txt new file mode 100644 index 00000000000..10678daf72d --- /dev/null +++ b/libs/openFrameworks/CMakeLists.txt @@ -0,0 +1,27 @@ +# We want all files in the folder to be our sources (everything should be shown in the IDE) +file(GLOB_RECURSE SOURCES ${CMAKE_CURRENT_LIST_DIR}/**) + +# Except .m[m] files: We remove OBJ-C files from the list because gcc on Linux does not like them +file(GLOB_RECURSE OBJC_FILES ${CMAKE_CURRENT_LIST_DIR}/**.m) +foreach(objc ${OBJC_FILES}) + list(REMOVE_ITEM SOURCES ${objc}) +endforeach() +file(GLOB_RECURSE OBJC_FILES ${CMAKE_CURRENT_LIST_DIR}/**.mm) +foreach(objc ${OBJC_FILES}) + list(REMOVE_ITEM SOURCES ${objc}) +endforeach() + +list(REMOVE_ITEM SOURCES ${CMAKE_CURRENT_LIST_DIR}/app/ofAppGlutWindow.cpp) + +target_sources(openframeworks PRIVATE ${SOURCES}) +target_include_directories(openframeworks PUBLIC ${CMAKE_CURRENT_LIST_DIR}) +source_group(TREE "${CMAKE_CURRENT_LIST_DIR}/" PREFIX "src" FILES ${SOURCES}) + +# And any subfolder (except starting with a dot) becomes an include directory +file(GLOB subfolders ${CMAKE_CURRENT_LIST_DIR}/**) +foreach(subfolder ${subfolders}) + get_filename_component(sub_name ${subfolder} NAME) + if (IS_DIRECTORY ${subfolder} AND NOT ${sub_name} MATCHES "^\\.") + target_include_directories(openframeworks PUBLIC ${subfolder}) + endif() +endforeach() diff --git a/libs/openFrameworks/app/ofAppEGLWindow.cpp b/libs/openFrameworks/app/ofAppEGLWindow.cpp index dcc2660b6b2..acf6eae23c6 100644 --- a/libs/openFrameworks/app/ofAppEGLWindow.cpp +++ b/libs/openFrameworks/app/ofAppEGLWindow.cpp @@ -1,3 +1,8 @@ + +#include "ofConstants.h" + +#ifdef TARGET_OPENGLES + #include "ofAppEGLWindow.h" #include "ofGraphics.h" // used in runAppViaInfiniteLoop() @@ -2300,3 +2305,5 @@ void ofAppEGLWindow::handleX11Event(const XEvent& event){ }*/ } } + +#endif // TARGET_OPENGLES diff --git a/libs/openFrameworks/utils/ofConstants.h b/libs/openFrameworks/utils/ofConstants.h index ca67ab686e7..8717123b024 100644 --- a/libs/openFrameworks/utils/ofConstants.h +++ b/libs/openFrameworks/utils/ofConstants.h @@ -136,7 +136,9 @@ enum ofTargetPlatform{ // then the the platform specific includes: #ifdef TARGET_WIN32 - #define GLEW_STATIC + #ifndef GLEW_STATIC + #define GLEW_STATIC + #endif #define GLEW_NO_GLU #include "GL/glew.h" #include "GL/wglew.h" diff --git a/libs/openFrameworks/video/ofAVFoundationGrabber.mm b/libs/openFrameworks/video/ofAVFoundationGrabber.mm index 47ed71330c9..17ffc8bf595 100644 --- a/libs/openFrameworks/video/ofAVFoundationGrabber.mm +++ b/libs/openFrameworks/video/ofAVFoundationGrabber.mm @@ -2,6 +2,10 @@ * ofAVFoundationGrabber.mm */ +#include "ofConstants.h" + +#ifdef OF_VIDEO_PLAYER_AVFOUNDATION + #include "ofAVFoundationGrabber.h" #include "ofVectorMath.h" #include "ofRectangle.h" @@ -538,3 +542,5 @@ - (void)eraseGrabberPtr { } #endif + +#endif // OF_VIDEO_PLAYER_AVFOUNDATION diff --git a/libs/openFrameworks/video/ofAVFoundationPlayer.mm b/libs/openFrameworks/video/ofAVFoundationPlayer.mm index 24c78410de0..02fd3147169 100644 --- a/libs/openFrameworks/video/ofAVFoundationPlayer.mm +++ b/libs/openFrameworks/video/ofAVFoundationPlayer.mm @@ -5,6 +5,11 @@ // //-------------------------------------------------------------- + +#include "ofConstants.h" + +#ifdef OF_VIDEO_PLAYER_AVFOUNDATION + #import "ofAVFoundationPlayer.h" #import "ofAVFoundationVideoPlayer.h" #include "ofRectangle.h" @@ -777,3 +782,5 @@ ofTexture * ofAVFoundationPlayer::getTexture() { return getTexturePtr(); } + +#endif // OF_VIDEO_PLAYER_AVFOUNDATION diff --git a/libs/openFrameworks/video/ofAVFoundationVideoPlayer.m b/libs/openFrameworks/video/ofAVFoundationVideoPlayer.mm similarity index 99% rename from libs/openFrameworks/video/ofAVFoundationVideoPlayer.m rename to libs/openFrameworks/video/ofAVFoundationVideoPlayer.mm index b33ea7ee280..e909b56ea87 100644 --- a/libs/openFrameworks/video/ofAVFoundationVideoPlayer.m +++ b/libs/openFrameworks/video/ofAVFoundationVideoPlayer.mm @@ -1,9 +1,13 @@ // -// ofAVFoundationVideoPlayer.m +// ofAVFoundationVideoPlayer.mm // Created by Lukasz Karluk on 06/07/14. // Merged with code by Sam Kronick, James George and Elie Zananiri. // +#import "ofConstants.h" + +#ifdef OF_VIDEO_PLAYER_AVFOUNDATION + #import "ofAVFoundationVideoPlayer.h" #define IS_OS_6_OR_LATER ([[[UIDevice currentDevice] systemVersion] floatValue] >= 6.0) @@ -1447,3 +1451,5 @@ - (void)setStreaming:(BOOL)value { } @end + +#endif // OF_VIDEO_PLAYER_AVFOUNDATION diff --git a/libs/openFrameworks/video/ofDirectShowPlayer.cpp b/libs/openFrameworks/video/ofDirectShowPlayer.cpp index 3a32c296605..c299969ff49 100644 --- a/libs/openFrameworks/video/ofDirectShowPlayer.cpp +++ b/libs/openFrameworks/video/ofDirectShowPlayer.cpp @@ -1,3 +1,7 @@ + +#include "ofConstants.h" +#ifdef OF_VIDEO_PLAYER_DIRECTSHOW + #include "ofDirectShowPlayer.h" #include "ofPixels.h" #include "ofMath.h" @@ -1350,3 +1354,5 @@ void ofDirectShowPlayer::previousFrame(){ player->preFrame(); } } + +#endif // OF_VIDEO_PLAYER_DIRECTSHOW diff --git a/libs/openFrameworks/video/ofGstUtils.cpp b/libs/openFrameworks/video/ofGstUtils.cpp index 4ab125d692f..05f3cca4d7d 100644 --- a/libs/openFrameworks/video/ofGstUtils.cpp +++ b/libs/openFrameworks/video/ofGstUtils.cpp @@ -1,3 +1,7 @@ + +#include "ofConstants.h" +#if defined(TARGET_LINUX) + #include "ofGstUtils.h" #ifndef TARGET_ANDROID #include @@ -1455,3 +1459,5 @@ void ofGstVideoUtils::eos_cb(){ } #endif + +#endif // defined(TARGET_LINUX) diff --git a/libs/openFrameworks/video/ofGstVideoGrabber.cpp b/libs/openFrameworks/video/ofGstVideoGrabber.cpp index 16034419b0e..c991d7039e0 100644 --- a/libs/openFrameworks/video/ofGstVideoGrabber.cpp +++ b/libs/openFrameworks/video/ofGstVideoGrabber.cpp @@ -5,6 +5,9 @@ * Author: arturo */ +#include "ofConstants.h" +#if defined(TARGET_LINUX) + #include "ofGstVideoGrabber.h" #include "ofPixels.h" @@ -858,3 +861,5 @@ float ofGstVideoGrabber::getWidth() const { void ofGstVideoGrabber::close(){ videoUtils.close(); } + +#endif // defined(TARGET_LINUX) diff --git a/libs/openFrameworks/video/ofGstVideoPlayer.cpp b/libs/openFrameworks/video/ofGstVideoPlayer.cpp index 0f14dd3d608..822fca254bf 100644 --- a/libs/openFrameworks/video/ofGstVideoPlayer.cpp +++ b/libs/openFrameworks/video/ofGstVideoPlayer.cpp @@ -5,6 +5,9 @@ * Author: arturo */ +#include "ofConstants.h" +#if defined(TARGET_LINUX) + #include "ofGstVideoPlayer.h" #include #include @@ -458,3 +461,5 @@ bool ofGstVideoPlayer::isThreadedAppSink() const{ bool ofGstVideoPlayer::isFrameByFrame() const{ return videoUtils.isFrameByFrame(); } + +#endif // defined(TARGET_LINUX) diff --git a/libs/openFrameworks/video/ofMediaFoundationPlayer.cpp b/libs/openFrameworks/video/ofMediaFoundationPlayer.cpp index b94f1267c2a..8d628c792fc 100644 --- a/libs/openFrameworks/video/ofMediaFoundationPlayer.cpp +++ b/libs/openFrameworks/video/ofMediaFoundationPlayer.cpp @@ -1,4 +1,7 @@ +#include "ofVideoPlayer.h" +#ifdef OF_VIDEO_PLAYER_MEDIA_FOUNDATION + #include "ofPixels.h" #include "ofMediaFoundationPlayer.h" #include "ofLog.h" @@ -1488,3 +1491,4 @@ void ofMediaFoundationPlayer::updateDuration() { } } +#endif // ifdef OF_VIDEO_PLAYER_MEDIA_FOUNDATION diff --git a/libs/openFrameworksCompiled/project/osx/openFrameworksLib.xcodeproj/project.pbxproj b/libs/openFrameworksCompiled/project/osx/openFrameworksLib.xcodeproj/project.pbxproj index ba932a0a892..5f32f821362 100644 --- a/libs/openFrameworksCompiled/project/osx/openFrameworksLib.xcodeproj/project.pbxproj +++ b/libs/openFrameworksCompiled/project/osx/openFrameworksLib.xcodeproj/project.pbxproj @@ -35,7 +35,7 @@ 6678E96F19FEAFA900C00581 /* ofSoundBuffer.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 6678E96D19FEAFA900C00581 /* ofSoundBuffer.cpp */; }; 6678E97019FEAFA900C00581 /* ofSoundBuffer.h in Headers */ = {isa = PBXBuildFile; fileRef = 6678E96E19FEAFA900C00581 /* ofSoundBuffer.h */; }; 6678E97F19FEB5A600C00581 /* ofSoundUtils.h in Headers */ = {isa = PBXBuildFile; fileRef = 6678E97C19FEB5A600C00581 /* ofSoundUtils.h */; }; - 676672A31A749D1900400051 /* ofAVFoundationVideoPlayer.m in Sources */ = {isa = PBXBuildFile; fileRef = 6766729D1A749D1900400051 /* ofAVFoundationVideoPlayer.m */; }; + 676672A31A749D1900400051 /* ofAVFoundationVideoPlayer.mm in Sources */ = {isa = PBXBuildFile; fileRef = 6766729D1A749D1900400051 /* ofAVFoundationVideoPlayer.mm */; }; 676672A41A749D1900400051 /* ofAVFoundationPlayer.h in Headers */ = {isa = PBXBuildFile; fileRef = 6766729E1A749D1900400051 /* ofAVFoundationPlayer.h */; }; 676672A51A749D1900400051 /* ofAVFoundationVideoPlayer.h in Headers */ = {isa = PBXBuildFile; fileRef = 6766729F1A749D1900400051 /* ofAVFoundationVideoPlayer.h */; }; 676672A81A749D1900400051 /* ofAVFoundationPlayer.mm in Sources */ = {isa = PBXBuildFile; fileRef = 676672A21A749D1900400051 /* ofAVFoundationPlayer.mm */; }; @@ -192,7 +192,7 @@ 6678E96D19FEAFA900C00581 /* ofSoundBuffer.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = ofSoundBuffer.cpp; sourceTree = ""; }; 6678E96E19FEAFA900C00581 /* ofSoundBuffer.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = ofSoundBuffer.h; sourceTree = ""; }; 6678E97C19FEB5A600C00581 /* ofSoundUtils.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = ofSoundUtils.h; sourceTree = ""; }; - 6766729D1A749D1900400051 /* ofAVFoundationVideoPlayer.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = ofAVFoundationVideoPlayer.m; sourceTree = ""; }; + 6766729D1A749D1900400051 /* ofAVFoundationVideoPlayer.mm */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objcpp; path = ofAVFoundationVideoPlayer.mm; sourceTree = ""; }; 6766729E1A749D1900400051 /* ofAVFoundationPlayer.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = ofAVFoundationPlayer.h; sourceTree = ""; }; 6766729F1A749D1900400051 /* ofAVFoundationVideoPlayer.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = ofAVFoundationVideoPlayer.h; sourceTree = ""; }; 676672A21A749D1900400051 /* ofAVFoundationPlayer.mm */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.objcpp; path = ofAVFoundationPlayer.mm; sourceTree = ""; }; @@ -454,7 +454,7 @@ E48662991D8C61B000D1735C /* ofAVFoundationGrabber.mm */, E48662981D8C61B000D1735C /* ofAVFoundationGrabber.h */, 6766729F1A749D1900400051 /* ofAVFoundationVideoPlayer.h */, - 6766729D1A749D1900400051 /* ofAVFoundationVideoPlayer.m */, + 6766729D1A749D1900400051 /* ofAVFoundationVideoPlayer.mm */, 6766729E1A749D1900400051 /* ofAVFoundationPlayer.h */, 676672A21A749D1900400051 /* ofAVFoundationPlayer.mm */, ); @@ -797,7 +797,7 @@ E4F3BAC912F4C72F002D19BB /* ofVec2f.cpp in Sources */, E4F3BACC12F4C72F002D19BB /* ofVec4f.cpp in Sources */, E4F3BAD912F4C73C002D19BB /* ofBaseTypes.cpp in Sources */, - 676672A31A749D1900400051 /* ofAVFoundationVideoPlayer.m in Sources */, + 676672A31A749D1900400051 /* ofAVFoundationVideoPlayer.mm in Sources */, E4F3BADB12F4C73C002D19BB /* ofColor.cpp in Sources */, E4F3BADF12F4C73C002D19BB /* ofRectangle.cpp in Sources */, E4F3BAF212F4C745002D19BB /* ofFileUtils.cpp in Sources */, diff --git a/tests/CMakeLists.txt b/tests/CMakeLists.txt new file mode 100644 index 00000000000..9428890b368 --- /dev/null +++ b/tests/CMakeLists.txt @@ -0,0 +1,44 @@ +message(STATUS "[openframeworks] Configuring tests") + +# Macro for defining a test with all of its properties +function(define_test TARGET_NAME) # A CMake function like this is executed in the caller's scope + set(BIN_DIR "${CMAKE_CURRENT_BINARY_DIR}/bin/$,debug,release>") + + file(GLOB_RECURSE SOURCES ${CMAKE_CURRENT_LIST_DIR}/src/**) + + add_executable(${TARGET_NAME}) + target_sources(${TARGET_NAME} PRIVATE ${SOURCES}) + target_include_directories(${TARGET_NAME} PUBLIC ${CMAKE_CURRENT_LIST_DIR}/src) + target_link_libraries(${TARGET_NAME} of::openframeworks of::ofxUnitTests) + + source_group(TREE "${CMAKE_CURRENT_LIST_DIR}/" PREFIX "" FILES ${SOURCES}) + + target_compile_features(${TARGET_NAME} PRIVATE cxx_std_17) + set_target_properties(${TARGET_NAME} PROPERTIES CXX_EXTENSIONS OFF) + set_target_properties(${TARGET_NAME} PROPERTIES RUNTIME_OUTPUT_DIRECTORY "${BIN_DIR}") + set_property(TARGET ${TARGET_NAME} PROPERTY VS_DEBUGGER_WORKING_DIRECTORY "${BIN_DIR}") + # of_copy_runtime_to_bin_dir_after_build(${TARGET_NAME} "${BIN_DIR}") + + get_filename_component(parent_path ${CMAKE_CURRENT_LIST_DIR} DIRECTORY) + get_filename_component(test_name ${parent_path} NAME) + set_target_properties(${TARGET_NAME} PROPERTIES FOLDER "openframeworks/tests/${test_name}") + + # And copy the resource files to destination after building + if (EXISTS "${CMAKE_CURRENT_LIST_DIR}/bin/data") + add_custom_command(TARGET ${TARGET_NAME} POST_BUILD + COMMAND ${CMAKE_COMMAND} -E + copy_directory "${CMAKE_CURRENT_LIST_DIR}/bin/data" "${BIN_DIR}/data") + endif() + + add_test(NAME of_${TARGET_NAME} COMMAND ${BIN_DIR}/${TARGET_NAME} WORKING_DIRECTORY ${BIN_DIR}) + +endfunction() + +# Folders with tests to build +add_subdirectory(addons) +add_subdirectory(events) +add_subdirectory(graphics) +add_subdirectory(io) +add_subdirectory(math) +add_subdirectory(types) +add_subdirectory(utils) diff --git a/tests/addons/CMakeLists.txt b/tests/addons/CMakeLists.txt new file mode 100644 index 00000000000..0a126316d4e --- /dev/null +++ b/tests/addons/CMakeLists.txt @@ -0,0 +1,3 @@ + +add_subdirectory(networkTcp) +add_subdirectory(networkUdp) diff --git a/tests/addons/networkTcp/CMakeLists.txt b/tests/addons/networkTcp/CMakeLists.txt new file mode 100644 index 00000000000..2d67f44e80f --- /dev/null +++ b/tests/addons/networkTcp/CMakeLists.txt @@ -0,0 +1,2 @@ +define_test(test_networkTcp) +target_link_libraries(test_networkTcp of::ofxNetwork) \ No newline at end of file diff --git a/tests/addons/networkUdp/CMakeLists.txt b/tests/addons/networkUdp/CMakeLists.txt new file mode 100644 index 00000000000..bda081d94b4 --- /dev/null +++ b/tests/addons/networkUdp/CMakeLists.txt @@ -0,0 +1,2 @@ +define_test(test_networkUdp) +target_link_libraries(test_networkUdp of::ofxNetwork) \ No newline at end of file diff --git a/tests/events/CMakeLists.txt b/tests/events/CMakeLists.txt new file mode 100644 index 00000000000..1e044e412dc --- /dev/null +++ b/tests/events/CMakeLists.txt @@ -0,0 +1 @@ +add_subdirectory(events) \ No newline at end of file diff --git a/tests/events/events/CMakeLists.txt b/tests/events/events/CMakeLists.txt new file mode 100644 index 00000000000..ad58b19fc56 --- /dev/null +++ b/tests/events/events/CMakeLists.txt @@ -0,0 +1 @@ +define_test(test_events) \ No newline at end of file diff --git a/tests/graphics/CMakeLists.txt b/tests/graphics/CMakeLists.txt new file mode 100644 index 00000000000..f65bd762e66 --- /dev/null +++ b/tests/graphics/CMakeLists.txt @@ -0,0 +1 @@ +add_subdirectory(pixels) \ No newline at end of file diff --git a/tests/graphics/pixels/CMakeLists.txt b/tests/graphics/pixels/CMakeLists.txt new file mode 100644 index 00000000000..f0648bfd7df --- /dev/null +++ b/tests/graphics/pixels/CMakeLists.txt @@ -0,0 +1 @@ +define_test(test_pixels) \ No newline at end of file diff --git a/tests/io/CMakeLists.txt b/tests/io/CMakeLists.txt new file mode 100644 index 00000000000..0e6f44edbd5 --- /dev/null +++ b/tests/io/CMakeLists.txt @@ -0,0 +1 @@ +add_subdirectory(loadImage) \ No newline at end of file diff --git a/tests/io/loadImage/CMakeLists.txt b/tests/io/loadImage/CMakeLists.txt new file mode 100644 index 00000000000..6f64de8c9b8 --- /dev/null +++ b/tests/io/loadImage/CMakeLists.txt @@ -0,0 +1 @@ +define_test(test_loadImage) \ No newline at end of file diff --git a/tests/math/CMakeLists.txt b/tests/math/CMakeLists.txt new file mode 100644 index 00000000000..05cc8a4630f --- /dev/null +++ b/tests/math/CMakeLists.txt @@ -0,0 +1,2 @@ +add_subdirectory(ofNodeRegressionTests) +add_subdirectory(quaternionTests) \ No newline at end of file diff --git a/tests/math/ofNodeRegressionTests/CMakeLists.txt b/tests/math/ofNodeRegressionTests/CMakeLists.txt new file mode 100644 index 00000000000..b7c25b73f9f --- /dev/null +++ b/tests/math/ofNodeRegressionTests/CMakeLists.txt @@ -0,0 +1 @@ +define_test(test_ofNodeRegressionTests) \ No newline at end of file diff --git a/tests/math/quaternionTests/CMakeLists.txt b/tests/math/quaternionTests/CMakeLists.txt new file mode 100644 index 00000000000..43e8e876997 --- /dev/null +++ b/tests/math/quaternionTests/CMakeLists.txt @@ -0,0 +1 @@ +define_test(test_quaternionTests) \ No newline at end of file diff --git a/tests/types/CMakeLists.txt b/tests/types/CMakeLists.txt new file mode 100644 index 00000000000..aaefc4c6eb8 --- /dev/null +++ b/tests/types/CMakeLists.txt @@ -0,0 +1 @@ +add_subdirectory(parameters) \ No newline at end of file diff --git a/tests/types/parameters/CMakeLists.txt b/tests/types/parameters/CMakeLists.txt new file mode 100644 index 00000000000..f81326cbb6d --- /dev/null +++ b/tests/types/parameters/CMakeLists.txt @@ -0,0 +1 @@ +define_test(test_parameters) \ No newline at end of file diff --git a/tests/utils/CMakeLists.txt b/tests/utils/CMakeLists.txt new file mode 100644 index 00000000000..bf3a1584e29 --- /dev/null +++ b/tests/utils/CMakeLists.txt @@ -0,0 +1,5 @@ +add_subdirectory(buffer) +add_subdirectory(fileUtils) +add_subdirectory(logging) +add_subdirectory(strings) +add_subdirectory(xml) \ No newline at end of file diff --git a/tests/utils/buffer/CMakeLists.txt b/tests/utils/buffer/CMakeLists.txt new file mode 100644 index 00000000000..b3cb5eabb78 --- /dev/null +++ b/tests/utils/buffer/CMakeLists.txt @@ -0,0 +1 @@ +define_test(test_buffer) \ No newline at end of file diff --git a/tests/utils/fileUtils/CMakeLists.txt b/tests/utils/fileUtils/CMakeLists.txt new file mode 100644 index 00000000000..380d50bf143 --- /dev/null +++ b/tests/utils/fileUtils/CMakeLists.txt @@ -0,0 +1 @@ +define_test(test_fileUtils) \ No newline at end of file diff --git a/tests/utils/logging/CMakeLists.txt b/tests/utils/logging/CMakeLists.txt new file mode 100644 index 00000000000..d37c2a28dc0 --- /dev/null +++ b/tests/utils/logging/CMakeLists.txt @@ -0,0 +1 @@ +define_test(test_logging) \ No newline at end of file diff --git a/tests/utils/strings/CMakeLists.txt b/tests/utils/strings/CMakeLists.txt new file mode 100644 index 00000000000..028d4e879c6 --- /dev/null +++ b/tests/utils/strings/CMakeLists.txt @@ -0,0 +1 @@ +define_test(test_strings) \ No newline at end of file diff --git a/tests/utils/xml/CMakeLists.txt b/tests/utils/xml/CMakeLists.txt new file mode 100644 index 00000000000..7f4ed6fa5b9 --- /dev/null +++ b/tests/utils/xml/CMakeLists.txt @@ -0,0 +1 @@ +define_test(test_xml) \ No newline at end of file