Merge pull request #86 from paulsapps/sq_disable_installer

Allow disable of CMake install() sections
This commit is contained in:
Alberto Demichelis 2017-03-29 17:16:33 +08:00 committed by GitHub
commit 0bf296d46a
4 changed files with 27 additions and 13 deletions

View File

@ -40,19 +40,21 @@ if(CMAKE_SIZEOF_VOID_P EQUAL 8)
add_definitions(-D_SQ64)
endif()
if(NOT DEFINED INSTALL_BIN_DIR)
set(INSTALL_BIN_DIR bin)
endif()
if(NOT DEFINED SQ_DISABLE_INSTALLER)
if(NOT DEFINED INSTALL_BIN_DIR)
set(INSTALL_BIN_DIR bin)
endif()
if(NOT DEFINED INSTALL_LIB_DIR)
set(INSTALL_LIB_DIR lib)
if(NOT DEFINED INSTALL_LIB_DIR)
set(INSTALL_LIB_DIR lib)
endif()
endif()
add_subdirectory(squirrel)
add_subdirectory(sqstdlib)
add_subdirectory(sq)
if(NOT WIN32)
if(NOT WIN32 AND NOT DEFINED DISABLE_DYNAMIC)
set_target_properties(squirrel sqstdlib PROPERTIES SOVERSION 0 VERSION 0.0.0)
endif()

View File

@ -2,14 +2,18 @@ if(NOT DEFINED DISABLE_DYNAMIC)
add_executable(sq sq.c)
set_target_properties(sq PROPERTIES LINKER_LANGUAGE C)
target_link_libraries(sq squirrel sqstdlib)
install(TARGETS sq RUNTIME DESTINATION ${INSTALL_BIN_DIR})
if(NOT DEFINED SQ_DISABLE_INSTALLER)
install(TARGETS sq RUNTIME DESTINATION ${INSTALL_BIN_DIR})
endif()
endif()
if(NOT DEFINED DISABLE_STATIC)
add_executable(sq_static sq.c)
set_target_properties(sq_static PROPERTIES LINKER_LANGUAGE C)
target_link_libraries(sq_static squirrel_static sqstdlib_static)
install(TARGETS sq_static RUNTIME DESTINATION ${INSTALL_BIN_DIR})
if(NOT DEFINED SQ_DISABLE_INSTALLER)
install(TARGETS sq_static RUNTIME DESTINATION ${INSTALL_BIN_DIR})
endif()
endif()
if(DEFINED LONG_OUTPUT_NAMES)

View File

@ -10,14 +10,18 @@ set(SQSTDLIB_SRC sqstdaux.cpp
if(NOT DEFINED DISABLE_DYNAMIC)
add_library(sqstdlib SHARED ${SQSTDLIB_SRC})
target_link_libraries(sqstdlib squirrel)
install(TARGETS sqstdlib RUNTIME DESTINATION ${INSTALL_BIN_DIR}
if(NOT DEFINED SQ_DISABLE_INSTALLER)
install(TARGETS sqstdlib RUNTIME DESTINATION ${INSTALL_BIN_DIR}
LIBRARY DESTINATION ${INSTALL_LIB_DIR}
ARCHIVE DESTINATION ${INSTALL_LIB_DIR})
endif()
endif()
if(NOT DEFINED DISABLE_STATIC)
add_library(sqstdlib_static STATIC ${SQSTDLIB_SRC})
install(TARGETS sqstdlib_static ARCHIVE DESTINATION ${INSTALL_LIB_DIR})
if(NOT DEFINED SQ_DISABLE_INSTALLER)
install(TARGETS sqstdlib_static ARCHIVE DESTINATION ${INSTALL_LIB_DIR})
endif()
endif()
if(DEFINED LONG_OUTPUT_NAMES)

View File

@ -12,15 +12,19 @@ set(SQUIRREL_SRC sqapi.cpp
sqvm.cpp)
if(NOT DEFINED DISABLE_DYNAMIC)
add_library(squirrel SHARED ${SQUIRREL_SRC})
install(TARGETS squirrel RUNTIME DESTINATION ${INSTALL_BIN_DIR}
add_library(squirrel SHARED ${SQUIRREL_SRC})
if(NOT DEFINED SQ_DISABLE_INSTALLER)
install(TARGETS squirrel RUNTIME DESTINATION ${INSTALL_BIN_DIR}
LIBRARY DESTINATION ${INSTALL_LIB_DIR}
ARCHIVE DESTINATION ${INSTALL_LIB_DIR})
endif()
endif()
if(NOT DEFINED DISABLE_STATIC)
add_library(squirrel_static STATIC ${SQUIRREL_SRC})
install(TARGETS squirrel_static ARCHIVE DESTINATION ${INSTALL_LIB_DIR})
if(NOT DEFINED SQ_DISABLE_INSTALLER)
install(TARGETS squirrel_static ARCHIVE DESTINATION ${INSTALL_LIB_DIR})
endif()
endif()
if(DEFINED LONG_OUTPUT_NAMES)