2017-12-06 03:26:15 +00:00
|
|
|
if(NOT WINDOWS_STORE)
|
2017-11-14 04:54:47 +00:00
|
|
|
cmake_minimum_required(VERSION 3.10 FATAL_ERROR) # because of c++17
|
2017-02-24 08:28:44 +00:00
|
|
|
project(visigen)
|
|
|
|
|
2020-04-11 05:05:55 +00:00
|
|
|
if (NOT MSVC)
|
|
|
|
set(CMAKE_CXX_STANDARD 20)
|
|
|
|
set(CMAKE_CXX_STANDARD_REQUIRED ON)
|
|
|
|
endif()
|
2017-06-18 02:53:39 +00:00
|
|
|
|
2019-09-06 11:50:15 +00:00
|
|
|
add_executable(visigen
|
|
|
|
VISIBuilder.cpp
|
|
|
|
VISIBuilder.hpp
|
|
|
|
VISIRenderer.cpp
|
|
|
|
VISIRenderer.hpp
|
2020-09-28 20:54:40 +00:00
|
|
|
glew.c
|
2019-09-06 11:50:15 +00:00
|
|
|
)
|
|
|
|
|
2017-02-24 08:28:44 +00:00
|
|
|
if(MSVC)
|
2019-09-06 11:50:15 +00:00
|
|
|
target_compile_options(visigen PRIVATE /EHsc)
|
2017-02-24 08:28:44 +00:00
|
|
|
else()
|
2019-09-06 11:50:15 +00:00
|
|
|
target_compile_options(visigen PRIVATE
|
|
|
|
-fno-exceptions
|
|
|
|
|
|
|
|
-Werror=return-type
|
|
|
|
-Wno-multichar
|
|
|
|
-Wno-narrowing
|
|
|
|
-Wno-nullability-completeness
|
|
|
|
)
|
2017-02-24 08:28:44 +00:00
|
|
|
endif()
|
|
|
|
|
|
|
|
if(APPLE)
|
2019-09-06 11:50:15 +00:00
|
|
|
target_sources(visigen PRIVATE MainMac.mm)
|
2017-02-24 08:28:44 +00:00
|
|
|
set_source_files_properties(MainMac.mm PROPERTIES COMPILE_FLAGS -fobjc-arc)
|
2017-02-25 07:59:37 +00:00
|
|
|
elseif(WIN32)
|
2019-09-06 11:50:15 +00:00
|
|
|
target_sources(visigen PRIVATE MainWin.cpp)
|
2017-02-26 02:43:27 +00:00
|
|
|
else()
|
2019-09-06 11:50:15 +00:00
|
|
|
target_sources(visigen PRIVATE MainXlib.cpp)
|
2017-02-24 08:28:44 +00:00
|
|
|
endif()
|
|
|
|
|
2018-01-02 01:04:23 +00:00
|
|
|
set_target_properties(visigen PROPERTIES COMPILE_DEFINITIONS URDE_DLPACKAGE="${URDE_DLPACKAGE}")
|
|
|
|
|
2018-10-16 03:17:02 +00:00
|
|
|
if(APPLE)
|
|
|
|
find_library(OPENGL_LIBRARY OpenGL)
|
2019-09-06 11:50:15 +00:00
|
|
|
target_link_libraries(visigen PRIVATE ${OPENGL_LIBRARY})
|
2020-09-28 20:54:40 +00:00
|
|
|
else()
|
|
|
|
include(FindPkgConfig)
|
|
|
|
pkg_check_modules(xstuff IMPORTED_TARGET x11 gl)
|
|
|
|
target_link_libraries(visigen PRIVATE PkgConfig::xstuff)
|
|
|
|
target_compile_options(visigen PRIVATE -pthread)
|
|
|
|
target_link_options(visigen PRIVATE -pthread)
|
2018-10-16 03:17:02 +00:00
|
|
|
endif()
|
|
|
|
|
2019-09-06 11:50:15 +00:00
|
|
|
target_link_libraries(visigen PRIVATE
|
|
|
|
athena-core
|
|
|
|
hecl-light
|
|
|
|
logvisor
|
|
|
|
lzokay
|
|
|
|
xxhash
|
|
|
|
zeus
|
|
|
|
${ZLIB_LIBRARIES}
|
|
|
|
)
|
2017-12-06 03:26:15 +00:00
|
|
|
endif()
|