Commit b2522ba5 authored by Philip Trettner's avatar Philip Trettner

Fixed some CMake problems when HEADER or SOURCE_FILES were polluted

parent 4ff41435
Pipeline #1802 passed with stage
......@@ -37,15 +37,19 @@ SET_PROPERTY(CACHE CMAKE_BUILD_TYPE PROPERTY STRINGS Release Debug Deploy)
# Project Files
################################################################################
#
# if ACGL should not get compiled as a library, just include the following file
# into the projects CMakeList.txt
#
SET(ACGL_SKIP_INCLUDE_AND_DEF TRUE) # don't use include_directories and add_definitions for modern cmake
INCLUDE(${CMAKE_CURRENT_SOURCE_DIR}/CMakeListsStaticInclude.txt)
# Find all used files of certain file-types
FILE(GLOB_RECURSE SOURCE_FILES_C "src/*.c")
FILE(GLOB_RECURSE SOURCE_FILES_CC "src/*.cc")
FILE(GLOB_RECURSE SOURCE_FILES_CPP "src/*.cpp")
FILE(GLOB_RECURSE HEADER_FILES_H "include/*.h")
FILE(GLOB_RECURSE HEADER_FILES_HH "include/*.hh")
FILE(GLOB_RECURSE HEADER_FILES_HPP "include/*.hpp")
SET(ACGL_HEADER_FILES ${HEADER_FILES_H} ${HEADER_FILES_HH} ${HEADER_FILES_HPP})
SET(ACGL_SOURCE_FILES ${SOURCE_FILES_C} ${SOURCE_FILES_CC} ${SOURCE_FILES_CPP})
# Define the Project, add all required sources and dependencies to it
ADD_LIBRARY(ACGL ${ACGL_LINK_TYPE} ${SOURCE_FILES} ${HEADER_FILES})
ADD_LIBRARY(ACGL ${ACGL_LINK_TYPE} ${ACGL_SOURCE_FILES} ${ACGL_HEADER_FILES})
# static linking for MSVC
IF(ACGL_STATIC_RUNTIME_ENV)
......
......@@ -25,7 +25,7 @@ MACRO (RECURSE_GROUPS dirname)
ENDFOREACH()
ENDMACRO (RECURSE_GROUPS)
SET(ACGL_BASE_DIR "${CMAKE_CURRENT_LIST_DIR}")
SET(ACGL_BASE_DIR "${CMAKE_CURRENT_SOURCE_DIR}")
# Find all used files of certain file-types
FILE(GLOB_RECURSE SOURCE_FILES_C "${ACGL_BASE_DIR}/src/*.c")
FILE(GLOB_RECURSE SOURCE_FILES_CC "${ACGL_BASE_DIR}/src/*.cc")
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment