Skip to content

Commit

Permalink
Make cmake configs useable from external projects
Browse files Browse the repository at this point in the history
  • Loading branch information
williamyang98 committed Jul 20, 2023
1 parent a14d350 commit addf6a7
Show file tree
Hide file tree
Showing 5 changed files with 8 additions and 7 deletions.
2 changes: 1 addition & 1 deletion cmake/Findeasyloggingpp.cmake
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
cmake_minimum_required(VERSION 3.10)
project(easyloggingpp)

set(EASYLOGGINGPP_SRC_DIR ${CMAKE_SOURCE_DIR}/vendor/easyloggingpp/src)
set(EASYLOGGINGPP_SRC_DIR ${CMAKE_CURRENT_LIST_DIR}/../vendor/easyloggingpp/src)

add_library(easyloggingpp STATIC
${EASYLOGGINGPP_SRC_DIR}/easylogging++.cc)
Expand Down
7 changes: 4 additions & 3 deletions cmake/Findfaad2.cmake
Original file line number Diff line number Diff line change
@@ -1,8 +1,9 @@
cmake_minimum_required(VERSION 3.10)
project(faad2)

set(FAAD_SRC_DIR ${CMAKE_SOURCE_DIR}/vendor/faad2/libfaad)
set(FAAD_HEADER_DIR ${CMAKE_SOURCE_DIR}/vendor/faad2/include)
set(FAAD_DIR ${CMAKE_CURRENT_LIST_DIR}/../vendor/faad2)
set(FAAD_SRC_DIR ${FAAD_DIR}/libfaad)
set(FAAD_HEADER_DIR ${FAAD_DIR}/include)

add_library(faad2 STATIC
${FAAD_SRC_DIR}/bits.c
Expand Down Expand Up @@ -110,7 +111,7 @@ set_target_properties(faad2 PROPERTIES CXX_STANDARD 17)

if(WIN32)
# win32_ver.h is required to set the package version string
configure_file(cmake/faad2_win32_ver.h.in ${FAAD_SRC_DIR}/win32_ver.h)
configure_file(${CMAKE_CURRENT_LIST_DIR}/faad2_win32_ver.h.in ${FAAD_SRC_DIR}/win32_ver.h)
target_compile_definitions(faad2 PRIVATE
HAVE_STDINT_H
HAVE_STRING_H
Expand Down
2 changes: 1 addition & 1 deletion cmake/Findfmt.cmake
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
cmake_minimum_required(VERSION 3.10)
project(fmtlib)

set(FMT_SRC_DIR ${CMAKE_SOURCE_DIR}/vendor/fmt)
set(FMT_SRC_DIR ${CMAKE_CURRENT_LIST_DIR}/../vendor/fmt)
add_subdirectory(${FMT_SRC_DIR})
2 changes: 1 addition & 1 deletion cmake/Findimgui.cmake
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
cmake_minimum_required(VERSION 3.16)
project(imgui)

set(SRC_DIR ${CMAKE_SOURCE_DIR}/vendor/imgui)
set(SRC_DIR ${CMAKE_CURRENT_LIST_DIR}/../vendor/imgui)

# imconfig.h is required to use 32bit vertex indices
# this is required since implot uses alot of vertices
Expand Down
2 changes: 1 addition & 1 deletion cmake/Findimplot.cmake
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
cmake_minimum_required(VERSION 3.16)
project(implot)

set(SRC_DIR ${CMAKE_SOURCE_DIR}/vendor/implot)
set(SRC_DIR ${CMAKE_CURRENT_LIST_DIR}/../vendor/implot)

add_library(implot STATIC
"${SRC_DIR}/implot.h"
Expand Down

0 comments on commit addf6a7

Please sign in to comment.