aboutsummaryrefslogtreecommitdiff
path: root/c
diff options
context:
space:
mode:
authorJohn Ankarström <john@ankarstrom.se>2022-08-26 09:10:38 +0200
committerJohn Ankarström <john@ankarstrom.se>2022-08-26 09:11:35 +0200
commit3e3d8d6c13e6b4207a97aee117236b8ca70b9fbe (patch)
tree2c89e0f343d40280d0b1f715b10d4591e21725fc /c
parenteb7709d8617bec27349eebb43e8941b3aaaf453e (diff)
downloadEpisodeBrowser-3e3d8d6c13e6b4207a97aee117236b8ca70b9fbe.tar.gz
Use CMake.
I don't love it, but it makes it possible to support Visual Studio in addition to MinGW GCC.
Diffstat (limited to 'c')
-rw-r--r--c/CMakeLists.txt47
1 files changed, 47 insertions, 0 deletions
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()