Skip to content

Commit

Permalink
rebase source structure
Browse files Browse the repository at this point in the history
  • Loading branch information
mmertama committed May 11, 2024
1 parent dc55fee commit b6a91d2
Show file tree
Hide file tree
Showing 21 changed files with 53 additions and 25 deletions.
53 changes: 32 additions & 21 deletions gempyrelib/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -146,7 +146,6 @@ set(JSON_DIR "${srcDirVar}/include" PARENT_SCOPE)
#set_property(TARGET libjson PROPERTY json_dir "${srcDirVar}/include")

if(HAS_WEB_SOCKETS)

if(USE_LIBWEBSOCKETS)
include(cmake/libwebsockets.cmake)
else()
Expand All @@ -155,9 +154,9 @@ if(HAS_WEB_SOCKETS)
endif()

if(CLIENT_DIALOGS)
set(DIALOG_SRC src/ui_client.cpp)
set(DIALOG_SRC src/ui/ui_client.cpp)
else()
set(DIALOG_SRC src/ui_pfd.cpp)
set(DIALOG_SRC src/ui/ui_pfd.cpp)
message("skip libpfd version, use latest")
externalproject_add(libpfd
GIT_REPOSITORY https://github.com/samhocevar/portable-file-dialogs.git
Expand Down Expand Up @@ -235,29 +234,39 @@ set(INCLUDES
set(PUBLIC_HEADERS
include/gempyre_utils.h
include/gempyre_bitmap.h
)
)

set(INCLUDE_DIRECTORIES
src
)

if(NOT EMSCRIPTEN)

set(INCLUDE_DIRECTORIES
${INCLUDE_DIRECTORIES}
src/server
src/ui)

set(PUBLIC_HEADERS
${PUBLIC_HEADERS}
include/gempyre.h
include/gempyre_graphics.h
include/gempyre_client.h
)
set(GEMPYRE_SRC
src/semaphore.h
src/gempyre_internal.h
src/gempyre_internal.cpp
src/core.h
src/core.cpp
src/server.h
src/timer.h
src/timer.cpp
src/eventqueue.h
src/server.cpp
src/timequeue.h
src/graphics.cpp
src/element.cpp
src/server/semaphore.h
src/server/gempyre_internal.h
src/server/gempyre_internal.cpp
src/server/core.h
src/server/core.cpp
src/server/server.h
src/server/timer.h
src/server/timer.cpp
src/server/eventqueue.h
src/server/server.cpp
src/server/timequeue.h
src/server/graphics.cpp
src/server/element.cpp
${DIALOG_SRC}
${GEMPYRE_WS_SOURCES}
)
Expand All @@ -284,11 +293,14 @@ set(GEMPYRE_SRC


if(ANDROID)
set(GEMPYRE_SRC ${GEMPYRE_SRC} src/android.cpp)
set(GEMPYRE_SRC ${GEMPYRE_SRC} src/android/android.cpp)
endif()


if(COMPILE_SOCKETS_IN)
if(EMSCIPTEN)
message(FATAL_ERROR "Sockets are not supported")
endif()
FILE(GLOB_RECURSE SOCKETS_SRC "${SOCKETS_SOURCES}/src/*.c") # its using plain Makefile so just add files IS easier
FILE(GLOB_RECURSE SOCKETS_HRD "${SOCKETS_SOURCES}/src/*.h") # its using plain Makefile so just add files IS easier
if(MSVC)
Expand Down Expand Up @@ -463,13 +475,12 @@ message("SYSTEM_INCLUDES: ${SYSTEM_INCLUDES}")

target_include_directories( ${PROJECT_NAME}
PUBLIC include
PRIVATE src
#PRIVATE SYSTEM INTERFACE "$<BUILD_INTERFACE:${SYSTEM_INCLUDES_LIST}>"
PRIVATE ${INCLUDE_DIRECTORIES}
)

include_directories(SYSTEM
${SYSTEM_INCLUDES}
)
)

set_target_properties(${PROJECT_NAME} PROPERTIES DEBUG_POSTFIX ${CMAKE_DEBUG_POSTFIX})
set_target_properties(${PROJECT_NAME} PROPERTIES MINSIZEREL_POSTFIX ${CMAKE_MINSIZEREL_POSTFIX})
Expand Down
12 changes: 10 additions & 2 deletions gempyrelib/cmake/config.cmake.in
Original file line number Diff line number Diff line change
Expand Up @@ -39,9 +39,17 @@ endif()


# Since msvc and mingw libraries are located in the same folder we have to be explicit with naming.
find_library(LIB_NAME_DEBUG NAMES ${CMAKE_STATIC_LIBRARY_PREFIX}gempyred${CMAKE_STATIC_LIBRARY_SUFFIX} PATHS "@LIBRARY_FULL_DIR@" ${GEMPYRE_PATH} NO_DEFAULT_PATH REQUIRED)
find_library(LIB_NAME_DEBUG NAMES ${CMAKE_STATIC_LIBRARY_PREFIX}gempyred${CMAKE_STATIC_LIBRARY_SUFFIX} PATHS "@LIBRARY_FULL_DIR@" ${GEMPYRE_PATH} NO_DEFAULT_PATH)
if(NOT ${LIB_NAME_DEBUG})
message(WARNING "Cannot find debug libraries, (you may need to run build again) abort config")
return()
endif()
message("Found debug libraries ${gempyre_LIBRARIES}")
find_library(LIB_NAME NAMES ${CMAKE_STATIC_LIBRARY_PREFIX}gempyre${CMAKE_STATIC_LIBRARY_SUFFIX} PATHS "@LIBRARY_FULL_DIR@" ${GEMPYRE_PATH} NO_DEFAULT_PATH REQUIRED)
find_library(LIB_NAME NAMES ${CMAKE_STATIC_LIBRARY_PREFIX}gempyre${CMAKE_STATIC_LIBRARY_SUFFIX} PATHS "@LIBRARY_FULL_DIR@" ${GEMPYRE_PATH} NO_DEFAULT_PATH)
if(NOT ${LIB_NAME})
message(WARNING "Cannot find release libraries, (you may need to run build again) abort config")
return()
endif()
message("Found release libraries ${gempyre_LIBRARIES}")

find_library(LIB_NAME_RELWITHDEBINFO NAMES ${CMAKE_STATIC_LIBRARY_PREFIX}gempyrerd${CMAKE_STATIC_LIBRARY_SUFFIX} PATHS "@LIBRARY_FULL_DIR@" ${GEMPYRE_PATH} NO_DEFAULT_PATH)
Expand Down
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
10 changes: 9 additions & 1 deletion scripts/gempyre.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -27,9 +27,17 @@ function (gempyre_add_resources)
find_file(GEN_RESOURCE
genStringResource.py
PATHS "${GEMPYRE_FUNCTION_DIR}" "${CMAKE_SOURCE_DIR}/scripts" "${CMAKE_CURRENT_LIST_DIR}"
REQUIRED
)

if(NOT ${GEN_RESOURCE})
set(CMAKE_FIND_ROOT_PATH "/") # EMSCIPTEN HACK
find_file(GEN_RESOURCE
genStringResource.py
PATHS "${GEMPYRE_FUNCTION_DIR}" "${CMAKE_SOURCE_DIR}/scripts" "${CMAKE_CURRENT_LIST_DIR}"
REQUIRED
)
endif()

if (NOT DEFINED ADD_RESOURCE_PATH)
set(ADD_RESOURCE_PATH "${CMAKE_CURRENT_BINARY_DIR}")
set(INCDIR "${ADD_RESOURCE_PATH}/${ADD_RESOURCE_TARGET}")
Expand Down
2 changes: 1 addition & 1 deletion test/install_test/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ cmake_minimum_required (VERSION 3.18)

project(Hello LANGUAGES CXX)

find_package (gempyre)
find_package(gempyre)

if(gempyre_FOUND)

Expand Down
1 change: 1 addition & 0 deletions test/unittests/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@ set(CMAKE_CXX_STANDARD 17)
include_directories(
../../gempyrelib/include
../../gempyrelib/src
../../gempyrelib/src/server
include
${TEST_INCLUDE_DIR}
)
Expand Down

0 comments on commit b6a91d2

Please sign in to comment.