From 9aca623f28075281593cd9322c23d919c39c179f Mon Sep 17 00:00:00 2001 From: philippewarren <55722645+philippewarren@users.noreply.github.com> Date: Thu, 7 Apr 2022 09:35:14 -0400 Subject: [PATCH] Removed unused subdir cmake, and add option to disable bin and lib directories (#264) --- CMakeLists.txt | 15 +++++++++------ include/CMakeLists.txt | 8 -------- 2 files changed, 9 insertions(+), 14 deletions(-) delete mode 100644 include/CMakeLists.txt diff --git a/CMakeLists.txt b/CMakeLists.txt index ed587d6..cab9b71 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -6,6 +6,7 @@ if(COMMAND cmake_policy) endif(COMMAND cmake_policy) option(ODAS_INSTALL_EXECUTABLES "Install the odaslive and odasserver executables along with the odas library" OFF) +option(ODAS_FORCE_BIN_AND_LIB_DIRS "Force the installation of the odas library and executables in the bin and lib directories" ON) find_package(PkgConfig REQUIRED) pkg_check_modules(PC_FFTW3 REQUIRED fftw3f) @@ -20,14 +21,14 @@ if(NOT CMAKE_BUILD_TYPE) SET(CMAKE_BUILD_TYPE "Release") endif(NOT CMAKE_BUILD_TYPE) -set(CMAKE_RUNTIME_OUTPUT_DIRECTORY "${PROJECT_BINARY_DIR}/bin") -set(CMAKE_LIBRARY_OUTPUT_DIRECTORY "${PROJECT_BINARY_DIR}/lib") +if(ODAS_FORCE_BIN_AND_LIB_DIRS) + set(CMAKE_RUNTIME_OUTPUT_DIRECTORY "${PROJECT_BINARY_DIR}/bin") + set(CMAKE_LIBRARY_OUTPUT_DIRECTORY "${PROJECT_BINARY_DIR}/lib") +endif() #Add base directory for includes (global) include_directories(include/odas) -add_subdirectory(include) - set(SRC src/general/format.c @@ -236,5 +237,7 @@ if(ODAS_INSTALL_EXECUTABLES) install(TARGETS odasserver DESTINATION bin) endif() -unset(CMAKE_RUNTIME_OUTPUT_DIRECTORY) -unset(CMAKE_LIBRARY_OUTPUT_DIRECTORY) +if(ODAS_FORCE_BIN_AND_LIB_DIRS) + unset(CMAKE_RUNTIME_OUTPUT_DIRECTORY) + unset(CMAKE_LIBRARY_OUTPUT_DIRECTORY) +endif() diff --git a/include/CMakeLists.txt b/include/CMakeLists.txt deleted file mode 100644 index 47c13fb..0000000 --- a/include/CMakeLists.txt +++ /dev/null @@ -1,8 +0,0 @@ -#Scan for headers and add them for installation -file(GLOB_RECURSE ODAS_ALL_INCLUDES RELATIVE ${CMAKE_CURRENT_SOURCE_DIR} *.h) - -message(STATUS "HEADER FILES: ${ODAS_ALL_INCLUDES}") - -add_custom_target(odas_headers SOURCES ${ODAS_ALL_INCLUDES}) - -install(FILES ${ODAS_ALL_INCLUDES} DESTINATION include) -- 2.34.1