arreglat el CMakeLists.txt per a windows
This commit is contained in:
@@ -11,29 +11,27 @@ set(EXECUTABLE demo2_pixels_noise)
|
|||||||
|
|
||||||
# Buscar SDL3 automáticamente
|
# Buscar SDL3 automáticamente
|
||||||
find_package(SDL3 REQUIRED)
|
find_package(SDL3 REQUIRED)
|
||||||
include_directories(${SDL3_INCLUDE_DIRS})
|
|
||||||
link_directories(${SDL3_LIBRARY_DIRS})
|
|
||||||
|
|
||||||
# Detectar la plataforma y ajustar configuraciones específicas
|
# Detectar la plataforma y ajustar configuraciones específicas
|
||||||
if(WIN32)
|
if(WIN32)
|
||||||
set(PLATFORM windows)
|
set(PLATFORM windows)
|
||||||
set(LDFLAGS "-lmingw32 -lws2_32 ${SDL3_LIBRARIES}")
|
|
||||||
set(EXE_EXT ".exe")
|
set(EXE_EXT ".exe")
|
||||||
|
set(EXTRA_LIBS mingw32 ws2_32)
|
||||||
elseif(UNIX AND NOT APPLE)
|
elseif(UNIX AND NOT APPLE)
|
||||||
set(PLATFORM linux)
|
set(PLATFORM linux)
|
||||||
set(EXE_EXT ".out")
|
set(EXE_EXT ".out")
|
||||||
set(LDFLAGS "${SDL3_LIBRARIES}")
|
set(EXTRA_LIBS "")
|
||||||
elseif(APPLE)
|
elseif(APPLE)
|
||||||
set(PLATFORM macos)
|
set(PLATFORM macos)
|
||||||
set(EXE_EXT ".out")
|
set(EXE_EXT ".out")
|
||||||
set(LDFLAGS "${SDL3_LIBRARIES}")
|
set(EXTRA_LIBS "")
|
||||||
endif()
|
endif()
|
||||||
|
|
||||||
# Añadir el ejecutable
|
# Añadir el ejecutable
|
||||||
add_executable(${EXECUTABLE}${EXE_EXT} ${SOURCE})
|
add_executable(${EXECUTABLE}${EXE_EXT} ${SOURCE})
|
||||||
|
|
||||||
# Enlazar las bibliotecas
|
# Enlazar las bibliotecas específicas y SDL3
|
||||||
target_link_libraries(${EXECUTABLE}${EXE_EXT} ${LDFLAGS})
|
target_link_libraries(${EXECUTABLE}${EXE_EXT} ${EXTRA_LIBS} SDL3::SDL3)
|
||||||
|
|
||||||
# Colocar el ejecutable en la raíz del proyecto
|
# Colocar el ejecutable en la raíz del proyecto
|
||||||
set_target_properties(${EXECUTABLE}${EXE_EXT} PROPERTIES RUNTIME_OUTPUT_DIRECTORY ${CMAKE_SOURCE_DIR})
|
set_target_properties(${EXECUTABLE}${EXE_EXT} PROPERTIES RUNTIME_OUTPUT_DIRECTORY ${CMAKE_SOURCE_DIR})
|
||||||
|
|||||||
Reference in New Issue
Block a user