From 3e3d8d6c13e6b4207a97aee117236b8ca70b9fbe Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?John=20Ankarstr=C3=B6m?= Date: Fri, 26 Aug 2022 09:10:38 +0200 Subject: Use CMake. I don't love it, but it makes it possible to support Visual Studio in addition to MinGW GCC. --- c/CMakeLists.txt | 47 +++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 47 insertions(+) create mode 100644 c/CMakeLists.txt (limited to 'c') diff --git a/c/CMakeLists.txt b/c/CMakeLists.txt new file mode 100644 index 0000000..1bfcac3 --- /dev/null +++ b/c/CMakeLists.txt @@ -0,0 +1,47 @@ +cmake_minimum_required(VERSION 3.10) +project(EpisodeBrowser) + +set(MSVC_EXT_INCLUDE_DIR ${CMAKE_CURRENT_SOURCE_DIR}/../x/h) +set(MSVC_EXT_LINK_DIR ${CMAKE_CURRENT_SOURCE_DIR}/../x/l) + +set(CMAKE_CXX_STANDARD 17) +set(CMAKE_CXX_STANDARD_REQUIRED True) +add_compile_definitions(UNICODE _UNICODE) + +add_executable(EpisodeBrowser WIN32) +target_sources(EpisodeBrowser PRIVATE + data.cpp + data.h + datalistview.cpp + datalistview.h + debug.cpp + debug.h + episodelistview.cpp + episodelistview.h + ext.cpp + ext.h + layout.cpp + layout.h + listview.cpp + listview.h + main.cpp + resource.h + resource.rc + test.cpp + test.h + util.h + win.cpp + win.h) + +if (CMAKE_GENERATOR MATCHES "Visual Studio") + set(CMAKE_EXE_LINKER_FLAGS "${CMAKE_EXE_LINKER_FLAGS} /MANIFEST:NO") + set(CMAKE_MODULE_LINKER_FLAGS "${CMAKE_MODULE_LINKER_FLAGS} /MANIFEST:NO") + set(CMAKE_SHARED_LINKER_FLAGS "${CMAKE_SHARED_LINKER_FLAGS} /MANIFEST:NO") + target_compile_options(EpisodeBrowser PRIVATE /wd26451 /wd6385) + target_include_directories(EpisodeBrowser PUBLIC ${MSVC_EXT_INCLUDE_DIR}) + find_library(LIBXML2 libxml2 HINTS ${MSVC_EXT_LINK_DIR}) + target_link_libraries(EpisodeBrowser comctl32 wininet ${LIBXML2}) +else() + target_include_directories(EpisodeBrowser PUBLIC C:/msys64/mingw64/include/libxml2) + target_link_libraries(EpisodeBrowser stdc++ comctl32 wininet libxml2) +endif() -- cgit v1.2.3