Skip to content

Commit

Permalink
Remove CPM.cmake and add first steps towards Conan support
Browse files Browse the repository at this point in the history
  • Loading branch information
HerrNamenlos123 committed Dec 20, 2023
1 parent b84ad46 commit 4532d60
Show file tree
Hide file tree
Showing 22 changed files with 642 additions and 1,346 deletions.
31 changes: 27 additions & 4 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,30 @@ add_library(of::openframeworks ALIAS openframeworks)
include(${CMAKE_CURRENT_LIST_DIR}/libs/openFrameworks/CMakeLists.txt)

# This downloads and configures the dependencies for us
include(${CMAKE_CURRENT_LIST_DIR}/cmake/download_and_link_deps.cmake)
# include(${CMAKE_CURRENT_LIST_DIR}/cmake/download_and_link_deps.cmake)


# of::tess2
# of::glm
# of::utf8
# of::FreeImage
# of::uriparser
# of::openssl
# of::curl
# of::freetype
# of::pugixml
# of::json

# find_package(unofficial-libtess2 CONFIG REQUIRED)
set(CMAKE_MODULE_PATH ${CMAKE_MODULE_PATH} "${CMAKE_BINARY_DIR}")
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)

# C++ standard version and disabling non-standard compiler specific features
target_compile_features(openframeworks PUBLIC cxx_std_17)
Expand All @@ -44,9 +67,9 @@ target_compile_definitions(openframeworks PUBLIC
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:$<IF:$<CONFIG:Debug>,MSVCRT,MSVCRTd>") # Don't link to the default C++ standard library (Conflicting with third-party libraries)
# 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:$<IF:$<CONFIG:Debug>,MSVCRT,MSVCRTd>") # Don't link to the default C++ standard library (Conflicting with third-party libraries)
endif()

# Where compiled binaries should be placed
Expand Down
4 changes: 2 additions & 2 deletions addons/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -54,8 +54,8 @@ add_subdirectory(ofxNetwork)
add_subdirectory(ofxOpenCv)
add_subdirectory(ofxOsc)
add_subdirectory(ofxPoco)
add_subdirectory(ofxSvg)
# add_subdirectory(ofxSvg)
add_subdirectory(ofxThreadedImageLoader)
add_subdirectory(ofxUnitTests)
add_subdirectory(ofxVectorGraphics)
add_subdirectory(ofxXmlSettings)
# add_subdirectory(ofxXmlSettings)
4 changes: 3 additions & 1 deletion addons/ofxAssimpModelLoader/CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -1,2 +1,4 @@
define_addon(ofxAssimpModelLoader)
target_link_libraries(ofxAssimpModelLoader of::assimp)

find_package(assimp CONFIG REQUIRED)
target_link_libraries(ofxAssimpModelLoader assimp::assimp)
3 changes: 2 additions & 1 deletion addons/ofxKinect/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -8,4 +8,5 @@ if (WIN32)
target_include_directories(ofxKinect PUBLIC libs/libfreenect/platform/windows)
endif ()

target_link_libraries(ofxKinect of::libusb)
find_package(libusb REQUIRED)
target_link_libraries(ofxKinect libusb::libusb)
10 changes: 6 additions & 4 deletions addons/ofxOpenCv/CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -1,6 +1,8 @@
define_addon(ofxOpenCv)
target_link_libraries(ofxOpenCv of::opencv)

if (WIN32) # We only need ippicv on Windows
target_link_libraries(ofxOpenCv of::ippicv)
endif()
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()
4 changes: 3 additions & 1 deletion addons/ofxPoco/CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -1,2 +1,4 @@
define_addon(ofxPoco)
target_link_libraries(ofxPoco of::poco)

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)
5 changes: 4 additions & 1 deletion addons/ofxSvg/CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -1,2 +1,5 @@
define_addon(ofxSvg)
target_link_libraries(ofxSvg of::svgtiny of::libxml2)

find_package(svgtiny REQUIRED)
find_package(libxml2 REQUIRED)
target_link_libraries(ofxSvg svgtiny::svgtiny libxml2::libxml2)
Loading

0 comments on commit 4532d60

Please sign in to comment.