Skip to content
Snippets Groups Projects
Commit 9d5f7040 authored by Lars Bilke's avatar Lars Bilke
Browse files

Some macros added.

parent 9396770d
No related branches found
No related tags found
No related merge requests found
# Source files
SET ( Base_Files
binarySearch.h
Configure.h.in
CPUTimeTimer.h
DateTools.h
FileFinder.h
FileTools.h
printList.h
quicksort.h
RunTimeTimer.h
StringTools.h
swap.h
TimeMeasurementBase.h
uniqueListInsert.h
wait.h
binarySearch.cpp
DateTools.cpp
CPUTimeTimer.cpp
RunTimeTimer.cpp
StringTools.cpp
)
SOURCE_GROUP( Base FILES ${Base_Files})
GET_SOURCE_FILES(SOURCES)
# Create the library
ADD_LIBRARY( Base STATIC ${Base_Files})
ADD_LIBRARY( Base STATIC ${SOURCES})
SET_TARGET_PROPERTIES(Base PROPERTIES LINKER_LANGUAGE CXX)
......
......@@ -9,6 +9,7 @@ cmake_minimum_required(VERSION 2.6)
project( OGS-6 )
### CMake includes ###
INCLUDE(scripts/cmake/Functions.cmake)
INCLUDE(scripts/cmake/CMakeSetup.cmake)
INCLUDE(scripts/cmake/CompilerSetup.cmake)
INCLUDE(scripts/cmake/Find.cmake)
......
# Returns the current subdirectory in the sources directory.
MACRO(GET_CURRENT_SOURCE_SUBDIRECTORY CURRENT_SOURCE_SUBDIRECTORY)
STRING(REGEX REPLACE ".*/([^/]*)" "\\1" REGEX_RESULT "${CMAKE_CURRENT_SOURCE_DIR}" )
SET(${CURRENT_SOURCE_SUBDIRECTORY} ${REGEX_RESULT})
ENDMACRO()
# Returns a list of source files (*.h and *.cpp) in SOURCE_FILES and creates a Visual
# Studio folder. A (relative) directory can be passed as second parameter (optional).
MACRO(GET_SOURCE_FILES SOURCE_FILES)
IF(ARGC EQUAL 2)
SET(DIR "${arg2}/")
ELSE()
SET(DIR "")
ENDIF()
# Get all files in the directory
FILE(GLOB GET_SOURCE_FILES_HEADERS ${DIR}*.h)
FILE(GLOB GET_SOURCE_FILES_SOURCES ${DIR}*.cpp)
SET(${SOURCE_FILES} ${GET_SOURCE_FILES_HEADERS} ${GET_SOURCE_FILES_SOURCES})
GET_CURRENT_SOURCE_SUBDIRECTORY(DIRECTORY)
MESSAGE("Curr: ${DIRECTORY}")
SOURCE_GROUP( ${DIRECTORY} FILES ${SOURCE_FILES})
ENDMACRO()
\ No newline at end of file
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment