diff --git a/CMakeLists.txt b/CMakeLists.txt index 57d565e..4a37b6a 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -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() diff --git a/sq/CMakeLists.txt b/sq/CMakeLists.txt index 2b2733f..2ce35c3 100644 --- a/sq/CMakeLists.txt +++ b/sq/CMakeLists.txt @@ -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) diff --git a/sqstdlib/CMakeLists.txt b/sqstdlib/CMakeLists.txt index d847393..86ad721 100644 --- a/sqstdlib/CMakeLists.txt +++ b/sqstdlib/CMakeLists.txt @@ -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) diff --git a/squirrel/CMakeLists.txt b/squirrel/CMakeLists.txt index ab42054..8ba67fb 100644 --- a/squirrel/CMakeLists.txt +++ b/squirrel/CMakeLists.txt @@ -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)