summaryrefslogtreecommitdiffhomepage
path: root/external
diff options
context:
space:
mode:
authorStanislaw Halik <sthalik@misaki.pl>2022-10-20 02:23:29 +0200
committerStanislaw Halik <sthalik@misaki.pl>2022-10-20 02:23:29 +0200
commit8fb653c9f48b81aa2ef986ac36bdb81c1fd5a4e9 (patch)
treec22b0610ae43d988d6b16e048158973d6d37bd17 /external
parentdcac560e53d82ca8d7c8952b0a7c695ae43d09c2 (diff)
a
Diffstat (limited to 'external')
-rw-r--r--external/CMakeLists.txt26
1 files changed, 19 insertions, 7 deletions
diff --git a/external/CMakeLists.txt b/external/CMakeLists.txt
index d70503a0..3b4110b7 100644
--- a/external/CMakeLists.txt
+++ b/external/CMakeLists.txt
@@ -1,16 +1,25 @@
project(floormat-external)
+set(FLOORMAT_SUBMODULE-DEPENDENCIES ON CACHE BOOL
+ "Use dependencies included in the source directory (needs git submodule update --init).")
+
foreach(_module corrade magnum magnum-integration magnum-plugins)
list(APPEND CMAKE_MODULE_PATH "${CMAKE_CURRENT_SOURCE_DIR}/${_module}/modules")
endforeach()
if(MSVC)
add_link_options(-WX:NO)
+ set_property(DIRECTORY APPEND PROPERTY STATIC_LIBRARY_OPTIONS
+ -IGNORE:4006 #warning LNK4006: main already defined in x.cpp.obj; second definition ignored
+ )
else()
- add_compile_options(-Wno-error)
+ add_compile_options(
+ -Wno-error
+ -Wno-undef
+ )
endif()
-if(FLOORMAT_SUBMODULE_DEPENDENCIES)
+if(FLOORMAT_SUBMODULE-DEPENDENCIES)
sets(BOOL
CORRADE_BUILD_STATIC OFF
CORRADE_BUILD_TESTS OFF
@@ -114,7 +123,9 @@ if(FLOORMAT_SUBMODULE_DEPENDENCIES)
)
endif()
-if(FLOORMAT_SUBMODULE_DEPENDENCIES)
+fm_run_hook(fm-userconfig-external-pre)
+
+if(FLOORMAT_SUBMODULE-DEPENDENCIES)
sets(PATH IMGUI_DIR "${CMAKE_CURRENT_SOURCE_DIR}/imgui")
add_subdirectory(json)
add_subdirectory(sdl2)
@@ -124,18 +135,19 @@ if(FLOORMAT_SUBMODULE_DEPENDENCIES)
add_subdirectory(magnum-integration)
endif()
-if(FLOORMAT_SUBMODULE_DEPENDENCIES)
+if(FLOORMAT_SUBMODULE-DEPENDENCIES)
if(MSVC)
target_compile_options(CorradeTestSuite PRIVATE -EHsc)
- set_property(DIRECTORY APPEND PROPERTY STATIC_LIBRARY_OPTIONS
- -IGNORE:4006 #warning LNK4006: main already defined in x.cpp.obj; second definition ignored
- )
endif()
endif()
+fm_run_hook(fm-userconfig-external)
+
find_package(SDL2 QUIET REQUIRED)
find_package(Corrade QUIET REQUIRED)
find_package(ImGui QUIET REQUIRED)
find_package(Magnum QUIET REQUIRED)
find_package(MagnumPlugins QUIET REQUIRED)
find_package(MagnumIntegration QUIET REQUIRED ImGui)
+
+fm_run_hook(fm-userconfig-external-post)