aboutsummaryrefslogtreecommitdiff
path: root/c/CMakeLists.txt
blob: da411b253a7cf0c3193cf03446db3e5b5fce8d4a (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
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)

if(NOT CMAKE_CONFIGURATION_TYPES MATCHES "Release")
  add_compile_definitions(_DEBUG)
endif()

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()