From c5c60068f7df1704820b450b37fc378062e12533 Mon Sep 17 00:00:00 2001 From: Gyusun Yeom Date: Tue, 6 Oct 2015 14:14:06 +0900 Subject: [PATCH] Add ".rc" files to each libraries and executables for Windows build --- build/cmake/CMakeLists.txt | 26 ++++++++++++++++++++------ 1 file changed, 20 insertions(+), 6 deletions(-) diff --git a/build/cmake/CMakeLists.txt b/build/cmake/CMakeLists.txt index c8d4dd2..1f458a7 100644 --- a/build/cmake/CMakeLists.txt +++ b/build/cmake/CMakeLists.txt @@ -71,16 +71,22 @@ endif () include_directories (${GLEW_DIR}/include) -add_library (glew SHARED ${GLEW_DIR}/src/glew.c) +set (GLEW_SRC_FILES ${GLEW_DIR}/src/glew.c) + +if (WIN32) + list (APPEND GLEW_SRC_FILES ${GLEW_DIR}/build/glew.rc) +endif () + +add_library (glew SHARED ${GLEW_SRC_FILES}) set_target_properties (glew PROPERTIES COMPILE_DEFINITIONS "GLEW_BUILD" OUTPUT_NAME "${GLEW_LIB_NAME}" PREFIX "${DLL_PREFIX}") -add_library (glew_s STATIC ${GLEW_DIR}/src/glew.c) +add_library (glew_s STATIC ${GLEW_SRC_FILES}) set_target_properties (glew_s PROPERTIES COMPILE_DEFINITIONS "GLEW_STATIC" OUTPUT_NAME "${GLEW_LIB_NAME}" PREFIX lib) target_link_libraries (glew ${GLEW_LIBRARIES}) target_link_libraries (glew_s ${GLEW_LIBRARIES}) -add_library(glewmx SHARED ${GLEW_DIR}/src/glew.c ) +add_library(glewmx SHARED ${GLEW_SRC_FILES}) set_target_properties (glewmx PROPERTIES COMPILE_DEFINITIONS "GLEW_BUILD;GLEW_MX" OUTPUT_NAME "${GLEW_LIB_NAME}mx" PREFIX "${DLL_PREFIX}") -add_library(glewmx_s STATIC ${GLEW_DIR}/src/glew.c ) +add_library(glewmx_s STATIC ${GLEW_SRC_FILES}) set_target_properties (glewmx_s PROPERTIES COMPILE_DEFINITIONS "GLEW_STATIC;GLEW_MX" OUTPUT_NAME "${GLEW_LIB_NAME}mx" PREFIX lib) target_link_libraries (glewmx ${GLEW_LIBRARIES}) target_link_libraries (glewmx_s ${GLEW_LIBRARIES}) @@ -114,10 +120,18 @@ install ( TARGETS ${targets_to_install} ) if (BUILD_UTILS) - add_executable (glewinfo ${GLEW_DIR}/src/glewinfo.c) + set (GLEWINFO_SRC_FILES ${GLEW_DIR}/src/glewinfo.c) + if (WIN32) + list (APPEND GLEWINFO_SRC_FILES ${GLEW_DIR}/build/glewinfo.rc) + endif () + add_executable (glewinfo ${GLEWINFO_SRC_FILES}) target_link_libraries (glewinfo glew) - add_executable (visualinfo ${GLEW_DIR}/src/visualinfo.c) + set (VISUALINFO_SRC_FILES ${GLEW_DIR}/src/visualinfo.c) + if (WIN32) + list (APPEND VISUALINFO_SRC_FILES ${GLEW_DIR}/build/visualinfo.rc) + endif () + add_executable (visualinfo ${VISUALINFO_SRC_FILES}) target_link_libraries (visualinfo glew) install ( TARGETS glewinfo visualinfo