Source

gb_emulator / gb_emulator / CMakeLists.txt

Full commit
set(CMAKE_MODULE_PATH "${PROJECT_SOURCE_DIR}/cmake")
find_package(Boost REQUIRED)
find_package(Cg REQUIRED)
find_package(DirectX REQUIRED)
find_package(OpenGL REQUIRED)

include_directories(".")
include_directories("include")
include_directories("${PROJECT_SOURCE_DIR}/gb_net/include")
include_directories("${PROJECT_SOURCE_DIR}/third_party/glew/include")
include_directories("${PROJECT_SOURCE_DIR}/third_party/hqx/include")
include_directories("${PROJECT_SOURCE_DIR}/third_party/libsndfile/include")
include_directories("${PROJECT_SOURCE_DIR}/third_party/protobuf/src")
include_directories("${PROJECT_SOURCE_DIR}/third_party/sdl/include")
include_directories(${Boost_INCLUDE_DIRS})
include_directories(${CG_INCLUDE_PATH})
include_directories(${DirectX_INCLUDE_DIR})
include_directories(${OPENGL_INCLUDE_DIR})

link_directories(${Boost_LIBRARY_DIRS})

add_definitions(-D_SCL_SECURE_NO_WARNINGS)
add_definitions(-DUNICODE -D_UNICODE)
add_definitions(-DGB_EMULATOR_EXPORTS)
add_definitions(-DGLEW_STATIC)
add_definitions(-DWIN32_LEAN_AND_MEAN)
add_definitions(-D_WIN32_WINNT=0x0600)

# Set warning level
if(MSVC)
	set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} /W4 /WX")
elseif(CMAKE_COMPILER_IS_GNUCC OR CMAKE_COMPILER_IS_GNUCXX)
	set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -Wall -Wextra -pedantic")
endif()

# Disable warnings on specific files
if(MSVC)
	set_source_files_properties("gb.pb.cc" PROPERTIES COMPILE_FLAGS " /W0 ")
endif(MSVC)

add_library(gb_emulator SHARED
	include/gb_emulator/cdb_file.h
	include/gb_emulator/constants.h
	include/gb_emulator/defs.h
	include/gb_emulator/gb.h
	include/gb_emulator/gb_comms_serial.h
	include/gb_emulator/gb_config.h
	include/gb_emulator/gb_cpu.h
	include/gb_emulator/gb_debugger.h
	include/gb_emulator/gb_debugger_module.h
	include/gb_emulator/gb_disassembler.h
	include/gb_emulator/gb_input.h
	include/gb_emulator/gb_memory.h
	include/gb_emulator/gb_sound.h
	include/gb_emulator/gb_sound_wasapi.h
	include/gb_emulator/gb_sound_wasapi_renderer.h
	include/gb_emulator/gb_timers.h
	include/gb_emulator/gb_video.h
	include/gb_emulator/gb_video_d3d11.h
	include/gb_emulator/gb_video_opengl.h
	include/gb_emulator/glew_error.h

	gb.pb.cc
	src/cdb_file.cpp
	src/gb.cpp
	src/gb_comms_serial.cpp
	src/gb_cpu.cpp
	src/gb_debugger.cpp
	src/gb_disassembler.cpp
	src/gb_input.cpp
	src/gb_memory.cpp
	src/gb_sound.cpp
	src/gb_sound_wasapi.cpp
	src/gb_sound_wasapi_renderer.cpp
	src/gb_timers.cpp
	src/gb_video.cpp
	src/gb_video_d3d11.cpp
	src/gb_video_opengl.cpp
	src/glew_error.cpp)

target_link_libraries(gb_emulator
	gb_net
	glew
	hqx
	libprotobuf
	${CG_LIBRARY}
	${CG_D3D11_LIBRARY}
	${CG_GL_LIBRARY}
	${DirectX_XINPUT_LIBRARY}
	${OPENGL_gl_LIBRARY})