Additional work with cmake on Windows, still does not work
This commit is contained in:
@@ -90,7 +90,7 @@ if(UNIX AND NOT ANDROID)
|
||||
endif()
|
||||
|
||||
#third party build options
|
||||
WAGIC_OPTION(BUILD_ZLIB "build zlib from source" OFF)
|
||||
WAGIC_OPTION(BUILD_ZLIB "build zlib from source" ON)
|
||||
WAGIC_OPTION(BUILD_JPEG "build jpeg from source" (WIN32 OR APPLE OR PSP OR ANDROID))
|
||||
WAGIC_OPTION(BUILD_PNG "build png from source" (WIN32 OR APPLE OR PSP OR ANDROID))
|
||||
WAGIC_OPTION(BUILD_UNZIP "build unzip from source" ON)
|
||||
@@ -155,6 +155,7 @@ endif()
|
||||
|
||||
# find or build 3rd party libraries
|
||||
|
||||
FindOrBuildZLIB()
|
||||
FindOrBuildOpenGL()
|
||||
FindOrBuildTinyXML()
|
||||
FindOrBuildZipFS()
|
||||
|
||||
@@ -46,25 +46,25 @@ macro(FindOrBuildUNZIP)
|
||||
endmacro()
|
||||
|
||||
macro(FindOrBuildBoost)
|
||||
if(PSP OR UNIX)
|
||||
if(PSP OR UNIX OR WIN32)
|
||||
#the psp build does not need more than a few headers
|
||||
#todo: remove from the repository
|
||||
set(BOOST_INCLUDE_DIRS ${CMAKE_SOURCE_DIR}/thirdparty)
|
||||
elseif(WIN32)
|
||||
# elseif(WIN32)
|
||||
#set BOOST_ROOT to the root of boost
|
||||
set(Boost_USE_STATIC_LIBS ON)
|
||||
set(Boost_USE_MULTITHREADED ON)
|
||||
set(BOOST_ROOT $ENV{BOOST_ROOT})
|
||||
# set(Boost_USE_STATIC_LIBS ON)
|
||||
# set(Boost_USE_MULTITHREADED ON)
|
||||
# set(BOOST_ROOT $ENV{BOOST_ROOT})
|
||||
|
||||
set(BOOST_LIBRARYDIR ${BOOST_ROOT}/libs)
|
||||
set(BOOST_INCLUDEDIR ${BOOST_ROOT})
|
||||
# set(BOOST_LIBRARYDIR ${BOOST_ROOT}/libs)
|
||||
# set(BOOST_INCLUDEDIR ${BOOST_ROOT})
|
||||
|
||||
find_package(Boost COMPONENTS system thread date_time REQUIRED)
|
||||
if(NOT Boost_FOUND)
|
||||
message("Set the BOOST_ROOT environment variable to point to your boost installation.")
|
||||
message("We need system thread and date_time compiled static libs")
|
||||
message("These libs are compiler specific.")
|
||||
endif()
|
||||
# find_package(Boost COMPONENTS system thread date_time REQUIRED)
|
||||
# if(NOT Boost_FOUND)
|
||||
# message("Set the BOOST_ROOT environment variable to point to your boost installation.")
|
||||
# message("We need system thread and date_time compiled static libs")
|
||||
# message("These libs are compiler specific.")
|
||||
# endif()
|
||||
# elseif(UNIX AND NOT ANDROID)
|
||||
# find_package(Boost COMPONENTS system thread date_time REQUIRED)
|
||||
elseif(ANDROID)
|
||||
@@ -86,7 +86,9 @@ endmacro()
|
||||
|
||||
macro(FindOrBuildZLIB)
|
||||
if(BUILD_ZLIB)
|
||||
message(WARNING "ZLIB sources are currently not included within the wagic tree")
|
||||
add_subdirectory(${CMAKE_SOURCE_DIR}/thirdparty/zlib ${CMAKE_BINARY_DIR}/thirdparty/zlib)
|
||||
set(ZLIB_INCLUDE_DIR ${CMAKE_SOURCE_DIR}/thirdparty/zlib)
|
||||
set(ZLIB_LIBRARY zlib)
|
||||
else()
|
||||
if(WIN32)
|
||||
set(ZLIB_ROOT ${CMAKE_SOURCE_DIR}/thirdparty/binary/win)
|
||||
@@ -94,7 +96,7 @@ macro(FindOrBuildZLIB)
|
||||
else()
|
||||
find_package(ZLIB)
|
||||
endif()
|
||||
endif()
|
||||
endif()
|
||||
endmacro()
|
||||
|
||||
macro(FindOrBuildGIF)
|
||||
|
||||
@@ -115,7 +115,7 @@ if(backend_sdl)
|
||||
${OPENSL_LIBRARIES})
|
||||
elseif(WIN32)
|
||||
set(JGE_INTERNAL_INCLUDE_DIRS ${TINYXML_INCLUDE_DIR} ${ZIPFS_INCLUDE_DIR} ${SDL2_INCLUDE_DIR}
|
||||
${UNZIP_INCLUDE_DIR} ${GIF_INCLUDE_DIR} ${Boost_INCLUDE_DIR})
|
||||
${UNZIP_INCLUDE_DIR} ${GIF_INCLUDE_DIR} ${Boost_INCLUDE_DIRS})
|
||||
set(JGE_SOURCES ${JGE_generic_src} ${JGE_graphics_src} ${JGE_linux_src} ${JGE_hge_src})
|
||||
set(JGE_LINK_LIBRARIES ${ZIPFS_LIBRARY} ${UNZIP_LIRARY} ${GIF_LIBRARIES} ${JPEG_LIBRARY}
|
||||
${PNG_LIBRARIES})
|
||||
|
||||
2
platforms/win/configure.cmake
Normal file
2
platforms/win/configure.cmake
Normal file
@@ -0,0 +1,2 @@
|
||||
add_definitions(-DWIN32)
|
||||
add_definitions(-D_DEBUG -D_CRT_SECURE_NO_WARNINGS)
|
||||
@@ -1,2 +0,0 @@
|
||||
add_definitions(-DWIN32)
|
||||
add_definitions(COMPILE_DEFINITIONS_DEBUG _CRT_SECURE_NO_WARNINGS)
|
||||
@@ -188,7 +188,7 @@ if(backend_sdl)
|
||||
${HGE_LIBRARY})
|
||||
elseif(WIN32)
|
||||
include_directories(${MTG_INCLUDE_DIRS} ${JGE_INCLUDE_DIRS} ${SDL2_INCLUDE_DIR} ${ZIPFS_INCLUDE_DIR}
|
||||
${Boost_INCLUDE_DIR} ${UNZIP_INCLUDE_DIR} ${HGE_INCLUDE_DIR} ${TINYXML_INCLUDE_DIR}
|
||||
${Boost_INCLUDE_DIRS} ${UNZIP_INCLUDE_DIR} ${HGE_INCLUDE_DIR} ${TINYXML_INCLUDE_DIR}
|
||||
${ZLIB_INCLUDE_DIR})
|
||||
add_executable(wagic ${MTG_generic_src} ${MTG_sdl_src} src/TestSuiteAI.cpp src/AIPlayerBakaB.cpp)
|
||||
link_directories(${Boost_LIBRARY_DIR} ${SDL2_LIBRARY_DIR})
|
||||
|
||||
1
thirdparty/libpng/CMakeLists.txt
vendored
1
thirdparty/libpng/CMakeLists.txt
vendored
@@ -18,6 +18,7 @@ SET(SOURCE
|
||||
pngwutil.c )
|
||||
|
||||
add_library(png ${SOURCE})
|
||||
include_directories(${ZLIB_INCLUDE_DIR})
|
||||
|
||||
if(operating_system_psp)
|
||||
# -DCHROME_PNG_WRITE_SUPPORT \
|
||||
|
||||
2
thirdparty/unzip/CMakeLists.txt
vendored
2
thirdparty/unzip/CMakeLists.txt
vendored
@@ -5,7 +5,7 @@ SET(SOURCE
|
||||
miniunz.c
|
||||
unzip.c)
|
||||
|
||||
include_directories(${ZLIB_INCLUDE_DIR} ${EXTRA_INCLUDES} ${ZLIB_INCLUDE_DIR})
|
||||
include_directories(${ZLIB_INCLUDE_DIR} ${EXTRA_INCLUDES})
|
||||
|
||||
add_library(unzip ${SOURCE})
|
||||
target_link_libraries(unzip ${ZLIB_LIBRARY})
|
||||
|
||||
4
thirdparty/zipFS/CMakeLists.txt
vendored
4
thirdparty/zipFS/CMakeLists.txt
vendored
@@ -5,8 +5,8 @@ set(SOURCES
|
||||
zstream.cpp
|
||||
ziphdr.cpp)
|
||||
|
||||
FindOrBuildZLIB()
|
||||
#FindOrBuildZLIB()
|
||||
include_directories(${CMAKE_SOURCE_DIR}/JGE/include ${EXTRA_INCLUDES} ${ZLIB_INCLUDE_DIR})
|
||||
|
||||
add_library(zipFS ${SOURCES})
|
||||
target_link_libraries(zipFS ${ZLIB_LIBRARY})
|
||||
#target_link_libraries(zipFS ${ZLIB_LIBRARY})
|
||||
Reference in New Issue
Block a user