-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
11 changed files
with
225 additions
and
549 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -18,4 +18,9 @@ out | |
*.autosave | ||
*.user | ||
*.sdf | ||
*.sln | ||
*.vcxproj | ||
*.filters | ||
*.cmake | ||
*.opendb | ||
Makefile |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,198 @@ | ||
cmake_minimum_required(VERSION 2.8.12) | ||
cmake_policy(SET CMP0015 NEW) | ||
#cmake_policy(SET CMP0043 NEW) | ||
|
||
project (VertiRead CXX) | ||
set(CMAKE_SUPPRESS_REGENERATION true) | ||
set(CMAKE_CONFIGURATION_TYPES "Debug" "Release") | ||
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -std=c++11") | ||
|
||
# source files | ||
set(SRC_FILES | ||
"src/engine/audioSys.cpp" | ||
"src/engine/audioSys.h" | ||
"src/engine/engine.cpp" | ||
"src/engine/engine.h" | ||
"src/engine/filer.cpp" | ||
"src/engine/filer.h" | ||
"src/engine/inputSys.cpp" | ||
"src/engine/inputSys.h" | ||
"src/engine/main.cpp" | ||
"src/engine/scene.cpp" | ||
"src/engine/scene.h" | ||
"src/engine/windowSys.cpp" | ||
"src/engine/windowSys.h" | ||
"src/engine/world.cpp" | ||
"src/engine/world.h" | ||
"src/prog/browser.cpp" | ||
"src/prog/browser.h" | ||
"src/prog/library.cpp" | ||
"src/prog/library.h" | ||
"src/prog/playlistEditor.cpp" | ||
"src/prog/playlistEditor.h" | ||
"src/prog/program.cpp" | ||
"src/prog/program.h" | ||
"src/utils/capturers.cpp" | ||
"src/utils/capturers.h" | ||
"src/utils/items.cpp" | ||
"src/utils/items.h" | ||
"src/utils/objects.cpp" | ||
"src/utils/objects.h" | ||
"src/utils/popups.cpp" | ||
"src/utils/popups.h" | ||
"src/utils/scrollAreas.cpp" | ||
"src/utils/scrollAreas.h" | ||
"src/utils/types.cpp" | ||
"src/utils/types.h" | ||
"src/utils/utils.cpp" | ||
"src/utils/utils.h") | ||
|
||
if (${CMAKE_SYSTEM_NAME} MATCHES "Windows") | ||
set(SRC_FILES "${SRC_FILES} rsc/resource.rc") | ||
endif() | ||
|
||
# include directories | ||
if (${CMAKE_SYSTEM_NAME} MATCHES "Windows") | ||
include_directories(${CMAKE_CURRENT_SOURCE_DIR}/include) | ||
elseif (${CMAKE_SYSTEM_NAME} MATCHES "Darwin") | ||
include_directories(/usr/local/include /Library/Frameworks) | ||
endif() | ||
include_directories(${CMAKE_CURRENT_SOURCE_DIR}/src) | ||
|
||
# library/framework directories | ||
if (${CMAKE_SYSTEM_NAME} MATCHES "Windows") | ||
if (${CMAKE_SIZEOF_VOID_P} MATCHES "8") | ||
set(LIB_DIR ${CMAKE_SOURCE_DIR}/lib/win64) | ||
set(DLL_FILES | ||
"libFLAC-8.dll" | ||
"libfreetype-6.dll" | ||
"libjpeg-9.dll" | ||
"libmikmod-2.dll" | ||
"libmodplug-1.dll" | ||
"libogg-0.dll" | ||
"libpng16-16.dll" | ||
"libtiff-5.dll" | ||
"libvorbis-0.dll" | ||
"libvorbisfile-3.dll" | ||
"libwebp-4.dll" | ||
"msvcp140.dll" | ||
"SDL2.dll" | ||
"SDL2_image.dll" | ||
"SDL2_mixer.dll" | ||
"SDL2_ttf.dll" | ||
"smpeg2.dll" | ||
"vcruntime140.dll" | ||
"zlib1.dll") | ||
else() | ||
set(LIB_DIR ${CMAKE_SOURCE_DIR}/lib/win32) | ||
set(DLL_FILES | ||
"libFLAC-8.dll" | ||
"libfreetype-6.dll" | ||
"libjpeg-9.dll" | ||
"libmodplug-1.dll" | ||
"libogg-0.dll" | ||
"libpng16-16.dll" | ||
"libtiff-5.dll" | ||
"libvorbis-0.dll" | ||
"libvorbisfile-3.dll" | ||
"libwebp-4.dll" | ||
"msvcp140.dll" | ||
"SDL2.dll" | ||
"SDL2_image.dll" | ||
"SDL2_mixer.dll" | ||
"SDL2_ttf.dll" | ||
"smpeg2.dll" | ||
"vcruntime140.dll" | ||
"zlib1.dll") | ||
endif() | ||
link_directories(${LIB_DIR}) | ||
|
||
elseif (${CMAKE_SYSTEM_NAME} MATCHES "Darwin") | ||
find_library(LIB_SDL2 SDL2) | ||
find_library(LIB_SDL2_IMG SDL2_image) | ||
find_library(LIB_SDL2_TTF SDL2_ttf) | ||
find_library(LIB_SDL2_MIX SDL2_mixer) | ||
|
||
link_directories(/usr/local/lib) | ||
|
||
endif() | ||
|
||
# set main target | ||
add_executable(VertiRead ${SRC_FILES}) | ||
|
||
# linker flags | ||
if (${CMAKE_SYSTEM_NAME} MATCHES "Windows") | ||
target_link_libraries(VertiRead SDL2.lib SDL2_mixer.lib SDL2_image.lib SDL2_ttf.lib) | ||
|
||
elseif (${CMAKE_SYSTEM_NAME} MATCHES "Darwin") | ||
target_link_libraries(VertiRead ${LIB_SDL2} ${LIB_SDL2_IMG} ${LIB_SDL2_TTF} ${LIB_SDL2_MIX} boost_system boost_filesystem) | ||
|
||
elseif (${CMAKE_SYSTEM_NAME} MATCHES "Linux") | ||
target_link_libraries(VertiRead SDL2 SDL2_mixer SDL2_image SDL2_ttf boost_system boost_filesystem) | ||
|
||
endif() | ||
|
||
# target path | ||
if (${CMAKE_SYSTEM_NAME} MATCHES "Darwin") | ||
set(EXECUTABLE_OUTPUT_PATH "${CMAKE_BINARY_DIR}/VertiRead.app/Contents/MacOS") | ||
else() | ||
set(EXECUTABLE_OUTPUT_PATH "${CMAKE_BINARY_DIR}/bin") | ||
endif() | ||
|
||
# target properties | ||
if (${CMAKE_SYSTEM_NAME} MATCHES "Windows") | ||
set_target_properties(VertiRead PROPERTIES | ||
OUTPUT_NAME VertiRead | ||
RUNTIME_OUTPUT_DIRECTORY "${EXECUTABLE_OUTPUT_PATH}" | ||
RUNTIME_OUTPUT_DIRECTORY_DEBUG "${EXECUTABLE_OUTPUT_PATH}" | ||
RUNTIME_OUTPUT_DIRECTORY_RELEASE "${EXECUTABLE_OUTPUT_PATH}" | ||
LINK_FLAGS_DEBUG "/SUBSYSTEM:CONSOLE" | ||
LINK_FLAGS_RELEASE "/SUBSYSTEM:WINDOWS") | ||
else() | ||
set_target_properties(VertiRead PROPERTIES | ||
OUTPUT_NAME vertiread | ||
RUNTIME_OUTPUT_DIRECTORY "${EXECUTABLE_OUTPUT_PATH}" | ||
RUNTIME_OUTPUT_DIRECTORY_DEBUG "${EXECUTABLE_OUTPUT_PATH}" | ||
RUNTIME_OUTPUT_DIRECTORY_RELEASE "${EXECUTABLE_OUTPUT_PATH}") | ||
endif() | ||
|
||
# post buils commands | ||
if (${CMAKE_SYSTEM_NAME} MATCHES "Windows") | ||
foreach(dll_file ${DLL_FILES}) | ||
add_custom_command(TARGET VertiRead POST_BUILD | ||
COMMAND ${CMAKE_COMMAND} -E copy_if_different ${LIB_DIR}/${dll_file} ${EXECUTABLE_OUTPUT_PATH}) | ||
endforeach() | ||
add_custom_command(TARGET VertiRead POST_BUILD | ||
COMMAND ${CMAKE_COMMAND} -E copy_directory ${CMAKE_SOURCE_DIR}/data ${EXECUTABLE_OUTPUT_PATH}/data) | ||
|
||
elseif (${CMAKE_SYSTEM_NAME} MATCHES "Darwin") | ||
add_custom_command(TARGET VertiRead POST_BUILD | ||
COMMAND ${CMAKE_COMMAND} -E make_directory ${EXECUTABLE_OUTPUT_PATH}/../Resources | ||
COMMAND ${CMAKE_COMMAND} -E copy_if_different ${CMAKE_SOURCE_DIR}/rsc/Info.plist ${EXECUTABLE_OUTPUT_PATH}/.. | ||
COMMAND ${CMAKE_COMMAND} -E copy_if_different ${CMAKE_SOURCE_DIR}/rsc/icon.icns ${EXECUTABLE_OUTPUT_PATH}/../Resources | ||
COMMAND ${CMAKE_COMMAND} -E copy_directory ${CMAKE_SOURCE_DIR}/data ${EXECUTABLE_OUTPUT_PATH}/../Resources/data) | ||
|
||
elseif (${CMAKE_SYSTEM_NAME} MATCHES "Linux") | ||
add_custom_command(TARGET VertiRead POST_BUILD | ||
COMMAND ${CMAKE_COMMAND} -E copy_if_different ${CMAKE_SOURCE_DIR}/rsc/vertiread.desktop ${EXECUTABLE_OUTPUT_PATH} | ||
COMMAND ${CMAKE_COMMAND} -E copy_directory ${CMAKE_SOURCE_DIR}/data ${EXECUTABLE_OUTPUT_PATH}/data) | ||
endif() | ||
|
||
# filter file for ms visual studio | ||
if (MSVC) | ||
foreach(source IN LISTS SRC_FILES) | ||
get_filename_component(source_dir ${source} PATH) | ||
string(REPLACE "/" ";" dirs "${source_dir}") | ||
list(GET dirs 0 dir0) | ||
|
||
if (${dir0} MATCHES "rsc") | ||
set(filter_path "Source") | ||
else() | ||
list(REMOVE_AT dirs 0) | ||
list(INSERT dirs 0 "Source") | ||
string(REPLACE ";" "\\" filter_path "${dirs}") | ||
endif() | ||
source_group("${filter_path}" FILES ${source}) | ||
endforeach() | ||
endif() | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.