From dc9aafa7a1cd545ac63a2a1c68ba7d6b23db0b5d Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Math=C3=A4us=20Mendel?= Date: Sun, 16 Dec 2012 00:40:40 -0200 Subject: [PATCH] Moved contributed CMake modules to "cmake" folder By convention CMake project files are placed on a folder called "cmake" and then called from the build system by appending the CMAKE_MODULE_PATH variable --- CMakeLists.txt | 11 +- Data/CMakeLists.txt | 2 +- {contrib/cmake => cmake}/FindAPR.cmake | 0 {contrib/cmake => cmake}/FindApache2.cmake | 0 {contrib/cmake => cmake}/FindMySQL.cmake | 0 {contrib/cmake => cmake}/FindODBC.cmake | 0 {contrib/cmake => cmake}/FindPostgreSQL.cmake | 0 {contrib/cmake => cmake}/PocoConfig.cmake | 0 {contrib/cmake => cmake}/README | 0 .../cmake => cmake}/cmake_uninstall.cmake.in | 0 contrib/cmake/CMakeLists.txt | 121 ------------------ 11 files changed, 8 insertions(+), 126 deletions(-) rename {contrib/cmake => cmake}/FindAPR.cmake (100%) rename {contrib/cmake => cmake}/FindApache2.cmake (100%) rename {contrib/cmake => cmake}/FindMySQL.cmake (100%) rename {contrib/cmake => cmake}/FindODBC.cmake (100%) rename {contrib/cmake => cmake}/FindPostgreSQL.cmake (100%) rename {contrib/cmake => cmake}/PocoConfig.cmake (100%) rename {contrib/cmake => cmake}/README (100%) rename {contrib/cmake => cmake}/cmake_uninstall.cmake.in (100%) delete mode 100644 contrib/cmake/CMakeLists.txt diff --git a/CMakeLists.txt b/CMakeLists.txt index 1f1fdad1c..a957f22eb 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -23,6 +23,9 @@ SET(PROJECT_VERSION ${COMPLETE_VERSION}) set(CMAKE_LIBRARY_OUTPUT_DIRECTORY ${CMAKE_BINARY_DIR}/lib) set(CMAKE_ARCHIVE_OUTPUT_DIRECTORY ${CMAKE_BINARY_DIR}/lib) +# Append our module directory to CMake +set(CMAKE_MODULE_PATH ${CMAKE_MODULE_PATH} ${CMAKE_CURRENT_SOURCE_DIR}/cmake) + ################################################################################# # Setup C/C++ compiler options ################################################################################# @@ -98,9 +101,9 @@ include(FindCygwin) include(FindOpenSSL) #include(CMakeDetermineCompilerId) -include(contrib/cmake/FindMySQL.cmake) -include(contrib/cmake/FindAPR.cmake) -include(contrib/cmake/FindApache2.cmake) +include(FindMySQL) +include(FindAPR) +include(FindApache2) # OS Detection if(CMAKE_SYSTEM MATCHES "Windows") @@ -179,7 +182,7 @@ endif(APRUTIL_FOUND AND APACHE_FOUND) ############################################################# # Uninstall stuff see: http://www.vtk.org/Wiki/CMake_FAQ CONFIGURE_FILE( - "${CMAKE_CURRENT_SOURCE_DIR}/contrib/cmake/cmake_uninstall.cmake.in" + "${CMAKE_MODULE_PATH}/cmake_uninstall.cmake.in" "${CMAKE_CURRENT_BINARY_DIR}/cmake_uninstall.cmake" IMMEDIATE @ONLY) diff --git a/Data/CMakeLists.txt b/Data/CMakeLists.txt index fdc952e90..5d06678f6 100644 --- a/Data/CMakeLists.txt +++ b/Data/CMakeLists.txt @@ -31,7 +31,7 @@ if(MYSQL_FOUND) add_subdirectory( MySQL ) endif(MYSQL_FOUND) -include(../contrib/cmake/FindODBC.cmake) +include(FindODBC) if(CMAKE_SYSTEM MATCHES "Windows") message(STATUS "Windows native ODBC Support Enabled") diff --git a/contrib/cmake/FindAPR.cmake b/cmake/FindAPR.cmake similarity index 100% rename from contrib/cmake/FindAPR.cmake rename to cmake/FindAPR.cmake diff --git a/contrib/cmake/FindApache2.cmake b/cmake/FindApache2.cmake similarity index 100% rename from contrib/cmake/FindApache2.cmake rename to cmake/FindApache2.cmake diff --git a/contrib/cmake/FindMySQL.cmake b/cmake/FindMySQL.cmake similarity index 100% rename from contrib/cmake/FindMySQL.cmake rename to cmake/FindMySQL.cmake diff --git a/contrib/cmake/FindODBC.cmake b/cmake/FindODBC.cmake similarity index 100% rename from contrib/cmake/FindODBC.cmake rename to cmake/FindODBC.cmake diff --git a/contrib/cmake/FindPostgreSQL.cmake b/cmake/FindPostgreSQL.cmake similarity index 100% rename from contrib/cmake/FindPostgreSQL.cmake rename to cmake/FindPostgreSQL.cmake diff --git a/contrib/cmake/PocoConfig.cmake b/cmake/PocoConfig.cmake similarity index 100% rename from contrib/cmake/PocoConfig.cmake rename to cmake/PocoConfig.cmake diff --git a/contrib/cmake/README b/cmake/README similarity index 100% rename from contrib/cmake/README rename to cmake/README diff --git a/contrib/cmake/cmake_uninstall.cmake.in b/cmake/cmake_uninstall.cmake.in similarity index 100% rename from contrib/cmake/cmake_uninstall.cmake.in rename to cmake/cmake_uninstall.cmake.in diff --git a/contrib/cmake/CMakeLists.txt b/contrib/cmake/CMakeLists.txt deleted file mode 100644 index 5776bb759..000000000 --- a/contrib/cmake/CMakeLists.txt +++ /dev/null @@ -1,121 +0,0 @@ -PROJECT (FTPTest) - -SET (EXECUTABLE_OUTPUT_PATH ${PROJECT_BINARY_DIR}/bin CACHE PATH - "Single output directory for building all executables.") - -SET( TARGET_BASE_NAME "${PROJECT_NAME}" ) -SET( LIB_NAME "${TARGET_BASE_NAME}Lib" ) - -#----------------------------------------------------------------------------- -# Let's use the highest warning level. -#----------------------------------------------------------------------------- -IF(CMAKE_BUILD_TOOL MATCHES "(msdev|devenv|nmake)") - # Use the highest warning level for visual studio. - IF(CMAKE_CXX_FLAGS MATCHES "/W[0-4]") - STRING(REGEX REPLACE "/W[0-4]" "/W4" CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS}") - ELSE(CMAKE_CXX_FLAGS MATCHES "/W[0-4]") - SET(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} /W4") - ENDIF(CMAKE_CXX_FLAGS MATCHES "/W[0-4]") - IF(CMAKE_C_FLAGS MATCHES "/W[0-4]") - STRING(REGEX REPLACE "/W[0-4]" "/W4" CMAKE_C_FLAGS "${CMAKE_C_FLAGS}") - ELSE(CMAKE_C_FLAGS MATCHES "/W[0-4]") - SET(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} /W4") - ENDIF(CMAKE_C_FLAGS MATCHES "/W[0-4]") - # Disable deprecation warnings for standard C functions in VS2005 and later - IF(CMAKE_COMPILER_2005) - ADD_DEFINITIONS(-D_CRT_SECURE_NO_DEPRECATE -D_CRT_NONSTDC_NO_DEPRECATE) - ENDIF(CMAKE_COMPILER_2005) -ENDIF(CMAKE_BUILD_TOOL MATCHES "(msdev|devenv|nmake)") -IF(CMAKE_BUILD_TOOL MATCHES "make") - IF(NOT CMAKE_CXX_FLAGS MATCHES "-Wall") - SET(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -Wall") - ENDIF(NOT CMAKE_CXX_FLAGS MATCHES "-Wall") - IF(NOT CMAKE_C_FLAGS MATCHES "-Wall") - SET(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -Wall") - ENDIF(NOT CMAKE_C_FLAGS MATCHES "-Wall") -ENDIF(CMAKE_BUILD_TOOL MATCHES "make") - -SET(Poco_DIR ${PROJECT_SOURCE_DIR}) -FIND_PACKAGE(Poco REQUIRED) -IF(${Poco_FOUND}) - INCLUDE_DIRECTORIES(${Poco_INCLUDE_DIRS}) - LINK_DIRECTORIES(${Poco_LIBRARY_DIRS}) -ENDIF(WIN32) -ENDIF(${Poco_FOUND}) - -#----------------------------------------------------------------------------- -SET( EXE_NAME "${TARGET_BASE_NAME}" ) -# Add any source files here. -SET( EXE_SRCS - "My File.cpp" -) -# Add any include files here. -SET( EXE_INCS - "My File.h" -) - -#----------------------------------------------------------------------------- -# The executable. -ADD_EXECUTABLE(${EXE_NAME} ${EXE_SRCS} ${EXE_INCS}) - -TARGET_LINK_LIBRARIES ( ${EXE_NAME} - "optimized" CppUnit - "debug" CppUnitd - "optimized" PocoFoundation - "debug" PocoFoundationd - "optimized" PocoNet - "debug" PocoNetd - "optimized" PocoUtil - "debug" PocoUtild - "optimized" PocoXML - "debug" PocoXMLd -) - -# Copy the DLLS to where the executable is. -# Only do this if you haven't set your path to the Poco DLLs. -IF(WIN32) - SET ( DLL_FILES_DEBUG - ${Poco_BINARY_DIRS}/CppUnitd.dll - ${Poco_BINARY_DIRS}/PocoFoundationd.dll - ${Poco_BINARY_DIRS}/PocoNetd.dll - ${Poco_BINARY_DIRS}/PocoUtild.dll - ${Poco_BINARY_DIRS}/PocoXMLd.dll - ) - - SET ( DLL_FILES_RELEASE - ${Poco_BINARY_DIRS}/CppUnit.dll - ${Poco_BINARY_DIRS}/PocoFoundation.dll - ${Poco_BINARY_DIRS}/PocoNet.dll - ${Poco_BINARY_DIRS}/PocoUtil.dll - ${Poco_BINARY_DIRS}/PocoXML.dll - ) - - # Copy these files to the build tree. - ADD_CUSTOM_TARGET(CopyDll ALL echo "Copying dlls ...") - - FOREACH(file ${DLL_FILES_DEBUG}) - GET_FILENAME_COMPONENT(fn ${file} NAME) - SET(tgt ${EXECUTABLE_OUTPUT_PATH}/Debug/${fn}) - SET(src ${file}) - ADD_CUSTOM_COMMAND( - TARGET CopyDll - COMMAND ${CMAKE_COMMAND} - ARGS -E copy_if_different ${src} ${tgt} - COMMENT "Source copy of dlls" - ) - ENDFOREACH(file) - - FOREACH(file ${DLL_FILES_RELEASE}) - GET_FILENAME_COMPONENT(fn ${file} NAME) - SET(tgt ${EXECUTABLE_OUTPUT_PATH}/Release/${fn}) - SET(src ${file}) - ADD_CUSTOM_COMMAND( - TARGET CopyDll - COMMAND ${CMAKE_COMMAND} - ARGS -E copy_if_different ${src} ${tgt} - COMMENT "Source copy of dlls" - ) - ENDFOREACH(file) - -ENDIF(WIN32) -