<commit_before>cmake_minimum_required(VERSION 2.8)
project(Viewer CXX)

# For Mac
if(APPLE)
	set(CMAKE_OSX_DEPLOYMENT_TARGET 10.10)
endif()

FILE(GLOB hs
	3rdParty/imgui/*.h
	EffekseerTool/*.h
	Graphics/*.h
	GUI/*.h
	*.h
)

FILE(GLOB cpps
	3rdParty/imgui/*.cpp
	3rdParty/imgui_addon/imguidock/*.cpp
	3rdParty/imgui_addon/imguihelper/*.cpp
	3rdParty/imgui_addon/fcurve/*.cpp
	EffekseerTool/*.cpp
	Graphics/*.cpp
	GUI/*.cpp
	*.cpp
	*.cxx
)

# OS Dependency
if (WIN32)
list(APPEND hs
	3rdParty/nfd/nfd.h
	3rdParty/nfd/nfd_common.h
	3rdParty/Boxer/boxer.h
)

list(APPEND cpps
	3rdParty/nfd/nfd_common.c
	3rdParty/nfd/nfd_win.cpp
	3rdParty/Boxer/boxer_win.cpp
	3rdParty/imgui_platform/imgui_impl_glfw.cpp
	3rdParty/imgui_platform/imgui_impl_opengl3.cpp
	3rdParty/imgui_platform/imgui_impl_dx9.cpp
	3rdParty/imgui_platform/imgui_impl_dx11.cpp
)

elseif(APPLE)

list(APPEND hs
	3rdParty/nfd/nfd.h
	3rdParty/nfd/nfd_common.h
	3rdParty/Boxer/boxer.h
)

list(APPEND cpps
	3rdParty/nfd/nfd_common.c
	3rdParty/nfd/nfd_cocoa.m
	3rdParty/Boxer/boxer_osx.mm
	3rdParty/imgui_platform/imgui_impl_glfw.cpp
	3rdParty/imgui_platform/imgui_impl_opengl3.cpp
)

else()

list(APPEND hs
	3rdParty/nfd/nfd.h
	3rdParty/nfd/nfd_common.h
	3rdParty/Boxer/boxer.h
)

list(APPEND cpps
	3rdParty/nfd/nfd_common.c
	3rdParty/nfd/nfd_gtk.c
	3rdParty/Boxer/boxer_linux.cpp
	3rdParty/imgui_platform/imgui_impl_glfw.cpp
	3rdParty/imgui_platform/imgui_impl_opengl3.cpp
)
endif()

# Graphics
if (WIN32)
FILE(GLOB hs_g
	Graphics/Platform/DX9/*.h
	Graphics/Platform/DX11/*.h
	Graphics/Platform/GL/*.h
)

FILE(GLOB cpps_g
	Graphics/Platform/DX9/*.cpp
	Graphics/Platform/DX11/*.cpp
	Graphics/Platform/GL/*.cpp
)
else()
FILE(GLOB hs_g
	Graphics/Platform/GL/*.h
)

FILE(GLOB cpps_g
	Graphics/Platform/GL/*.cpp
)

endif()

list(APPEND hs ${hs_g})
list(APPEND cpps ${cpps_g})


FilterFolder("${hs}")
FilterFolder("${cpps}")

# MSVC Flag
if (MSVC)
	if (NOT USE_MSVC_RUNTIME_LIBRARY_DLL)
		foreach (flag CMAKE_C_FLAGS
			CMAKE_C_FLAGS_DEBUG
			CMAKE_C_FLAGS_RELEASE
			CMAKE_CXX_FLAGS
			CMAKE_CXX_FLAGS_DEBUG
			CMAKE_CXX_FLAGS_RELEASE)

			if (${flag} MATCHES "/MD")
				string(REGEX REPLACE "/MD" "/MT" ${flag} "${${flag}}")
			endif()
			if (${flag} MATCHES "/MDd")
				string(REGEX REPLACE "/MDd" "/MTd" ${flag} "${${flag}}")
			endif()
		endforeach()
	endif()
endif()

include_directories(
	${EFK_THIRDPARTY_INCLUDES}
	3rdParty/imgui/
	../include/
	../EffekseerRendererDX9/
	../EffekseerRendererGL/
	../EffekseerSoundOSMixer/
	../
)

add_library(Viewer SHARED ${cpps} ${hs})
target_link_directories(
	Viewer
	PRIVATE
	${EFK_THIRDPARTY_LIBRARY_DIRECTORIES}
)
target_link_libraries(
	Viewer
	debug glfw3d
	debug OpenSoundMixerd
	optimized glfw3
	optimized OpenSoundMixer
)

add_dependencies(Viewer ExternalProject_zlib ExternalProject_libpng ExternalProject_libgd ExternalProject_glfw ExternalProject_OpenSoundMixer)

if(NOT APPLE)
    add_dependencies(Viewer ExternalProject_glew)
endif()

link_directories(
	
    ${PROJECT_SOURCE_DIR}/../lib/

)

if (WIN32)

target_link_libraries(
	Viewer
    EditorCommon
	effekseer
	effekseer_renderer_dx9
	effekseer_renderer_dx11
	effekseer_renderer_gl
	EffekseerSoundOSMixer
	IPC
	debug libgd_staticd
	debug libglew32d
	optimized libgd_static
	optimized libglew32
)
<commit_msg>fixed for mac<commit_after>cmake_minimum_required(VERSION 2.8)
project(Viewer CXX)

# For Mac
if(APPLE)
	set(CMAKE_OSX_DEPLOYMENT_TARGET 10.10)
endif()

FILE(GLOB hs
	3rdParty/imgui/*.h
	EffekseerTool/*.h
	Graphics/*.h
	GUI/*.h
	*.h
)

FILE(GLOB cpps
	3rdParty/imgui/*.cpp
	3rdParty/imgui_addon/imguidock/*.cpp
	3rdParty/imgui_addon/imguihelper/*.cpp
	3rdParty/imgui_addon/fcurve/*.cpp
	EffekseerTool/*.cpp
	Graphics/*.cpp
	GUI/*.cpp
	*.cpp
	*.cxx
)

# OS Dependency
if (WIN32)
list(APPEND hs
	3rdParty/nfd/nfd.h
	3rdParty/nfd/nfd_common.h
	3rdParty/Boxer/boxer.h
)

list(APPEND cpps
	3rdParty/nfd/nfd_common.c
	3rdParty/nfd/nfd_win.cpp
	3rdParty/Boxer/boxer_win.cpp
	3rdParty/imgui_platform/imgui_impl_glfw.cpp
	3rdParty/imgui_platform/imgui_impl_opengl3.cpp
	3rdParty/imgui_platform/imgui_impl_dx9.cpp
	3rdParty/imgui_platform/imgui_impl_dx11.cpp
)

elseif(APPLE)

list(APPEND hs
	3rdParty/nfd/nfd.h
	3rdParty/nfd/nfd_common.h
	3rdParty/Boxer/boxer.h
)

list(APPEND cpps
	3rdParty/nfd/nfd_common.c
	3rdParty/nfd/nfd_cocoa.m
	3rdParty/Boxer/boxer_osx.mm
	3rdParty/imgui_platform/imgui_impl_glfw.cpp
	3rdParty/imgui_platform/imgui_impl_opengl3.cpp
)

else()

list(APPEND hs
	3rdParty/nfd/nfd.h
	3rdParty/nfd/nfd_common.h
	3rdParty/Boxer/boxer.h
)

list(APPEND cpps
	3rdParty/nfd/nfd_common.c
	3rdParty/nfd/nfd_gtk.c
	3rdParty/Boxer/boxer_linux.cpp
	3rdParty/imgui_platform/imgui_impl_glfw.cpp
	3rdParty/imgui_platform/imgui_impl_opengl3.cpp
)
endif()

# Graphics
if (WIN32)
FILE(GLOB hs_g
	Graphics/Platform/DX9/*.h
	Graphics/Platform/DX11/*.h
	Graphics/Platform/GL/*.h
)

FILE(GLOB cpps_g
	Graphics/Platform/DX9/*.cpp
	Graphics/Platform/DX11/*.cpp
	Graphics/Platform/GL/*.cpp
)
else()
FILE(GLOB hs_g
	Graphics/Platform/GL/*.h
)

FILE(GLOB cpps_g
	Graphics/Platform/GL/*.cpp
)

endif()

list(APPEND hs ${hs_g})
list(APPEND cpps ${cpps_g})


FilterFolder("${hs}")
FilterFolder("${cpps}")

# MSVC Flag
if (MSVC)
	if (NOT USE_MSVC_RUNTIME_LIBRARY_DLL)
		foreach (flag CMAKE_C_FLAGS
			CMAKE_C_FLAGS_DEBUG
			CMAKE_C_FLAGS_RELEASE
			CMAKE_CXX_FLAGS
			CMAKE_CXX_FLAGS_DEBUG
			CMAKE_CXX_FLAGS_RELEASE)

			if (${flag} MATCHES "/MD")
				string(REGEX REPLACE "/MD" "/MT" ${flag} "${${flag}}")
			endif()
			if (${flag} MATCHES "/MDd")
				string(REGEX REPLACE "/MDd" "/MTd" ${flag} "${${flag}}")
			endif()
		endforeach()
	endif()
endif()

include_directories(
	${EFK_THIRDPARTY_INCLUDES}
	3rdParty/imgui/
	../include/
	../EffekseerRendererDX9/
	../EffekseerRendererGL/
	../EffekseerSoundOSMixer/
	../
)

add_library(Viewer SHARED ${cpps} ${hs})
target_link_directories(
	Viewer
	PRIVATE
	${EFK_THIRDPARTY_LIBRARY_DIRECTORIES}
)
target_link_libraries(
	Viewer
    EditorCommon
	debug glfw3d
	debug OpenSoundMixerd
	optimized glfw3
	optimized OpenSoundMixer
)

add_dependencies(Viewer ExternalProject_zlib ExternalProject_libpng ExternalProject_libgd ExternalProject_glfw ExternalProject_OpenSoundMixer)

if(NOT APPLE)
    add_dependencies(Viewer ExternalProject_glew)
endif()

link_directories(
	
    ${PROJECT_SOURCE_DIR}/../lib/

)

if (WIN32)

target_link_libraries(
	Viewer
	effekseer
	effekseer_renderer_dx9
	effekseer_renderer_dx11
	effekseer_renderer_gl
	EffekseerSoundOSMixer
	IPC
	debug libgd_staticd
	debug libglew32d
	optimized libgd_static
	optimized libglew32
)

{'fraction_non_alphanumeric': 0.11586670742892081, 'fraction_numerical': 0.020177315805564047, 'mean_word_length': 4.868161434977578, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 3, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '1657506', 'n_tokens_mistral': 3195, 'n_tokens_neox': 2942, 'n_words': 400}