[cmake] Move cmake build into build/cmake to avoid collision with established GNUmake build system.

This commit is contained in:
Nigel Stewart 2015-02-19 21:44:16 +10:00
parent 40513e0bb4
commit 4fcd4688a5
3 changed files with 20 additions and 13 deletions

1
.gitattributes vendored
View File

@ -1,3 +1,4 @@
* text eol=lf
*.png binary
build/*/* text eol=crlf
CMakeLists.txt text eol=lf

4
.gitignore vendored
View File

@ -6,6 +6,10 @@
/build/*/*.suo
/build/*/*.vcxproj.user
/build/*/tmp/
/build/cmake/CMakeFiles/
/build/cmake/CMakeCache.txt
/build/cmake/cmake_install.cmake
/build/cmake/Makefile
/auto/extensions
/auto/registry
/bin

View File

@ -14,6 +14,8 @@ option (BUILD_UTILS "utilities" ON)
set (GLEW_VERSION "1.12.0")
set (GLEW_DIR ${CMAKE_CURRENT_SOURCE_DIR}/../..)
set (CMAKE_ARCHIVE_OUTPUT_DIRECTORY ${CMAKE_BINARY_DIR}/lib)
set (CMAKE_LIBRARY_OUTPUT_DIRECTORY ${CMAKE_BINARY_DIR}/lib)
set (CMAKE_RUNTIME_OUTPUT_DIRECTORY ${CMAKE_BINARY_DIR}/bin)
@ -30,10 +32,10 @@ set (GLEW_LIBRARIES ${OPENGL_LIBRARIES})
add_definitions (-DGLEW_BUILD -DGLEW_NO_GLU)
include_directories (${PROJECT_SOURCE_DIR}/include)
include_directories (${GLEW_DIR}/include)
add_library (glew SHARED src/glew.c)
add_library (glew_s STATIC src/glew.c)
add_library (glew SHARED ${GLEW_DIR}/src/glew.c)
add_library (glew_s STATIC ${GLEW_DIR}/src/glew.c)
target_link_libraries (glew ${GLEW_LIBRARIES})
target_link_libraries (glew_s ${GLEW_LIBRARIES})
set_target_properties (glew PROPERTIES OUTPUT_NAME ${GLEW_LIB_NAME})
@ -41,8 +43,8 @@ set_target_properties (glew_s PROPERTIES OUTPUT_NAME ${GLEW_LIB_NAME})
set_target_properties (glew PROPERTIES PREFIX "${DLL_PREFIX}")
set_target_properties (glew_s PROPERTIES PREFIX lib)
add_library(glewmx SHARED src/glew.c )
add_library(glewmx_s STATIC src/glew.c )
add_library(glewmx SHARED ${GLEW_DIR}/src/glew.c )
add_library(glewmx_s STATIC ${GLEW_DIR}/src/glew.c )
target_link_libraries (glewmx ${GLEW_LIBRARIES})
target_link_libraries (glewmx_s ${GLEW_LIBRARIES})
set_target_properties (glewmx PROPERTIES COMPILE_FLAGS "-DGLEW_MX" OUTPUT_NAME ${GLEW_LIB_NAME}mx)
@ -57,10 +59,10 @@ install ( TARGETS glew glew_s glewmx glewmx_s
)
if (BUILD_UTILS)
add_executable (glewinfo src/glewinfo.c)
add_executable (glewinfo ${GLEW_DIR}/src/glewinfo.c)
target_link_libraries (glewinfo glew)
add_executable (visualinfo src/visualinfo.c)
add_executable (visualinfo ${GLEW_DIR}/src/visualinfo.c)
target_link_libraries (visualinfo glew)
install ( TARGETS glewinfo visualinfo
@ -76,11 +78,11 @@ set (version ${GLEW_VERSION})
set (libname ${GLEW_LIB_NAME})
set (cflags)
set (requireslib glu)
configure_file (glew.pc.in ${CMAKE_BINARY_DIR}/glew.pc @ONLY)
configure_file (${GLEW_DIR}/glew.pc.in ${GLEW_DIR}/glew.pc @ONLY)
set (cflags "-DGLEW_MX")
set (libname ${GLEW_LIB_NAME}mx)
configure_file (glew.pc.in ${CMAKE_BINARY_DIR}/glewmx.pc @ONLY)
configure_file (${GLEW_DIR}/glew.pc.in ${GLEW_DIR}/glewmx.pc @ONLY)
install(FILES ${CMAKE_BINARY_DIR}/glew.pc ${CMAKE_BINARY_DIR}/glewmx.pc
install(FILES ${GLEW_DIR}/glew.pc ${GLEW_DIR}/glewmx.pc
DESTINATION lib/pkgconfig
)