Skip to content

Commit e1161ab

Browse files
committed
cmake
1 parent 180bfbc commit e1161ab

File tree

3 files changed

+28
-5
lines changed

3 files changed

+28
-5
lines changed

CMakeLists.txt

+6-1
Original file line numberDiff line numberDiff line change
@@ -3,18 +3,21 @@ project(KoRE)
33

44
# For custom cmake modules.
55
set(CMAKE_MODULE_PATH "${CMAKE_SOURCE_DIR}/cmake")
6+
LINK_DIRECTORIES(${CMAKE_SOURCE_DIR}/lib)
67

78
include(GetOpenGLHeaders)
89

910
if(WIN32 AND NOT EXISTS ${CMAKE_SOURCE_DIR}/ext)
1011
message("No ext dir. Will make one.")
11-
execute_process(COMMAND ${PYTHON_VER} scripts/updateExt.py)
12+
#execute_process(COMMAND ${PYTHON_VER} scripts/updateExt.py)
13+
execute_process(COMMAND sh scripts/updateExt.msys)
1214
endif()
1315

1416
check_gl_headers()
1517

1618
set(LIBRARY_OUTPUT_PATH ${CMAKE_SOURCE_DIR}/lib)
1719
set(EXECUTABLE_OUTPUT_PATH ${CMAKE_SOURCE_DIR}/bin)
20+
set(CMAKE_LIBRARY_PATH ${CMAKE_SOURCE_DIR}/lib)
1821

1922
if(CMAKE_COMPILER_IS_GNUCXX)
2023
set(CMAKE_CXX_FLAGS "-std=c++0x")
@@ -40,6 +43,8 @@ if(WIN32)
4043
add_definitions(-DGLFW_INCLUDE_GL3)
4144
endif()
4245

46+
set(CMAKE_LIBRARY_PATH "${CMAKE_SOURCE_DIR}/lib")
47+
4348
#if(MSVC)
4449
# INCLUDE_DIRECTORIES(${CMAKE_SOURCE_DIR}/ext/include)
4550
# message("Hello MSVC")

demos/MainGLFW/CMakeLists.txt

+13-2
Original file line numberDiff line numberDiff line change
@@ -2,8 +2,17 @@ file(GLOB_RECURSE SOURCES *.cpp)
22

33
add_executable(MainGLFW ${SOURCES})
44

5+
#linking against a custom library
6+
target_link_libraries(MainGLFW D:/GitHub/KoRE/lib Assimp32d.dll)
7+
target_link_libraries(MainGLFW D:/GitHub/KoRE/lib assimp)
8+
target_link_libraries(MainGLFW D:/GitHub/KoRE/lib tinyxml.a)
9+
target_link_libraries(MainGLFW D:/GitHub/KoRE/lib glew32.a)
10+
target_link_libraries(MainGLFW D:/GitHub/KoRE/lib glfw.a)
11+
12+
513
if(WIN32)
614
set(EXT_LIBS ${CMAKE_SOURCE_DIR}/ext/lib)
15+
set(CMAKE_LIBRARY_PATH ${CMAKE_SOURCE_DIR}/lib)
716
if(MSVC)
817
link_directories(${EXT_LIBS})
918
set(KoRE_LIBS
@@ -17,15 +26,17 @@ if(WIN32)
1726
else()
1827
#MinGW
1928
set(KoRE_LIBS
20-
#${EXT_LIBS}/mingw/libglfw.a
29+
#${EXT_LIBS}/libglfw.a
2130
#${EXT_LIBS}/glew32.lib
22-
#${EXT_LIBS}/assimp_release-dll_win32/assimp.lib
31+
#${EXT_LIBS}/libglew32.a
32+
#${EXT_LIBS}/assimp_debug-dll_win32/assimp.lib
2333
#OpenGL32
2434
#glaux
2535
#glu32
2636
opengl32
2737
glfw
2838
glew32
39+
tinyxml
2940
KoRE
3041
)
3142

scripts/updateExt.msys

+9-2
Original file line numberDiff line numberDiff line change
@@ -28,8 +28,8 @@ wget --no-check-certificate --directory-prefix=$downloadDir https://sourceforge.
2828
wget --no-check-certificate --directory-prefix=$downloadDir http://sourceforge.net/projects/glfw/files/glfw/2.7.7/glfw-2.7.7.tar.gz/
2929
wget --no-check-certificate --directory-prefix=$downloadDir http://sourceforge.net/projects/ogl-math/files/glm-0.9.4.1/glm-0.9.4.1.zip/
3030
wget --no-check-certificate --directory-prefix=$downloadDir http://sourceforge.net/projects/assimp/files/assimp-3.0/assimp--3.0.1270-full.zip/
31-
32-
31+
wget --no-check-certificate --directory-prefix=$downloadDir http://sourceforge.net/projects/tinyxml/files/latest/
32+
wget --no-check-certificate --directory-prefix=$downloadDir www.opengl.org/registry/api/gl3.h
3333
# Unpack files
3434
for D in $(find $downloadDir -mindepth 1 -maxdepth 1 -type f) ; do
3535
if [[ $D == *.tgz || $D == *.gz ]];
@@ -46,6 +46,13 @@ done
4646
# remove archives
4747
#rm $downloadDir/glew-1.9.0.tgz
4848

49+
# build tinyxml
50+
cd $downloadDir/tinyxml_2_6_2/tinyxml
51+
printf "Building TinyXML \n"
52+
ming32-make
53+
ar rc libtinyxml.a tinyxml.o tinyxmlparser.o tinyxmlerror.o
54+
cd ../../../..
55+
4956
# build glew
5057
cd $downloadDir/glew-1.9.0
5158
printf "Building GLEW \n"

0 commit comments

Comments
 (0)