Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
permit link with the static GLEW library
- Loading branch information
JP Cimalando
committed
May 4, 2017
1 parent
ef310e4
commit 95cb473
Showing
4 changed files
with
46 additions
and
2 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,20 @@ | ||
include(FindPackageHandleStandardArgs) | ||
include(FindStaticLibrary) | ||
include(SelectLibraryConfigurations) | ||
|
||
find_package(GLEW) | ||
|
||
if(GLEW_FOUND) | ||
find_static_library(StaticGLEW_LIBRARY_RELEASE NAMES GLEW glew32 glew glew32s PATH_SUFFIXES lib64) | ||
find_static_library(StaticGLEW_LIBRARY_DEBUG NAMES GLEWd glew32d glewd PATH_SUFFIXES lib64) | ||
select_library_configurations(StaticGLEW) | ||
endif() | ||
|
||
find_package_handle_standard_args(StaticGLEW | ||
REQUIRED_VARS StaticGLEW_LIBRARY) | ||
|
||
if(StaticGLEW_FOUND) | ||
set(StaticGLEW_INCLUDE_DIRS ${GLEW_INCLUDE_DIRS}) | ||
set(StaticGLEW_LIBRARIES "${StaticGLEW_LIBRARY}") | ||
set(StaticGLEW_DEFINITIONS "GLEW_STATIC=1") | ||
endif() |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,11 @@ | ||
macro(find_static_library) | ||
set(_orig_CMAKE_FIND_LIBRARY_SUFFIXES "${CMAKE_FIND_LIBRARY_SUFFIXES}") | ||
if (WIN32) | ||
set(CMAKE_FIND_LIBRARY_SUFFIXES ".lib" ".a") | ||
else() | ||
set(CMAKE_FIND_LIBRARY_SUFFIXES ".a") | ||
endif() | ||
find_library(${ARGN}) | ||
set(CMAKE_FIND_LIBRARY_SUFFIXES "${_orig_CMAKE_FIND_LIBRARY_SUFFIXES}") | ||
unset(_orig_CMAKE_FIND_LIBRARY_SUFFIXES) | ||
endmacro() |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters