Removed unused subdir cmake, and add option to disable bin and lib directories (...
authorphilippewarren <55722645+philippewarren@users.noreply.github.com>
Thu, 7 Apr 2022 13:35:14 +0000 (09:35 -0400)
committerGitHub <noreply@github.com>
Thu, 7 Apr 2022 13:35:14 +0000 (09:35 -0400)
CMakeLists.txt
include/CMakeLists.txt [deleted file]

index ed587d6af45c31fe91fd2536471813ee58c4c572..cab9b71ccf6258cb5fee21f76991ea8e853cbf59 100644 (file)
@@ -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 (file)
index 47c13fb..0000000
+++ /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)