From c3cd37a462a2a2ae1fa3a98b10bb2a070a988af5 Mon Sep 17 00:00:00 2001 From: Mauro Sardara Date: Mon, 5 Jun 2017 15:06:32 +0200 Subject: - Adding support for iOS - Adding build type: DEBUG, RELEASE, RELEASE with debug symbols, RELEASE with min size executable Change-Id: I3a52af68445264824476eab3d9f39b6f23f634b4 Signed-off-by: Mauro Sardara --- libparc/.gitignore | 2 +- libparc/CMakeLists.txt | 42 +++++++-- libparc/parc/CMakeLists.txt | 57 +++++++----- longbow/.gitignore | 1 - longbow/CMakeLists.txt | 179 ++++++++++++++++++++----------------- longbow/src/LongBow/CMakeLists.txt | 84 ++++++++++------- 6 files changed, 220 insertions(+), 145 deletions(-) diff --git a/libparc/.gitignore b/libparc/.gitignore index 926b1a2c..9bdb2b73 100644 --- a/libparc/.gitignore +++ b/libparc/.gitignore @@ -61,7 +61,7 @@ parc/parcLibrary_About.c parc/parcLibrary_About.h parc/parc_About.c parc/parc_About.h -LDADD = ${INC_LFLAGS} +LDADD = ${INC_LFLAGS} libtool *~ diff --git a/libparc/CMakeLists.txt b/libparc/CMakeLists.txt index ca5c5e10..defa060a 100644 --- a/libparc/CMakeLists.txt +++ b/libparc/CMakeLists.txt @@ -6,6 +6,11 @@ set_property(GLOBAL PROPERTY USE_FOLDERS ON) set(CMAKE_C_STANDARD 99) set(CMAKE_C_STANDARD_REQUIRED ON) +if (NOT CMAKE_BUILD_TYPE) + message(STATUS "No build type selected, default to Release") + set(CMAKE_BUILD_TYPE "Release") +endif () + if( UNIX ) link_libraries(m) endif( UNIX ) @@ -18,28 +23,47 @@ if(ANDROID_API) message("############ Detected cross compile for $ENV{CMAKE_SYSTEM_NAME}") message("############ This build will not include doxygen, tools, or tests") set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} ${ANDROID_C_FLAGS} -Wall") +elseif(COMPILE_FOR_IOS) + message("############ Detected cross compile for $ENV{CMAKE_SYSTEM_NAME}") + message("############ This build will not include doxygen, tools, or tests") + set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS}") else() # set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -Wall") # set(CMAKE_C_FLAGS_NOPANTS "${CMAKE_C_FLAGS_NOPANTS} -O3 -DNDEBUG -DPARCLibrary_DISABLE_VALIDATION") - set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -O3 -DNDEBUG -DPARCLibrary_DISABLE_VALIDATION") + set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS}") find_package( Doxygen ) endif() +set(CMAKE_C_FLAGS_DEBUG "${CMAKE_C_FLAGS_DEBUG} ${CMAKE_C_FLAGS}") +set(CMAKE_C_FLAGS_RELEASE "${CMAKE_C_FLAGS_RELEASE} ${CMAKE_C_FLAGS} -DPARCLibrary_DISABLE_VALIDATION") +set(CMAKE_C_FLAGS_RELWITHDEBINFO "${CMAKE_C_FLAGS_RELWITHDEBINFO} ${CMAKE_C_FLAGS}") +set(CMAKE_C_FLAGS_MINSIZEREL "${CMAKE_C_FLAGS_MINSIZEREL} ${CMAKE_C_FLAGS}") + include_directories($ENV{CCNX_DEPENDENCIES}/include) set(OPENSSL_ROOT_DIR $ENV{CCNX_DEPENDENCIES}) include_directories(${PROJECT_BINARY_DIR}/parc ${PROJECT_SOURCE_DIR}) -find_package( LongBow REQUIRED ) -include_directories(${LONGBOW_INCLUDE_DIRS}) +if(COMPILE_FOR_IOS) + find_host_package( LongBow REQUIRED ) + include_directories(${LONGBOW_INCLUDE_DIRS}) + + find_host_package( LibEvent REQUIRED ) + include_directories(${LIBEVENT_INCLUDE_DIRS}) -find_package( LibEvent REQUIRED ) -include_directories(${LIBEVENT_INCLUDE_DIRS}) + find_host_package ( OpenSSL REQUIRED ) +else() + find_package( LongBow REQUIRED ) + include_directories(${LONGBOW_INCLUDE_DIRS}) + + find_package( LibEvent REQUIRED ) + include_directories(${LIBEVENT_INCLUDE_DIRS}) -find_package ( Threads REQUIRED ) + find_package ( Threads REQUIRED ) -find_package ( OpenSSL REQUIRED ) + find_package ( OpenSSL REQUIRED ) +endif() set(PARC_BIN_LIBRARIES parc @@ -59,6 +83,10 @@ if (ANDROID_API) macro(AddTest testFile) message("Android build: Skipping test ${ARGV0}") endmacro(AddTest) +elseif(COMPILE_FOR_IOS) + macro(AddTest testFile) + message("iOS build: Skipping test ${ARGV0}") + endmacro(AddTest) else() macro(AddTest testFile) add_executable(${ARGV0} ${ARGV0}.c) diff --git a/libparc/parc/CMakeLists.txt b/libparc/parc/CMakeLists.txt index 04abfac9..09b73e17 100644 --- a/libparc/parc/CMakeLists.txt +++ b/libparc/parc/CMakeLists.txt @@ -352,25 +352,34 @@ source_group(testing FILES ${LIBPARC_TESTING_SOURCE_FILES} ${LIBPARC_TESTING_HEA source_group(statistics FILES ${LIBPARC_STATISTICS_SOURCE_FILES} ${LIBPARC_STATISTICS_HEADER_FILES}) source_group(memory FILES ${LIBPARC_MEMORY_SOURCE_FILES} ${LIBPARC_MEMORY_HEADER_FILES}) -if("${CMAKE_CXX_COMPILER_ID}" STREQUAL "AppleClang") +if("${CMAKE_CXX_COMPILER_ID}" STREQUAL "AppleClang" OR COMPILE_FOR_IOS) set(CMAKE_SHARED_LIBRARY_CREATE_C_FLAGS "${CMAKE_SHARED_LIBRARY_CREATE_C_FLAGS} -undefined dynamic_lookup") message( "-- Set \"-undefined dynamic_lookup\" for shared libraries") endif() +if(COMPILE_FOR_IOS OR ANDROID_API) + add_library(parc STATIC ${LIBPARC_SOURCE_FILES} ${LIBEVENT_LIBRARIES} ${OPENSSL_LIBRARIES}) + target_link_libraries(parc ${LIBEVENT_LIBRARIES}) + target_link_libraries(parc ${OPENSSL_LIBRARIES}) + set(libparcLibraries + parc + ) +else() + add_library(parc STATIC ${LIBPARC_SOURCE_FILES}) + add_library(parc.shared SHARED ${LIBPARC_SOURCE_FILES}) + target_link_libraries(parc.shared ${LIBEVENT_LIBRARIES}) + target_link_libraries(parc.shared ${OPENSSL_LIBRARIES}) + set_target_properties(parc.shared PROPERTIES + C_STANDARD 99 + SOVERSION 1 + VERSION 1.0 + OUTPUT_NAME parc ) + set(libparcLibraries + parc + parc.shared + ) -add_library(parc STATIC ${LIBPARC_SOURCE_FILES}) -add_library(parc.shared SHARED ${LIBPARC_SOURCE_FILES}) -target_link_libraries(parc.shared ${LIBEVENT_LIBRARIES}) -target_link_libraries(parc.shared ${OPENSSL_LIBRARIES}) -set_target_properties(parc.shared PROPERTIES - C_STANDARD 99 - SOVERSION 1 - VERSION 1.0 - OUTPUT_NAME parc ) +endif() -set(libparcLibraries - parc - parc.shared - ) foreach(lib ${libparcLibraries}) install(TARGETS ${lib} COMPONENT library LIBRARY DESTINATION lib ARCHIVE DESTINATION lib) @@ -387,12 +396,14 @@ install(FILES ${LIBPARC_BASE_HEADER_FILES} DESTINATION include/parc COMPON install(FILES ${LIBPARC_STATISTICS_HEADER_FILES} DESTINATION include/parc/statistics COMPONENT headers) install(FILES ${LIBPARC_MEMORY_HEADER_FILES} DESTINATION include/parc/memory COMPONENT headers) -add_subdirectory(security/command-line) -add_subdirectory(algol/test) -add_subdirectory(concurrent/test) -add_subdirectory(developer/test) -add_subdirectory(security/test) -add_subdirectory(logging/test) -add_subdirectory(testing/test) -add_subdirectory(statistics/test) -add_subdirectory(memory/test) +if(NOT COMPILE_FOR_IOS) + add_subdirectory(security/command-line) + add_subdirectory(algol/test) + add_subdirectory(concurrent/test) + add_subdirectory(developer/test) + add_subdirectory(security/test) + add_subdirectory(logging/test) + add_subdirectory(testing/test) + add_subdirectory(statistics/test) + add_subdirectory(memory/test) +endif() diff --git a/longbow/.gitignore b/longbow/.gitignore index e1365556..2a963e9c 100644 --- a/longbow/.gitignore +++ b/longbow/.gitignore @@ -27,5 +27,4 @@ Makefile *.swp libtool *~ -*.pyc .idea diff --git a/longbow/CMakeLists.txt b/longbow/CMakeLists.txt index 07c743c7..20fc9c0b 100644 --- a/longbow/CMakeLists.txt +++ b/longbow/CMakeLists.txt @@ -8,6 +8,11 @@ set(CMAKE_MODULE_PATH ${CMAKE_MODULE_PATH} "${CMAKE_SOURCE_DIR}/cmake/Modules/") set(CMAKE_C_STANDARD 99) set(CMAKE_C_STANDARD_REQUIRED ON) +if (NOT CMAKE_BUILD_TYPE) + message(STATUS "No build type selected, default to Release") + set(CMAKE_BUILD_TYPE "Release") +endif () + set_property(GLOBAL PROPERTY USE_FOLDERS ON) execute_process(COMMAND ${PROJECT_SOURCE_DIR}/cmake/get_version.sh ${PROJECT_SOURCE_DIR} @@ -54,9 +59,17 @@ if(ANDROID_API) message("Android build: Skipping test ${ARGV0}") endmacro(AddTest) + add_subdirectory(src) +elseif(COMPILE_FOR_IOS) + message("############ Detected cross compile for ${CMAKE_SYSTEM_NAME}") + message("############ This build will not include doxygen, tools, or tests") + set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -Wall") + macro(AddTest testFile) + message("IOS build: Skipping test ${ARGV0}") + endmacro(AddTest) add_subdirectory(src) else() - set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -O3 -D_GNU_SOURCE") + set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -D_GNU_SOURCE") macro(AddTest testFile) add_executable(${ARGV0} ${ARGV0}.c) target_link_libraries(${ARGV0} ${PARC_BIN_LIBRARIES}) @@ -66,84 +79,88 @@ else() add_subdirectory(src) add_subdirectory(documentation) +endif() + +set(CMAKE_C_FLAGS_DEBUG "${CMAKE_C_FLAGS_DEBUG} ${CMAKE_C_FLAGS}") +set(CMAKE_C_FLAGS_RELEASE "${CMAKE_C_FLAGS_RELEASE} ${CMAKE_C_FLAGS}") +set(CMAKE_C_FLAGS_RELWITHDEBINFO "${CMAKE_C_FLAGS_RELWITHDEBINFO} ${CMAKE_C_FLAGS}") +set(CMAKE_C_FLAGS_MINSIZEREL "${CMAKE_C_FLAGS_RELWITHDEBINFO} ${CMAKE_C_FLAGS}") + +# Generate DEB / RPM packages + +option(DEB_PACKAGE "Create deb package" OFF) +option(RPM_PACKAGE "Create deb package" OFF) + +set(VENDOR "Cisco Systems" CACHE STRING "Vendor") +set(CONTACT "msardara@cisco.com" CACHE STRING "Contact") +set(DISTRIBUTION "xenial" CACHE STRING "Distribution") +set(ARCHITECTURE "amd64" CACHE STRING "Architecture") +set(PACKAGE_MAINTAINER "Mauro Sardara (msardara@cisco.com)" CACHE STRING "Maintainer") +string(TOLOWER ${CMAKE_PROJECT_NAME} PACKAGE_NAME) +set(CPACK_PACKAGING_INSTALL_PREFIX "/usr") +set(CPACK_PACKAGE_VENDOR ${VENDOR}) +set(CPACK_PACKAGE_CONTACT ${CONTACT}) +set(CPACK_COMPONENTS_ALL library headers documentation) + +# Get the version +execute_process(COMMAND bash ${CMAKE_SOURCE_DIR}/scripts/version + OUTPUT_VARIABLE PACKAGE_VERSION) + +if (PACKAGE_VERSION) + string(STRIP ${PACKAGE_VERSION} PACKAGE_VERSION) +else() + set(PACKAGE_VERSION 1.0) +endif() + +if(DEB_PACKAGE) + set(TYPE "DEBIAN") + set(GENERATOR "DEB") + + set(CPACK_${TYPE}_LIBRARY_PACKAGE_NAME "${PACKAGE_NAME}") + set(CPACK_${TYPE}_HEADERS_PACKAGE_NAME "${PACKAGE_NAME}-dev") + set(CPACK_${TYPE}_DOCUMENTATION_PACKAGE_NAME "${PACKAGE_NAME}-doc") + + set(CPACK_${TYPE}_LIBRARY_FILE_NAME "${PACKAGE_NAME}_${PACKAGE_VERSION}_${ARCHITECTURE}.deb") + set(CPACK_${TYPE}_HEADERS_FILE_NAME "${PACKAGE_NAME}-dev_${PACKAGE_VERSION}_${ARCHITECTURE}.deb") + set(CPACK_${TYPE}_DOCUMENTATION_FILE_NAME "${PACKAGE_NAME}-doc_${PACKAGE_VERSION}_${ARCHITECTURE}.deb") + + set(CPACK_DEBIAN_LIBRARY_PACKAGE_SHLIBDEPS ON) + + set(CPACK_${TYPE}_LIBRARY_PACKAGE_DEPENDS "python (>= 2.7.0)") + set(CPACK_${TYPE}_HEADERS_PACKAGE_DEPENDS "longbow (>= 1.0)") + set(CPACK_${TYPE}_DOCUMENTATION_PACKAGE_DEPENDS "") +elseif(RPM_PACKAGE) + set(TYPE "RPM") + set(GENERATOR "RPM") + + set(CPACK_${TYPE}_LIBRARY_PACKAGE_NAME "${PACKAGE_NAME}") + set(CPACK_${TYPE}_HEADERS_PACKAGE_NAME "${PACKAGE_NAME}-devel") + set(CPACK_${TYPE}_DOCUMENTATION_PACKAGE_NAME "${PACKAGE_NAME}-doc") + + set(CPACK_${TYPE}_LIBRARY_FILE_NAME "${PACKAGE_NAME}-${PACKAGE_VERSION}.${ARCHITECTURE}.rpm") + set(CPACK_${TYPE}_HEADERS_FILE_NAME "${PACKAGE_NAME}-devel-${PACKAGE_VERSION}.${ARCHITECTURE}.rpm") + set(CPACK_${TYPE}_DOCUMENTATION_FILE_NAME "${PACKAGE_NAME}-doc-${PACKAGE_VERSION}.${ARCHITECTURE}.rpm") + + set(CPACK_${TYPE}_LIBRARY_PACKAGE_AUTOREQ ON) + + set(CPACK_${TYPE}_LIBRARY_PACKAGE_REQUIRES "python >= 2.7.0") + set(CPACK_${TYPE}_HEADERS_PACKAGE_REQUIRES "longbow >= 1.0") + set(CPACK_${TYPE}_DOCUMENTATION_PACKAGE_REQUIRES "") + + set(CPACK_RPM_EXCLUDE_FROM_AUTO_FILELIST_ADDITION "/usr/etc" "/usr/lib/python2.7" "/usr/lib/python2.7/site-packages") +else() + return() +endif() - # Generate DEB / RPM packages - - option(DEB_PACKAGE "Create deb package" OFF) - option(RPM_PACKAGE "Create deb package" OFF) - - set(VENDOR "Cisco Systems" CACHE STRING "Vendor") - set(CONTACT "msardara@cisco.com" CACHE STRING "Contact") - set(DISTRIBUTION "xenial" CACHE STRING "Distribution") - set(ARCHITECTURE "amd64" CACHE STRING "Architecture") - set(PACKAGE_MAINTAINER "Mauro Sardara (msardara@cisco.com)" CACHE STRING "Maintainer") - string(TOLOWER ${CMAKE_PROJECT_NAME} PACKAGE_NAME) - set(CPACK_PACKAGING_INSTALL_PREFIX "/usr") - set(CPACK_PACKAGE_VENDOR ${VENDOR}) - set(CPACK_PACKAGE_CONTACT ${CONTACT}) - set(CPACK_COMPONENTS_ALL library headers documentation) - - # Get the version - execute_process(COMMAND bash ${CMAKE_SOURCE_DIR}/scripts/version - OUTPUT_VARIABLE PACKAGE_VERSION) - - if (PACKAGE_VERSION) - string(STRIP ${PACKAGE_VERSION} PACKAGE_VERSION) - else() - set(PACKAGE_VERSION 1.0) - endif() - - if(DEB_PACKAGE) - set(TYPE "DEBIAN") - set(GENERATOR "DEB") - - set(CPACK_${TYPE}_LIBRARY_PACKAGE_NAME "${PACKAGE_NAME}") - set(CPACK_${TYPE}_HEADERS_PACKAGE_NAME "${PACKAGE_NAME}-dev") - set(CPACK_${TYPE}_DOCUMENTATION_PACKAGE_NAME "${PACKAGE_NAME}-doc") - - set(CPACK_${TYPE}_LIBRARY_FILE_NAME "${PACKAGE_NAME}_${PACKAGE_VERSION}_${ARCHITECTURE}.deb") - set(CPACK_${TYPE}_HEADERS_FILE_NAME "${PACKAGE_NAME}-dev_${PACKAGE_VERSION}_${ARCHITECTURE}.deb") - set(CPACK_${TYPE}_DOCUMENTATION_FILE_NAME "${PACKAGE_NAME}-doc_${PACKAGE_VERSION}_${ARCHITECTURE}.deb") - - set(CPACK_DEBIAN_LIBRARY_PACKAGE_SHLIBDEPS ON) - - set(CPACK_${TYPE}_LIBRARY_PACKAGE_DEPENDS "python (>= 2.7.0)") - set(CPACK_${TYPE}_HEADERS_PACKAGE_DEPENDS "longbow (>= 1.0)") - set(CPACK_${TYPE}_DOCUMENTATION_PACKAGE_DEPENDS "") - elseif(RPM_PACKAGE) - set(TYPE "RPM") - set(GENERATOR "RPM") - - set(CPACK_${TYPE}_LIBRARY_PACKAGE_NAME "${PACKAGE_NAME}") - set(CPACK_${TYPE}_HEADERS_PACKAGE_NAME "${PACKAGE_NAME}-devel") - set(CPACK_${TYPE}_DOCUMENTATION_PACKAGE_NAME "${PACKAGE_NAME}-doc") - - set(CPACK_${TYPE}_LIBRARY_FILE_NAME "${PACKAGE_NAME}-${PACKAGE_VERSION}.${ARCHITECTURE}.rpm") - set(CPACK_${TYPE}_HEADERS_FILE_NAME "${PACKAGE_NAME}-devel-${PACKAGE_VERSION}.${ARCHITECTURE}.rpm") - set(CPACK_${TYPE}_DOCUMENTATION_FILE_NAME "${PACKAGE_NAME}-doc-${PACKAGE_VERSION}.${ARCHITECTURE}.rpm") - - set(CPACK_${TYPE}_LIBRARY_PACKAGE_AUTOREQ ON) - - set(CPACK_${TYPE}_LIBRARY_PACKAGE_REQUIRES "python >= 2.7.0") - set(CPACK_${TYPE}_HEADERS_PACKAGE_REQUIRES "longbow >= 1.0") - set(CPACK_${TYPE}_DOCUMENTATION_PACKAGE_REQUIRES "") - - set(CPACK_RPM_EXCLUDE_FROM_AUTO_FILELIST_ADDITION "/usr/etc" "/usr/lib/python2.7" "/usr/lib/python2.7/site-packages") - else() - return() - endif() - - set(CPACK_GENERATOR ${GENERATOR}) - set(CPACK_${GENERATOR}_COMPONENT_INSTALL ON) - set(CPACK_${TYPE}_PACKAGE_MAINTAINER ${PACKAGE_MAINTAINER}) - set(CPACK_${TYPE}_PACKAGE_NAME ${PACKAGE_NAME}) - set(CPACK_${TYPE}_PACKAGE_VERSION ${PACKAGE_VERSION}) - set(CPACK_${TYPE}_PACKAGE_ARCHITECTURE ${ARCHITECTURE}) - set(CPACK_${TYPE}_PACKAGE_RELEASE 1) - set(CPACK_${TYPE}_PACKAGE_VENDOR ${VENDOR}) - set(CPACK_${TYPE}_PACKAGE_DESCRIPTION "Runtime and testing framework for C applications.") - set(CPACK_${TYPE}_PACKAGE_HOMEPAGE "https://wiki.fd.io/view/Cframework") - - include(CPack) - -endif() \ No newline at end of file +set(CPACK_GENERATOR ${GENERATOR}) +set(CPACK_${GENERATOR}_COMPONENT_INSTALL ON) +set(CPACK_${TYPE}_PACKAGE_MAINTAINER ${PACKAGE_MAINTAINER}) +set(CPACK_${TYPE}_PACKAGE_NAME ${PACKAGE_NAME}) +set(CPACK_${TYPE}_PACKAGE_VERSION ${PACKAGE_VERSION}) +set(CPACK_${TYPE}_PACKAGE_ARCHITECTURE ${ARCHITECTURE}) +set(CPACK_${TYPE}_PACKAGE_RELEASE 1) +set(CPACK_${TYPE}_PACKAGE_VENDOR ${VENDOR}) +set(CPACK_${TYPE}_PACKAGE_DESCRIPTION "Runtime and testing framework for C applications.") +set(CPACK_${TYPE}_PACKAGE_HOMEPAGE "https://wiki.fd.io/view/Cframework") + +include(CPack) \ No newline at end of file diff --git a/longbow/src/LongBow/CMakeLists.txt b/longbow/src/LongBow/CMakeLists.txt index 27efc12c..f8054b8d 100644 --- a/longbow/src/LongBow/CMakeLists.txt +++ b/longbow/src/LongBow/CMakeLists.txt @@ -106,7 +106,7 @@ set(LIBLONGBOW_SOURCE_FILES longBow_SubProcess.c longBow_TestCase.c longBow_TestCaseClipBoard.c - longBow_TestCaseMetaData.c + longBow_TestCaseMetaData.c longBow_TestFixture.c longBow_TestFixtureConfig.c longBow_TestRunner.c @@ -115,50 +115,67 @@ set(LIBLONGBOW_SOURCE_FILES source_group(longbow FILES ${LIBLONGBOW_SOURCE_FILES}) -if("${CMAKE_CXX_COMPILER_ID}" STREQUAL "AppleClang") +if("${CMAKE_CXX_COMPILER_ID}" STREQUAL "AppleClang" OR COMPILE_FOR_IOS ) set(CMAKE_SHARED_LIBRARY_CREATE_C_FLAGS "${CMAKE_SHARED_LIBRARY_CREATE_C_FLAGS} -undefined dynamic_lookup") message( "-- Set \"-undefined dynamic_lookup\" for shared libraries") endif() -add_library(longbow-ansiterm STATIC ${LONGBOW_REPORT_ANSI_SOURCE_FILES} ${LONGBOW_REPORT_BASE_SOURCE_FILES}) -add_library(longbow-ansiterm.shared SHARED ${LONGBOW_REPORT_ANSI_SOURCE_FILES} ${LONGBOW_REPORT_BASE_SOURCE_FILES}) +if(COMPILE_FOR_IOS OR ANDROID_API) + add_library(longbow-ansiterm STATIC ${LONGBOW_REPORT_ANSI_SOURCE_FILES} ${LONGBOW_REPORT_BASE_SOURCE_FILES}) -set_target_properties(longbow-ansiterm.shared PROPERTIES - SOVERSION 1 - VERSION 1.0 - OUTPUT_NAME longbow-ansiterm) + add_library(longbow-textplain STATIC ${LONGBOW_REPORT_TEXT_SOURCE_FILES} ${LONGBOW_REPORT_BASE_SOURCE_FILES}) + add_library(longbow STATIC ${LIBLONGBOW_SOURCE_FILES}) -add_library(longbow-textplain STATIC ${LONGBOW_REPORT_TEXT_SOURCE_FILES} ${LONGBOW_REPORT_BASE_SOURCE_FILES}) -add_library(longbow-textplain.shared SHARED ${LONGBOW_REPORT_TEXT_SOURCE_FILES} ${LONGBOW_REPORT_BASE_SOURCE_FILES}) + set(longbowLibraries + longbow + longbow-ansiterm + longbow-textplain + ) -set_target_properties(longbow-textplain.shared PROPERTIES - SOVERSION 1 - VERSION 1.0 - OUTPUT_NAME longbow-textplain) + foreach(lib ${longbowLibraries}) + install(TARGETS ${lib} LIBRARY DESTINATION lib ARCHIVE DESTINATION lib) + endforeach() +else() + add_library(longbow-ansiterm STATIC ${LONGBOW_REPORT_ANSI_SOURCE_FILES} ${LONGBOW_REPORT_BASE_SOURCE_FILES}) + add_library(longbow-ansiterm.shared SHARED ${LONGBOW_REPORT_ANSI_SOURCE_FILES} ${LONGBOW_REPORT_BASE_SOURCE_FILES}) -add_library(longbow STATIC ${LIBLONGBOW_SOURCE_FILES}) -add_library(longbow.shared SHARED ${LIBLONGBOW_SOURCE_FILES}) + set_target_properties(longbow-ansiterm.shared PROPERTIES + SOVERSION 1 + VERSION 1.0 + OUTPUT_NAME longbow-ansiterm) -set_target_properties(longbow.shared PROPERTIES - SOVERSION 1 - VERSION 1.0 - OUTPUT_NAME longbow) + add_library(longbow-textplain STATIC ${LONGBOW_REPORT_TEXT_SOURCE_FILES} ${LONGBOW_REPORT_BASE_SOURCE_FILES}) + add_library(longbow-textplain.shared SHARED ${LONGBOW_REPORT_TEXT_SOURCE_FILES} ${LONGBOW_REPORT_BASE_SOURCE_FILES}) -add_executable(longbow-config ${LONGBOW_CONFIG_SOURCE_FILES}) + set_target_properties(longbow-textplain.shared PROPERTIES + SOVERSION 1 + VERSION 1.0 + OUTPUT_NAME longbow-textplain) + add_library(longbow STATIC ${LIBLONGBOW_SOURCE_FILES}) + add_library(longbow.shared SHARED ${LIBLONGBOW_SOURCE_FILES}) -set(longbowLibraries - longbow - longbow.shared - longbow-ansiterm - longbow-ansiterm.shared - longbow-textplain - longbow-textplain.shared - ) + set_target_properties(longbow.shared PROPERTIES + SOVERSION 1 + VERSION 1.0 + OUTPUT_NAME longbow) + + add_executable(longbow-config ${LONGBOW_CONFIG_SOURCE_FILES}) + + set(longbowLibraries + longbow + longbow.shared + longbow-ansiterm + longbow-ansiterm.shared + longbow-textplain + longbow-textplain.shared + ) -foreach(lib ${longbowLibraries}) - install(TARGETS ${lib} COMPONENT library LIBRARY DESTINATION lib ARCHIVE DESTINATION lib) -endforeach() + foreach(lib ${longbowLibraries}) + install(TARGETS ${lib} COMPONENT library LIBRARY DESTINATION lib ARCHIVE DESTINATION lib) + endforeach() + +endif() install(FILES ${LIBLONGBOW_HEADER_FILES} DESTINATION include/LongBow COMPONENT headers) install(FILES ${LONGBOW_REPORT_HEADER_FILES} DESTINATION include/LongBow/Reporting COMPONENT headers) @@ -166,6 +183,9 @@ install(FILES ${LONGBOW_REPORT_HEADER_FILES} DESTINATION include/LongBow/Reporti if(ANDROID_API) message("############ Detected cross compile for ${CMAKE_SYSTEM_NAME}") message("############ This build will not include doxygen, tools, or tests") +elseif(COMPILE_FOR_IOS) + message("############ Detected cross compile for ${CMAKE_SYSTEM_NAME}") + message("############ This build will not include doxygen, tools, or tests") else() add_subdirectory(test) endif() -- cgit 1.2.3-korg