diff --git a/CMakeLists.txt b/CMakeLists.txt index 55ee8765a8..07ba903ba0 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -32,7 +32,7 @@ include(ExternalProject) include(SetCrossPlatform) # convenience function for querying presently defined cmake variables -include(QueryCMakeVariables) +include(QueryCMakeVariables) # debbugging # GNU standard install locations include(GNUInstallDirs) @@ -146,9 +146,6 @@ if (WITH_ADDRESS_SANITIZER) set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -fsanitize=address") endif() -################################################### -# Set some paths used in the build process -# #Setup so that roadrunner is always built as a dll and linked statically with 'as much as possible' option(BUILD_SHARED_LIBS "Turns on building shared libraries in addition to static libraries which are always build" ON) @@ -171,9 +168,7 @@ else () message(STATUS "not building legacy C backend") endif (BUILD_LEGACY_C) -##################################################### -# Apply project/compiler settings -# + # Set C++14 flags set(CMAKE_CXX_STANDARD ${CXX_STANDARD}) @@ -265,6 +260,9 @@ find_package(PocoNet CONFIG REQUIRED) find_package(Sundials CONFIG REQUIRED) find_package(LLVM REQUIRED) +# install dependencies so clients can use roadrunner from c++/cmake +install(DIRECTORY ${RR_DEPENDENCIES_INSTALL_PREFIX} DESTINATION ${CMAKE_INSTALL_PREFIX}) + ##todo build on mingw to test requirements before uncommenting #if (${MINGW}) @@ -286,17 +284,38 @@ find_package(LLVM REQUIRED) ########################################################## -# Add roadrunner source directories to the build +# Building # # We always have to build the roadrunner core, everything depends on this add_subdirectory(source) + +########################################################## +# Tests +# + add_subdirectory(tests) + +########################################################## +# API's +# + add_subdirectory(wrappers) +########################################################## +# API's +# + +add_subdirectory(docs) + + +########################################################## +# Packaging +# + if (${BUILD_PACKAGING}) #todo raise question of deleting the "installer" folder (cw) # it doesn't look that useful and we now have the contents of @@ -305,147 +324,13 @@ if (${BUILD_PACKAGING}) endif () -# print out configuration summary -ConfigurationSummary() - -# note: end of cmake script. The below -# is kept only temporarily while the new -# build system matures. -# Still need to add the tests and docs however. - -########################################################### -## Build tests -# -#if (BUILD_TESTS AND BUILD_TEST_TOOLS) -# -# set(GOOGLETEST_SOURCE_DIR third_party/googletest) -# set(GOOGLETEST_INCLUDE_DIR ${GOOGLETEST_SOURCE_DIR}/googletest) -# set(GOOGLEMOCK_INCLUDE_DIR ${GOOGLETEST_SOURCE_DIR}/googlemock) -# -# add_subdirectory(${GOOGLETEST_SOURCE_DIR}) -# -# add_subdirectory(tests) -# -# # QueryCMakeVariables() -# -# # I really have no idea what this code is doing. (cw) -# # This code comes with no comments, so i'll add some as I'm -# # trying to figure out what its doing -# message(STATUS "building tests") -# -# # Collect a list of all files inside "testing" folder. -# # This includes CMakeLists.txt for some reason. -# file(GLOB TEST_FILES "testing/*") -# -# MESSAGE(STATUS "TEST_FILES ${TEST_FILES}") -# -# # Collect the set of Python test files. -# file(GLOB PYTHON_TEST_FILES "wrappers/Python/roadrunner/testing/*") -# -# MESSAGE(STATUS "PYTHON_TEST_FILES ${PYTHON_TEST_FILES}") -# -# # and combine the two list of test files -# list(APPEND TEST_FILES ${PYTHON_TEST_FILES}) -# -# # Collect all python and xml test data -# file(GLOB PYTHON_TEST_DATA "${CMAKE_CURRENT_SOURCE_DIR}/testing/*.rrtest") -# -# file(GLOB TEST_DATA_XML "${CMAKE_CURRENT_SOURCE_DIR}/testing/*.xml") -# -# # Oh, I think I see what has happened here. -# # This code makes a copy of each test fle, both python and otherwise -# foreach (f ${TEST_FILES}) -# if (NOT IS_DIRECTORY ${f}) -# get_filename_component(FILE_NAME ${f} NAME) -# # message(STATUS ${FILE_NAME}) -# # This command copies into the main testing directory under project root. -# # Dont know why though. -# # Could be that somebody just committed these files and they havent been deleted. -# configure_file(${f} testing/${FILE_NAME} COPYONLY) -# -# # Uncertain why these have been copied here. Presumably its only the Python files -# # That need to go into a site packages directory, though still no idea -# # Why a site packages directory is needed. Also, I still havent found this -# configure_file(${f} lib/site-packages/roadrunner/testing/${FILE_NAME} COPYONLY) -# endif () -# endforeach () -# -# foreach (f ${PYTHON_TEST_DATA}) -# if (NOT IS_DIRECTORY ${f}) -# get_filename_component(FILE_NAME ${f} NAME) -# configure_file(${f} lib/site-packages/roadrunner/testing/test_data/${FILE_NAME} COPYONLY) -# endif () -# endforeach () -# -# foreach (f ${TEST_DATA_XML}) -# if (NOT IS_DIRECTORY ${f}) -# get_filename_component(FILE_NAME ${f} NAME) -# configure_file(${f} lib/site-packages/roadrunner/testing/test_data/${FILE_NAME} COPYONLY) -# endif () -# endforeach () -# -# # I don't understand. The testing directory doesn't build anything??? -# add_subdirectory(testing) -# add_subdirectory(autotest) -# add_subdirectory(source/testing) -# add_subdirectory(source/llvm_testing) -#else () -# message(STATUS "NOT building tests") -#endif () -# -## -#################################################### -### Build wrappers etc -## -# -####################################################### -## Note (Ciaran welsh) -## -## Some work has been done on the wrappers and tests, but not much. -## They will need some work to get them to where we want. -## For now I leave this commented out as I focus on getting roadrunner -## and roadrunner-static targets built. -## -# -#if (INSTALL_CXX_API) -# if (INSTALL_APPS) -# add_subdirectory(apps) -# endif () +########################################################## +# Configuration summary # -# if (INSTALL_EXAMPLES) -# add_subdirectory(examples) -# endif () -#endif (INSTALL_CXX_API) -#add_subdirectory(wrappers) -# -## print out the configuration summary -#ConfigurationSummary() -## -#### make or copy installers into root directory -###add_subdirectory(installer) -### -####=== ThirdParties -###if(${BORLAND}) -### set(CG_RUNTIMES cc32110MT.dll) -### foreach(runtime ${CG_RUNTIMES}) -### install (FILES -### ${THIRD_PARTY_INSTALL_FOLDER}/cg/xe/${runtime} -### DESTINATION bin -### COMPONENT rr_core) -### endforeach() -###endif() -## -#configure_file(VERSION.txt.in VERSION.txt @ONLY) -# -#install( -# FILES -# NOTICE.txt -# ${CMAKE_CURRENT_BINARY_DIR}/VERSION.txt -# NEWS.txt -# DESTINATION . -#) +# print out configuration summary +ConfigurationSummary() diff --git a/packaging/CMakeLists.txt b/packaging/CMakeLists.txt index df8b1c2096..ba980147ad 100644 --- a/packaging/CMakeLists.txt +++ b/packaging/CMakeLists.txt @@ -69,6 +69,7 @@ else () WORKING_DIRECTORY ${CMAKE_BINARY_DIR} VERBATIM ) + add_custom_target( packaging-tar COMMENT "Create a tarball binary distribution" @@ -76,6 +77,7 @@ else () WORKING_DIRECTORY ${CMAKE_BINARY_DIR} VERBATIM ) + add_dependencies( packaging packaging-deb packaging-tar )