Added new easy way of building TbaMUD in the Visual Studio through the CMake (#127)
* Added new experimental MSVC build way through CMake * Small build/README.md fix
This commit is contained in:
26
src/CMakeLists.txt
Normal file
26
src/CMakeLists.txt
Normal file
@@ -0,0 +1,26 @@
|
||||
cmake_minimum_required(VERSION 3.27)
|
||||
|
||||
# Set the project name
|
||||
project(circle)
|
||||
|
||||
# Global definitions
|
||||
if(MSVC)
|
||||
# using Visual Studio C++
|
||||
add_definitions(-D_CRT_SECURE_NO_WARNINGS -D_CRT_SECURE_NO_DEPRECATE -D_CRT_NONSTDC_NO_DEPRECATE)
|
||||
endif()
|
||||
|
||||
# circle itself
|
||||
file(GLOB CIRCLE_SOURCES
|
||||
"*.h"
|
||||
"*.c"
|
||||
)
|
||||
|
||||
add_executable(circle ${CIRCLE_SOURCES})
|
||||
|
||||
if(MSVC)
|
||||
target_link_libraries(circle wsock32.lib)
|
||||
|
||||
set_target_properties(circle PROPERTIES
|
||||
VS_DEBUGGER_WORKING_DIRECTORY "${CMAKE_SOURCE_DIR}/.."
|
||||
)
|
||||
endif()
|
||||
Reference in New Issue
Block a user