Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #7 from RobertHue/master
common lowercase cmake commands and enabled compatibility with vcpkg looks good, thanks!
- Loading branch information
Showing
6 changed files
with
69 additions
and
48 deletions.
There are no files selected for viewing
File renamed without changes.
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
File renamed without changes.
File renamed without changes.
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 |
---|---|---|
@@ -1,26 +1,36 @@ | ||
SET(PROJECT_NAME libnoiseutils) | ||
set(PROJECT_NAME libnoiseutils) | ||
set(CMAKE_WINDOWS_EXPORT_ALL_SYMBOLS YES CACHE BOOL "Export all symbols") | ||
set(libSrcs ${libSrcs} | ||
noiseutils.cpp | ||
) | ||
add_library(noiseutils SHARED ${libSrcs}) | ||
add_library(noiseutils-static STATIC ${libSrcs}) | ||
|
||
add_library(noiseutils SHARED noiseutils.cpp ) | ||
add_library(noiseutils-static STATIC noiseutils.cpp ) | ||
|
||
SET_TARGET_PROPERTIES( noiseutils PROPERTIES LIBNOISE_VERSION ${LIBNOISE_VERSION} ) | ||
SET_TARGET_PROPERTIES( noiseutils-static PROPERTIES LIBNOISE_VERSION ${LIBNOISE_VERSION} ) | ||
set_target_properties(noiseutils PROPERTIES LIBNOISE_VERSION ${LIBNOISE_VERSION}) | ||
set_target_properties(noiseutils-static PROPERTIES LIBNOISE_VERSION ${LIBNOISE_VERSION}) | ||
|
||
target_link_libraries(noiseutils noise) | ||
target_link_libraries(noiseutils-static noise-static) | ||
|
||
# I would like to see more projects using these defaults | ||
if (CMAKE_CXX_COMPILER_ID MATCHES "GNU") | ||
ADD_DEFINITIONS( "-Wall -ansi -pedantic -O3" ) | ||
message(STATUS "noiseutils - using optimized compile settings with all warnings enabled") | ||
add_compile_options(-Wall -ansi -pedantic -O3) | ||
elseif (CMAKE_CXX_COMPILER_ID MATCHES "MSVC") | ||
message(STATUS "noiseutils - using optimized compile settings with all warnings enabled") | ||
add_compile_options(/Wall /Ox) | ||
endif() | ||
|
||
# Where to look for noise headers | ||
ADD_DEFINITIONS( "-I${PROJECT_SOURCE_DIR}/src" ) | ||
target_include_directories( noiseutils PRIVATE ${PROJECT_SOURCE_DIR}/src ) | ||
target_include_directories( noiseutils-static PRIVATE ${PROJECT_SOURCE_DIR}/src ) | ||
|
||
# install include files into /include | ||
install( FILES "${PROJECT_SOURCE_DIR}/noiseutils/noiseutils.h" | ||
DESTINATION "${CMAKE_INSTALL_PREFIX}/include/noise" ) | ||
|
||
# install include files into /usr/include | ||
INSTALL( FILES "${PROJECT_SOURCE_DIR}/noiseutils/noiseutils.h" DESTINATION | ||
"${CMAKE_INSTALL_PREFIX}/include/noise" ) | ||
# install dynamic libraries (.dll or .so) into /bin | ||
install( TARGETS noiseutils DESTINATION "${CMAKE_INSTALL_PREFIX}/bin" ) | ||
|
||
# install libraries into /lib | ||
INSTALL( TARGETS noiseutils DESTINATION "${CMAKE_INSTALL_PREFIX}/lib" ) | ||
INSTALL( TARGETS noiseutils-static DESTINATION "${CMAKE_INSTALL_PREFIX}/lib" ) | ||
# install static libraries (.lib) into /lib | ||
install( TARGETS noiseutils-static DESTINATION "${CMAKE_INSTALL_PREFIX}/lib" ) |
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